Sarv.com

NODEJS

Choose Language

Fetch Voice Report API

http://<domain_name>/api/voice/fetch_report.php?username=<username>&token=<token>&unique_ids=<unique_ids>

Fetch Voice Report API through Sarv

Example

            
request.post({url:'http://<domain_name>/api/voice/fetch_report.php', formData: {'username':'username','token':'abcXYZ','unique_ids':'unique_ids'}}, function optionalCallback(err, httpResponse, body) {
  if (err) {
    return console.error('upload failed:', err);
  }
  console.log('Upload successful!  Server responded with:', body);  
  console.log(body);
    /*
    {
	"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",
		  }
   }
}
     */  
});
            
            

Example Success Response


{
	"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",
		  }
   }
}

Example Error Response


{
	"status":"error",
	"code":"007",
	"desc":"Invalid announcement type (mp3 allowed only)"
}

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 .