Calls
Contact Centre Calls API documentation
Introduction
The calls API call is used by contact centre's to retrieve and create contact records.
Get Record by Phone
This API will retrieve a record from SwitchTransact via a phone number.
Path |
---|
GET /calls/record |
Query Parameters:
Parameter | Example |
---|---|
phone | +27721234567 |
Valid Record Response:
{
"status": true,
"contact": {
"id": "2916509f-f188-42d8-ab0e-a27bcb20d70d",
"firstname": "James",
"lastname": "May",
"customer_number": "3008821",
"company": "My Company name",
"businessphone": null,
"businessphone2": null,
"mobilephone": "+27721234567",
"email": "james@may.com",
"entity_type": "Account"
}
}
Please note entity_type
can be: Account, Contact or Lead
Invalid Record Response:
{
"status": false
}
Error Response:
{
"status": false,
"error": "Not authorized to make this API call. Requesting Read on General."
}
When you get this API response ensure that under the API keys section your API Key has the correct permissions: API Keys
Get Record by Email
This API will retrieve a record from SwitchTransact via an email address.
Path |
---|
GET /calls/record |
Query Parameters:
Parameter | Example |
---|---|
james@may.com |
Valid Record Response:
{
"status": true,
"contact": {
"id": "2916509f-f188-42d8-ab0e-a27bcb20d70d",
"firstname": "James",
"lastname": "May",
"customer_number": "3008821",
"company": "My Company name",
"businessphone": null,
"businessphone2": null,
"mobilephone": "+27721234567",
"email": "james@may.com",
"entity_type": "Account"
}
}
Please note entity_type
can be: Account, Contact or Lead
Invalid Record Response:
{
"status": false
}
Error Response:
{
"status": false,
"error": "Not authorized to make this API call. Requesting Read on General."
}
When you get this API response ensure that under the API keys section your API Key has the correct permissions: API Keys
Get Record by Search terms
This API will retrieve a record from SwitchTransact via a search term and can be used as a autocomplete search.
Path |
---|
GET /calls/autocomplete |
Query Parameters:
Parameter | Example |
---|---|
term | name / surname / company / email / cellphone |
Valid Record Response:
{
"status": true,
"contact": {
"id": "2916509f-f188-42d8-ab0e-a27bcb20d70d",
"firstname": "James",
"lastname": "May",
"customer_number": "3008821",
"company": "My Company name",
"businessphone": null,
"businessphone2": null,
"mobilephone": "+27721234567",
"email": "james@may.com",
"entity_type": "Account"
}
}
Please note entity_type
can be: Account, Contact or Lead
Invalid Record Response:
{
"status": false
}
Error Response:
{
"status": false,
"error": "Not authorized to make this API call. Requesting Read on General."
}
When you get this API response ensure that under the API keys section your API Key has the correct permissions: API Keys
Create a Record
This API will create a record on SwitchTransact. These calls do not go through an approval process, for this please see the Contact Centre API
Path |
---|
POST /calls/create |
JSON Body:
{
"firstname": "James",
"lastname": "May",
"phone": "0721234567",
}
Valid Record Response:
{
"firstname": "James",
"lastname": "May",
"phone": "0721234567",
}
Invalid Record Response:
{
"status": false,
"error": "Error message."
}
Error Response:
{
"status": false,
"error": "Not authorized to make this API call. Requesting Read on General."
}
Create a Call Log
This API will create a call log record on SwitchTransact.
Path |
---|
POST /calls/log |
JSON Body:
{
"CallType": "{Inbound|Outbound|Missed|Notanswered}",
"CallDirection": "{Inbound|Outbound}",
"Number": "0721234567",
"Name": "James May",
"EntityId": "{unique id of record}",
"EntityType": "{entity type like person or company}",
"AgentFirstName": "John",
"AgentLastName": "Do",
"AgentEmail": "agent@company.com",
"Duration": "hh:mm:ss",
"DurationTimespan": "hh:mm:ss",
"DateTime": "dd-mm-yy hh:mm:ss",
"CallStartTimeLocal": "hh:mm:ss",
"CallEndTimeLocal": "hh:mm:ss",
}
Valid Record Response:
{
"status": true
}
Invalid Record Response:
{
"status": false,
"error": "Error message."
}
Error Response:
{
"status": false,
"error": "Not authorized to make this API call. Requesting Read on General."
}