{'page': {
'endIndex': 1,
'last': 'http://localhost/api/v1/app/list?apikey=89e801bcc21f430aa1ff6edb5421af31&pg=1',
'first': 'http://localhost/api/v1/app/list?apikey=89e801bcc21f430aa1ff6edb5421af31&pg=1',
'startIndex': 1,
'totalItems': 1,
'cur': 'http://localhost/api/v1/app/list?apikey=89e801bcc21f430aa1ff6edb5421af31',
'totalPages': 1
},
'data': [
{
'guid': '4e11fe2082b044b4a3b55718c79c29d5',
'number.virtual': '33047316',
'number.physical': '33047316',
'name': 'test'
}
]
}
Apps are identified using their respective guid. You need to store the guid in your app database table to be able to be identified during a call event. List of apps can be retrieved using app list API (see topic 2.1)
Agent groups are identified using their names
All API responses are JSON encoded, http code 200 indicates success, other codes should be considered as errors.
eg. response:
eg. response:
{ 'data': [
{
'name': 'default',
'display_name': 'default'
}
]
}
eg. response:
{ 'sticky': false,
'name': 'default',
'ringtime': 15,
'recording': 'enabled',
'distribution': 'RR',
'sticky_days': 30
}
eg. response:
{ 'sticky': false,
'name': 'default',
'ringtime': 15,
'recording': 'enabled',
'distribution': 'RR',
'sticky_days': 30
}
group lists the group parameters for object def ref:
eg. response:
{ 'maxPriority': 1,
'agents': [
{
'type': 'USER',
'number': '971670XXXX',
'priority': 1,
'guid': '21c50d57625040419a7bef92ea4c6c6c',
'name': 'Anil Gupta'
}
]
}
maxPriorityis the highest priority entry in the group, useful for new agent entries
agentsarray lists all agents in a group for object def ref:topic 1.3
Adding agents is a 2 step process. All agent numbers are to be verified before they could be placed in the system. A number needs to be verified only once for a given subscriber.
Every time you need to add an agent into a group you must call Number verification API first (see below) with a preferred method. The API will respond with either ‘passed’ or ‘pending’. ‘pending’ indicates that this is the first time this number is being added, you must call the verification API again along with the `key` parameter before proceeding to add agent. See examples below.
Check if number 971670XXXX is verified, if not verify it
Request:
POST: https://mycalls.sukamapps.com/api/v1/app/21c50d57625040419a7bef92ea4c6c6c/verifyagent
Header: X-APIKey=xxxxxxxxxxxxxx
POST Data: number=971670XXXX&method=sms
Response
{ 'verification': 'pending'
}
Number is not verified, let”s verify it using the key received.
Request:
POST: https://mycalls.sukamapps.com/api/v1/app/21c50d57625040419a7bef92ea4c6c6c/verifyagent
Header: X-APIKey=xxxxxxxxxxxxxx
POST Data: number=971670XXXX&key=0805
Response
{ 'verification': 'passed'
}
Number is now verified, we can add it to a group now using add agent API in the next section.
Add 971670XXXX to group default in an app
Request:
POST: https://mycalls.sukamapps.com/api/v1/app/21c50d57625040419a7bef92ea4c6c6c/ag/default/addAgent
Header: X-APIKey=xxxxxxxxxxxxxx
POST Data: number=971670XXXX&name=testagent
Response
{ 'result': 'success'
}
Remove 971670XXXX from group default in an app
Request:
POST: https://mycalls.sukamapps.com/api/v1/app/21c50d57625040419a7bef92ea4c6c6c/ag/default/remAgent
Header: X-APIKey=xxxxxxxxxxxxxx
POST Data: number=971670XXXX
Response
{ 'result': 'success'
}
eg. response:
{ 'page': {
'totalItems': 1,
'last': 'http://mycalls.sukamapps.com/api/v1/app/1a11fe2082b044b4a3b55718c79c29d5/calls?pg=1',
'pageItems': 1,
'pageNumber': 1,
'cur': 'http://mycalls.sukamapps.com/api/v1/app/1a11fe2082b044b4a3b55718c79c29d5/calls',
'endIndex': 1,
'startIndex': 1,
'totalPages': 1,
'first': 'http://mycalls.sukamapps.com/api/v1/app/1a11fe2082b044b4a3b55718c79c29d5/calls?pg=1'
},
'data': [
{
'log': [
{
'desc': 'TRANSFER SOON',
'id': 'TRANSFER_INIT'
}
],
'hot': 0,
'cli': '9716700271',
'uid': '1498110438.13',
'time': '2017-06-22T11:17:18+05:30',
'active': false,
'duration': '19',
'transfer': [
{
'attemptId': '1498110438.13.2',
'du': '3',
'name': 'Anil Gupta',
'seq': '7',
'time': '2017-06-22T11:17:36+05:30',
'to': '971670XXXX',
'group': 'default',
'disposition': 'answered'
},
{
'attemptId': '1498110438.13.1',
'du': '0',
'name': 'Anil Gupta',
'seq': '5',
'time': '2017-06-22T11:17:20+05:30',
'to': '971670XXXX',
'group': 'default',
'disposition': 'noanswer'
}
]
}
]
}
For incremental call log pass `since` parameter to the call log api.
eg. response:
{
url: "someurl/s.745726.wav"
}
Your API key is listed on your profile page https://mycalls.sukamapps.com/profile
API key can be used in 2 different ways,
a) by appending it to the url as apikey parameter. eg. https://mycalls.sukamapps.com/api/v1/acc/list?apikey=yourlongapikey
b) by using X-APIKey header in the request
method a) only works for get requests like getting a list of apps or subscribers and will not work for post requests like adding an operator, hence it is advisable to use method b
This event is triggered when an incoming call is received by any application.
Parameters:
app: The unique GUID of the application handling the incoming call (see Topic 1.1 for details).
event: Set to "IN" to signify that this is an incoming call.
uniqueid: A unique identifier for the call.
cli: The caller’s ID number, as it was received.
time: The timestamp when the incoming call was logged (see Topic 4.1 for timing details).
This event occurs when the IVR system tries to transfer the call to an agent.
Parameters:
app: The unique GUID of the application responsible for the transfer attempt (see Topic 1.1).
event: Set to "TA" to indicate a transfer attempt.
uniqueid: A unique identifier for the original call.
cli: The caller’s ID number as received.
attemptid: A unique identifier for this specific transfer attempt.
time: The time when the transfer attempt was made (see Topic 4.1 for timing details).
to: The identifier of the agent to whom the call is being transferred.
This event is triggered when the call is successfully answered by the agent.
Parameters:
app: The GUID of the application managing the call (see Topic 1.1).
event: Set to "TC" to indicate that the transfer has been successfully connected.
uniqueid: The unique identifier of the original call.
cli: The caller’s ID number.
attemptid: A unique identifier for the transfer attempt.
time: The timestamp when the agent answers the call (see Topic 4.1).
to: The agent’s number who answered the call.
This event occurs when the transfer process ends, either successfully or unsuccessfully.
Parameters:
app: The GUID of the application handling the call (see Topic 1.1).
event: Set to "TE" to indicate the transfer has ended.
uniqueid: A unique identifier for the original call.
cli: The caller’s ID number.
attemptid: A unique identifier for the transfer attempt.
to: The agent’s number to whom the call was transferred.
duration: The length of time the transfer lasted, in seconds.
result: The outcome of the transfer, which can be one of the following:
answered: The call was answered by the agent.
busy: The agent was unavailable.
congestion: A network issue or congestion occurred.
noanswer: The agent did not answer the call.
This event is triggered when the call is hung up, either by the caller or the agent.
Parameters:
app: The GUID of the application managing the call (see Topic 1.1).
event: Set to "H" to indicate that the call has been hung up.
uniqueid: The unique identifier for the call.
cli: The caller’s ID number.
duration: The total duration of the call in seconds.