Repair visits
curl --request GET \
--url https://api.sortx.co.uk/maintenance-pro/repairs/{id}/visits \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sortx.co.uk/maintenance-pro/repairs/{id}/visits', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sortx.co.uk/maintenance-pro/repairs/{id}/visits"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"repairId": "<string>",
"visits": [
{
"number": 123,
"calendarEventId": "<string>",
"startsAt": "<string>",
"endsAt": "<string>",
"state": "booked",
"current": true,
"contractor": "<string>",
"outcome": {
"id": "<string>",
"result": "fixed",
"reasons": [
"tenant_not_home"
],
"note": "<string>",
"source": "staff",
"recordedBy": "<string>",
"recordedAt": "<string>",
"nextStep": {
"parts": {
"part": "<string>",
"supplier": "<string>",
"ordered": true,
"expectedOn": "<string>",
"costMinor": 123,
"currency": "<string>",
"returnDurationMinutes": 123
},
"quote": {
"quoteId": "<string>",
"lines": [
{
"description": "<string>",
"amountMinor": 123
}
],
"totalMinor": 123,
"vatMinor": 123,
"earliestStartOn": "<string>",
"currency": "<string>"
},
"hazard": {
"description": "<string>",
"madeSafe": true,
"anyoneAtRisk": true
},
"returnVisit": {
"needed": "<string>",
"timeNeededMinutes": 123,
"returnBy": "<string>"
},
"photoDocumentIds": [
"<string>"
]
}
},
"arrivals": [
{
"stage": "<string>",
"at": "<string>",
"note": "<string>"
}
]
}
],
"contacts": [
{
"id": "<string>",
"party": "tenant",
"partyName": "<string>",
"channel": "call",
"direction": "outbound",
"result": "spoke",
"note": "<string>",
"occurredAt": "<string>",
"recordedBy": "<string>"
}
],
"summary": {
"visits": 123,
"unfinished": 123,
"contactAttempts": 123,
"unanswered": 123
}
}{
"_tag": "TenantCreateRejected",
"reason": "<string>",
"field": "<string>"
}{
"_tag": "Unauthenticated"
}{
"_tag": "TenantSuspended",
"tenantId": "<string>",
"reason": "<string>"
}{
"_tag": "EntitlementMissing",
"tenantId": "<string>",
"moduleId": "<string>"
}{
"_tag": "TenantNotFound",
"slug": "<string>"
}{
"_tag": "WebhookDuplicate",
"integration": "<string>",
"externalId": "<string>"
}{
"_tag": "RateLimited",
"key": "<string>",
"retryAfterSeconds": 123,
"message": "<string>"
}{
"_tag": "IntegrationUnavailable",
"integration": "<string>",
"detail": "<string>"
}maintenance-pro
Repair visits
Every visit on a repair with its outcome, and every contact attempt about it
GET
/
maintenance-pro
/
repairs
/
{id}
/
visits
Repair visits
curl --request GET \
--url https://api.sortx.co.uk/maintenance-pro/repairs/{id}/visits \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sortx.co.uk/maintenance-pro/repairs/{id}/visits', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sortx.co.uk/maintenance-pro/repairs/{id}/visits"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"repairId": "<string>",
"visits": [
{
"number": 123,
"calendarEventId": "<string>",
"startsAt": "<string>",
"endsAt": "<string>",
"state": "booked",
"current": true,
"contractor": "<string>",
"outcome": {
"id": "<string>",
"result": "fixed",
"reasons": [
"tenant_not_home"
],
"note": "<string>",
"source": "staff",
"recordedBy": "<string>",
"recordedAt": "<string>",
"nextStep": {
"parts": {
"part": "<string>",
"supplier": "<string>",
"ordered": true,
"expectedOn": "<string>",
"costMinor": 123,
"currency": "<string>",
"returnDurationMinutes": 123
},
"quote": {
"quoteId": "<string>",
"lines": [
{
"description": "<string>",
"amountMinor": 123
}
],
"totalMinor": 123,
"vatMinor": 123,
"earliestStartOn": "<string>",
"currency": "<string>"
},
"hazard": {
"description": "<string>",
"madeSafe": true,
"anyoneAtRisk": true
},
"returnVisit": {
"needed": "<string>",
"timeNeededMinutes": 123,
"returnBy": "<string>"
},
"photoDocumentIds": [
"<string>"
]
}
},
"arrivals": [
{
"stage": "<string>",
"at": "<string>",
"note": "<string>"
}
]
}
],
"contacts": [
{
"id": "<string>",
"party": "tenant",
"partyName": "<string>",
"channel": "call",
"direction": "outbound",
"result": "spoke",
"note": "<string>",
"occurredAt": "<string>",
"recordedBy": "<string>"
}
],
"summary": {
"visits": 123,
"unfinished": 123,
"contactAttempts": 123,
"unanswered": 123
}
}{
"_tag": "TenantCreateRejected",
"reason": "<string>",
"field": "<string>"
}{
"_tag": "Unauthenticated"
}{
"_tag": "TenantSuspended",
"tenantId": "<string>",
"reason": "<string>"
}{
"_tag": "EntitlementMissing",
"tenantId": "<string>",
"moduleId": "<string>"
}{
"_tag": "TenantNotFound",
"slug": "<string>"
}{
"_tag": "WebhookDuplicate",
"integration": "<string>",
"externalId": "<string>"
}{
"_tag": "RateLimited",
"key": "<string>",
"retryAfterSeconds": 123,
"message": "<string>"
}{
"_tag": "IntegrationUnavailable",
"integration": "<string>",
"detail": "<string>"
}Authorizations
A workspace API key (Settings → API keys), scoped to <group>:read / <group>:write.