Enquiry suggestions
curl --request GET \
--url https://api.sortx.co.uk/front-desk/enquiries/{id}/suggestions \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sortx.co.uk/front-desk/enquiries/{id}/suggestions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sortx.co.uk/front-desk/enquiries/{id}/suggestions"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"enabled": true,
"items": [
{
"id": "<string>",
"enquiryId": "<string>",
"sourceKind": "whatsapp.message",
"sourceId": "<string>",
"sourceText": "<string>",
"receivedAt": "<string>",
"status": "pending",
"reason": "<string>",
"result": {
"tasks": {
"status": "ready",
"reason": "<string>",
"model": "<string>",
"tasks": [
{
"item": "<string>",
"quote": "<string>",
"title": "<string>",
"typeId": "<string>",
"typeName": "<string>",
"teamId": "<string>",
"teamName": "<string>",
"assigneeStaffId": "<string>",
"dueOn": "<string>",
"confidence": 123
}
],
"uncertainQuotes": [
"<string>"
],
"duplicatesMerged": 123
},
"booking": {
"status": "suggested",
"reason": "<string>",
"model": "<string>",
"intent": "book",
"confidence": 123,
"appointment": {
"id": "<string>",
"kind": "<string>",
"title": "<string>",
"startsAt": "<string>",
"endsAt": "<string>",
"status": "<string>",
"staffId": "<string>",
"propertyId": "<string>",
"revision": 123,
"contactId": "<string>"
},
"lastViewing": {
"id": "<string>",
"kind": "<string>",
"title": "<string>",
"startsAt": "<string>",
"endsAt": "<string>",
"status": "<string>",
"staffId": "<string>",
"propertyId": "<string>",
"revision": 123,
"contactId": "<string>"
},
"postViewing": true,
"feedbackThemes": [
{
"theme": "<string>",
"label": "<string>"
}
],
"interestLabel": "<string>"
},
"routing": {
"status": "suggested",
"reason": "<string>",
"model": "<string>",
"category": "<string>",
"categoryConfidence": 123,
"overlaps": [
"<string>"
],
"teamId": "<string>",
"teamName": "<string>",
"teamConfidence": 123,
"reasons": [
"<string>"
]
}
},
"reviews": [
{
"item": "<string>",
"decision": "accepted",
"recordKind": "<string>",
"recordId": "<string>",
"reviewedByUserId": "<string>",
"note": "<string>",
"createdAt": "<string>"
}
],
"retryParts": [
"tasks"
],
"canRetry": true,
"erasedAt": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
}
]
}{
"_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>"
}front-desk
Enquiry suggestions
The task, booking and routing suggestions read from each inbound message of a conversation, with every decision on them
GET
/
front-desk
/
enquiries
/
{id}
/
suggestions
Enquiry suggestions
curl --request GET \
--url https://api.sortx.co.uk/front-desk/enquiries/{id}/suggestions \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sortx.co.uk/front-desk/enquiries/{id}/suggestions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sortx.co.uk/front-desk/enquiries/{id}/suggestions"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"enabled": true,
"items": [
{
"id": "<string>",
"enquiryId": "<string>",
"sourceKind": "whatsapp.message",
"sourceId": "<string>",
"sourceText": "<string>",
"receivedAt": "<string>",
"status": "pending",
"reason": "<string>",
"result": {
"tasks": {
"status": "ready",
"reason": "<string>",
"model": "<string>",
"tasks": [
{
"item": "<string>",
"quote": "<string>",
"title": "<string>",
"typeId": "<string>",
"typeName": "<string>",
"teamId": "<string>",
"teamName": "<string>",
"assigneeStaffId": "<string>",
"dueOn": "<string>",
"confidence": 123
}
],
"uncertainQuotes": [
"<string>"
],
"duplicatesMerged": 123
},
"booking": {
"status": "suggested",
"reason": "<string>",
"model": "<string>",
"intent": "book",
"confidence": 123,
"appointment": {
"id": "<string>",
"kind": "<string>",
"title": "<string>",
"startsAt": "<string>",
"endsAt": "<string>",
"status": "<string>",
"staffId": "<string>",
"propertyId": "<string>",
"revision": 123,
"contactId": "<string>"
},
"lastViewing": {
"id": "<string>",
"kind": "<string>",
"title": "<string>",
"startsAt": "<string>",
"endsAt": "<string>",
"status": "<string>",
"staffId": "<string>",
"propertyId": "<string>",
"revision": 123,
"contactId": "<string>"
},
"postViewing": true,
"feedbackThemes": [
{
"theme": "<string>",
"label": "<string>"
}
],
"interestLabel": "<string>"
},
"routing": {
"status": "suggested",
"reason": "<string>",
"model": "<string>",
"category": "<string>",
"categoryConfidence": 123,
"overlaps": [
"<string>"
],
"teamId": "<string>",
"teamName": "<string>",
"teamConfidence": 123,
"reasons": [
"<string>"
]
}
},
"reviews": [
{
"item": "<string>",
"decision": "accepted",
"recordKind": "<string>",
"recordId": "<string>",
"reviewedByUserId": "<string>",
"note": "<string>",
"createdAt": "<string>"
}
],
"retryParts": [
"tasks"
],
"canRetry": true,
"erasedAt": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
}
]
}{
"_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>"
}