http://<domain_name>/api/voice/fetch_report.php?username=<username>&token=<token>&unique_ids=<unique_ids>
Fetch Voice Report API through Sarv
try:
import requests
result = requests.post("http://<domain_name>/api/voice/fetch_report.php", data={'username':'username','token':'abcXYZ','unique_ids':'unique_ids'})
print result
'''
{
"status":"success",
"code":"000",
"desc":"Request Submitted Successfully",
"data":{
"5950_3_10-u1":{
"status":"success",
"desc":"unique id fetched found",
"data":{
"status":"Dialed",
"report":"Congession",
"contact_number":"9782XXXXXX",
"duration":"0",
"time_start":"10-Oct-2017 2:34:58 PM",
"time_connect":"10-Oct-2017 2:35:11 PM",
"time_end":"10-Oct-2017 2:35:11 PM",
"dtmf":""
}
},
"5950_4_10-u1":{
"status":"success",
"desc":"unique id fetched found",
"data":{
"status":"Dialed",
"report":"Answered",
"contact_number":"8947XXXXXX",
"duration":"1",
"time_start":"10-Oct-2017 2:34:52 PM",
"time_connect":"10-Oct-2017 2:34:57 PM",
"time_end":"10-Oct-2017 2:34:58 PM",
"dtmf":""
}
},
"abcd":{
"status":"error",
"desc":"invalid unique id",
}
}
}
'''
except e:
print 'A error occurred: %s - %s' % (e.__class__, e)
{
"status":"success",
"code":"000",
"desc":"Request Submitted Successfully",
"data":{
"5950_3_10-u1":{
"status":"success",
"desc":"unique id fetched found",
"data":{
"status":"Dialed",
"report":"Congession",
"contact_number":"9782XXXXXX",
"duration":"0",
"time_start":"10-Oct-2017 2:34:58 PM",
"time_connect":"10-Oct-2017 2:35:11 PM",
"time_end":"10-Oct-2017 2:35:11 PM",
"dtmf":""
}
},
"5950_4_10-u1":{
"status":"success",
"desc":"unique id fetched found",
"data":{
"status":"Dialed",
"report":"Answered",
"contact_number":"8947XXXXXX",
"duration":"1",
"time_start":"10-Oct-2017 2:34:52 PM",
"time_connect":"10-Oct-2017 2:34:57 PM",
"time_end":"10-Oct-2017 2:34:58 PM",
"dtmf":""
}
},
"abcd":{
"status":"error",
"desc":"invalid unique id",
}
}
}
{
"status":"error",
"code":"001",
"desc":"Parameter Missing"
}
| Parameters |
| username* string |
a valid Sarv SMS Panel User Name |
| token* string |
a valid token |
| unique_ids* string |
comma (,) seperated unique ids ( Ex : unique_id1,unique_id2 ) |
* compulsory field
| Return Value: Success |
| struct |
the results of Fetch Voice Report API
| status string |
success |
| code string |
000 |
| desc array |
array of unique ids and respective results.
| Unique Id(key) |
status |
desc |
| 123_21_XX |
success |
data found |
| 123_22_XX |
error |
Invalid Unique Id |
|
|
|
| Return Value: Error |
| struct |
the error results when Fetch Voice Report API
| status string |
error |
| code string |
007 |
| desc string |
Invalid announcement type (mp3 allowed only) |
|
|
| Api Response Codes |
| 000 |
Announcement Uploaded Successfully. |
| 001 |
Parameter Missing . |
| 002 |
Parameter is blank. |
| 003 |
Request IP not added in whitelist . |
| 004 |
Invalid user type. |
| 005 |
Invalid Credentials. |
| 006 |
User is InActive. |
| 019 |
Exceeded unique ids limit for single api call . |