Registra una telefonata conclusa
curl --request POST \
--url https://api.dentalspace.ai/v1/calls \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"externalCallId": "<string>",
"from": "<string>",
"to": "<string>",
"startedAt": "2023-11-07T05:31:56Z",
"durationSeconds": 43200,
"summary": "<string>",
"recordingUrl": "<string>",
"transcript": "<string>",
"patientId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"leadId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"facilityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"caller": {
"firstName": "<string>",
"lastName": "<string>"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
externalCallId: '<string>',
from: '<string>',
to: '<string>',
startedAt: '2023-11-07T05:31:56Z',
durationSeconds: 43200,
summary: '<string>',
recordingUrl: '<string>',
transcript: '<string>',
patientId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
leadId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
facilityId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
caller: {firstName: '<string>', lastName: '<string>'}
})
};
fetch('https://api.dentalspace.ai/v1/calls', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dentalspace.ai/v1/calls"
payload = {
"externalCallId": "<string>",
"from": "<string>",
"to": "<string>",
"startedAt": "2023-11-07T05:31:56Z",
"durationSeconds": 43200,
"summary": "<string>",
"recordingUrl": "<string>",
"transcript": "<string>",
"patientId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"leadId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"facilityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"caller": {
"firstName": "<string>",
"lastName": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalCallId": "<string>",
"direction": "inbound",
"from": "<string>",
"to": "<string>",
"startedAt": "<string>",
"durationSeconds": 0,
"outcome": "booked",
"summary": "<string>",
"recordingUrl": "<string>",
"patientId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"leadId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"facilityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "<string>",
"transcript": "<string>"
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}Telefonate
Registra una telefonata conclusa
Scope: calls:write.
Idempotente su externalCallId: 201 la prima volta, 200 con la riga gia’ registrata dopo. Un numero sconosciuto diventa un lead con source=phone.
POST
/
calls
Registra una telefonata conclusa
curl --request POST \
--url https://api.dentalspace.ai/v1/calls \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"externalCallId": "<string>",
"from": "<string>",
"to": "<string>",
"startedAt": "2023-11-07T05:31:56Z",
"durationSeconds": 43200,
"summary": "<string>",
"recordingUrl": "<string>",
"transcript": "<string>",
"patientId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"leadId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"facilityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"caller": {
"firstName": "<string>",
"lastName": "<string>"
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
externalCallId: '<string>',
from: '<string>',
to: '<string>',
startedAt: '2023-11-07T05:31:56Z',
durationSeconds: 43200,
summary: '<string>',
recordingUrl: '<string>',
transcript: '<string>',
patientId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
leadId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
facilityId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
caller: {firstName: '<string>', lastName: '<string>'}
})
};
fetch('https://api.dentalspace.ai/v1/calls', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dentalspace.ai/v1/calls"
payload = {
"externalCallId": "<string>",
"from": "<string>",
"to": "<string>",
"startedAt": "2023-11-07T05:31:56Z",
"durationSeconds": 43200,
"summary": "<string>",
"recordingUrl": "<string>",
"transcript": "<string>",
"patientId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"leadId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"facilityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"caller": {
"firstName": "<string>",
"lastName": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"externalCallId": "<string>",
"direction": "inbound",
"from": "<string>",
"to": "<string>",
"startedAt": "<string>",
"durationSeconds": 0,
"outcome": "booked",
"summary": "<string>",
"recordingUrl": "<string>",
"patientId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"leadId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"facilityId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "<string>",
"transcript": "<string>"
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}Authorizations
Headers
Body
application/json
Pattern:
^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$Response
La telefonata registrata (200 se era gia' registrata).