V 2.0
Agent
Introduction
This document provides detailed information about the API endpoints available in the Agent.js file. It includes request parameters, response formats, and examples for each endpoint.
Base URL
The base URL for all API endpoints is: deepcall/api/v2/Agent
Authentication
Authentication is required for all endpoints. It can be done in two ways:
-
Using
ssid(Session ID) -
Using
userIdandtoken
Note: When userId and token are used, ssid should not be present in the request.
Error Codes
| Error Code | Description |
|---|---|
| 1501 | Data already in processing |
| 1502 | Invalid filter value |
| 1503 | Invalid role id |
| 1504 | Invalid parent |
| 1505 | Invalid group data |
| 1506 | AgentId and parent could not be same |
| 1507 | Invalid AgentID |
| 1508 | Invalid status value |
| 1509 | Invalid agentId |
| 1510 | Invalid Destination |
| 1511 | Working time format is invalid |
| 1512 | Email already exists |
| 1513 | Invalid type |
| 1514 | Invalid mobile Number |
| 1515 | Invalid Name |
| 1516 | Invalid Did Number |
| 1517 | Your agentid and your loginid must be same |
| 1518 | Data could not be updated |
| 1519 | Call Password must be Integer and Eight digit |
| 1520 | You must be single field update |
| 1521 | Please Provide Only Valid fields |
| 1522 | You could not inserted your data. Please try again |
| 1523 | Your agent information is already added |
| 1524 | Invalid Action |
| 1525 | Invalid Targetagent Id |
| 1526 | Invalid Id |
| 1527 | Invalid Type |
| 1528 | Invalid Favorite Data |
| 1529 | Invalid Domain |
| 1530 | Invalid Agent Timing |
CAD Unset
Introduction
This document provides detailed information about the Agent CAD Unset API endpoint. It includes request parameters, response formats, and examples.
Base URL
The base URL for this API endpoint is: deepcall/api/v2/Agent
Authentication
Authentication is required for this endpoint. It can be done in two ways:
- Using
ssid(Session ID) - Using
userIdandtoken
Note: When userId and token are used, ssid should not be present in the request.
Unset Agent CAD
Endpoint
- Method: POST
-
Path:
deepcall/api/v2/Agent/unsetCad
Description
The Unset Agent CAD endpoint allows you to remove CAD settings for one or multiple agents. This API processes agent IDs in bulk and returns results for each agent.
Use Cases
- Remove CAD settings from multiple agents
- Disable CAD for specific agents
- Bulk CAD management
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ssid | string | Yes* | Session ID (*required if userId/token not provided) |
| userId | string | Yes* | User ID for authentication (*required if ssid not used) |
| token | string | Yes* | Authentication token (*required if ssid not used) |
| agentIds | array | Yes | Array of agent IDs to unset CAD |
Request Example
With SSID
{
"ssid": "{{ssid}}",
"agentIds": [XX]
}
With Token and UserId
{
"userId": "{{userid}}",
"token": "{{token}}",
"agentIds": ["X", "XX"]
}
Response Details
Success Response
Status Code: 200
{
"status": "success",
"code": 200,
"message": "Agent unsetCad process completed.",
"data": {
"unsetCadAgents": ["X", "XX"],
"errors": []
}
}
| Field | Type | Description |
|---|---|---|
| status | string | Response status ("success") |
| code | number | Response code (200) |
| message | string | Process completion message |
| data | object | Results data |
| data.unsetCadAgents | array | Successfully unset agent IDs |
| data.errors | array | Array of errors for failed operations |
| data.errors[].agentId | string | Agent ID that failed |
| data.errors[].message | string | Error message |
Response Examples
Example 1: All Agents Not Found
Request:
{
"ssid": "{{ssid}}",
"agentIds": ["X", "XX"]
}
Response:
{
"status": "success",
"code": 200,
"message": "Agent unsetCad process completed.",
"data": {
"unsetCadAgents": [],
"errors": [
{
"agentId": "X",
"message": "Agent not found or already unset."
},
{
"agentId": "XX",
"message": "Agent not found or already unset."
}
]
}
}
Example 2: Partial Success
Request:
{
"ssid": "{{ssid}}",
"agentIds": ["XXXXX", "XX"]
}
Response:
{
"status": "success",
"code": 200,
"message": "Agent unsetCad process completed.",
"data": {
"unsetCadAgents": ["XX"],
"errors": [
{
"agentId": "XXXXX",
"message": "Agent not found or already unset."
}
]
}
}
Error Response Examples
Error 1: Invalid Parameter
Request:
{
"ssid": "{{ssid}}",
"agentIds": XX
}
Response:
{
"status": "error",
"message": "invalid parameter",
"code": 1000
}
Error Codes
| Error Code | Description |
|---|---|
| 1000 | Invalid parameters |
| 1014 | Invalid token |
| 1047 | Invalid request (empty body) |
Notes
-
Authentication: Either
ssidOR (userId+token) must be provided - agentIds: Must be an array (not a single value)
- Response: Always returns success with individual agent results in the data object
-
Errors: Failed agents appear in the
errorsarray with reason
Example cURL Request
curl -X POST "deepcall/api/v2/Agent/unsetCad" \
-H "Content-Type: application/json" \
-d '{
"ssid": "{{ssid}}",
"agentIds": [XX, XXX]
}'
CAD Unset
var axios = require('axios');
var data = '{"ssid":"{{ssid}}","agentIds":["1","14"]}';
var config = {
method: 'post',
url: '{{brand}}/api/v2/Agent/unsetCad',
headers: {
'Content-Length': ''
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
setUrl('{{brand}}/api/v2/Agent/unsetCad');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Length' => ''
));
$request->setBody('{"ssid":"{{ssid}}","agentIds":["1","14"]}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}import http.client
conn = http.client.HTTPSConnection("{{brand}}")
payload = "{\"ssid\":\"{{ssid}}\",\"agentIds\":[\"1\",\"14\"]}"
headers = {
'Content-Length': ''
}
conn.request("POST", "/api/v2/Agent/unsetCad", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))var client = new RestClient("{{brand}}/api/v2/Agent/unsetCad");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
var body = @"{" + "\n" +
@" ""ssid"":""{{ssid}}""," + "\n" +
@" ""agentIds"":[""1"",""14""]" + "\n" +
@"}";
request.AddParameter("text/plain", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);curl --location -g --request POST '{{brand}}/api/v2/Agent/unsetCad' \
--data-raw '{
"ssid":"{{ssid}}",
"agentIds":["1","14"]
}'var request = http.Request('POST', Uri.parse('{{brand}}/api/v2/Agent/unsetCad'));
request.body = '''{\n "ssid":"{{ssid}}",\n "agentIds":["1","14"]\n}''';
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "%7B%7Bbrand%7D%7D/api/v2/Agent/unsetCad"
method := "POST"
payload := strings.NewReader(`{
"ssid":"{{ssid}}",
"agentIds":["1","14"]
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}POST /api/v2/Agent/unsetCad HTTP/1.1
Host: {{brand}}
Content-Length: 52
{
"ssid":"{{ssid}}",
"agentIds":["1","14"]
}OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "{\n \"ssid\":\"{{ssid}}\",\n \"agentIds\":[\"1\",\"14\"]\n}");
Request request = new Request.Builder()
.url("{{brand}}/api/v2/Agent/unsetCad")
.method("POST", body)
.addHeader("Content-Length", "")
.build();
Response response = client.newCall(request).execute();var myHeaders = new Headers();
myHeaders.append("Content-Length", "");
var raw = "{\n \"ssid\":\"{{ssid}}\",\n \"agentIds\":[\"1\",\"14\"]\n}";
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("{{brand}}/api/v2/Agent/unsetCad", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(curl, CURLOPT_URL, "%7B%7Bbrand%7D%7D/api/v2/Agent/unsetCad");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Content-Length: ");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
const char *data = "{\n \"ssid\":\"{{ssid}}\",\n \"agentIds\":[\"1\",\"14\"]\n}";
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);
#import
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"%7B%7Bbrand%7D%7D/api/v2/Agent/unsetCad"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"Content-Length": @""
};
[request setAllHTTPHeaderFields:headers];
NSData *postData = [[NSData alloc] initWithData:[@"{\n \"ssid\":\"{{ssid}}\",\n \"agentIds\":[\"1\",\"14\"]\n}" dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:postData];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
dispatch_semaphore_signal(sema);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER); open Lwt
open Cohttp
open Cohttp_lwt_unix
let postData = ref "{\n \"ssid\":\"{{ssid}}\",\n \"agentIds\":[\"1\",\"14\"]\n}";;
let reqBody =
let uri = Uri.of_string "%7B%7Bbrand%7D%7D/api/v2/Agent/unsetCad" in
let headers = Header.init ()
|> fun h -> Header.add h "Content-Length" ""
in
let body = Cohttp_lwt.Body.of_string !postData in
Client.call ~headers ~body `POST uri >>= fun (_resp, body) ->
body |> Cohttp_lwt.Body.to_string >|= fun body -> body
let () =
let respBody = Lwt_main.run reqBody in
print_endline (respBody)$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Length", "")
$body = "{`n `"ssid`":`"{{ssid}}`",`n `"agentIds`":[`"1`",`"14`"]`n}"
$response = Invoke-RestMethod '{{brand}}/api/v2/Agent/unsetCad' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Jsonrequire "uri"
require "net/http"
url = URI("{{brand}}/api/v2/Agent/unsetCad")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["Content-Length"] = ""
request.body = "{\n \"ssid\":\"{{ssid}}\",\n \"agentIds\":[\"1\",\"14\"]\n}"
response = http.request(request)
puts response.read_body
printf '{
"ssid":"{{ssid}}",
"agentIds":["1","14"]
}'| http --follow --timeout 3600 POST '{{brand}}/api/v2/Agent/unsetCad' \
Content-Length:import Foundation
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
var semaphore = DispatchSemaphore (value: 0)
let parameters = "{\n \"ssid\":\"{{ssid}}\",\n \"agentIds\":[\"1\",\"14\"]\n}"
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "{{brand}}/api/v2/Agent/unsetCad")!,timeoutInterval: Double.infinity)
request.addValue("", forHTTPHeaderField: "Content-Length")
request.httpMethod = "POST"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
semaphore.signal()
return
}
print(String(data: data, encoding: .utf8)!)
semaphore.signal()
}
task.resume()
semaphore.wait()
Example Response
[{"key":"Date"
"value":"Sat
15 Nov 2025 11:57:54 GMT"}
{"key":"Content-Type"
"value":"application\/json; charset=utf-8"}
{"key":"Content-Length"
"value":"242"}
{"key":"Connection"
"value":"keep-alive"}
{"key":"Access-Control-Allow-Origin"
"value":"*"}
{"key":"Access-Control-Allow-Methods"
"value":"GET
PUT
POST
DELETE
OPTIONS"}
{"key":"Access-Control-Allow-Headers"
"value":"session-token
Authorization
Origin
Accept
Content-Type
DNT
Authorization
Keep-Alive
User-Agent
X-Requested-With
If-Modified-Since
Cache-Control
Content-Type
Content-Range
Range"}
{"key":"Access-Control-Allow-Credentials"
"value":"true"}
{"key":"Vary"
"value":"Origin"}
{"key":"ETag"
"value":"W\/\"f2-JEeAAXxxqEfXBM4+dsHpK5xKIe0\""}
{"key":"Strict-Transport-Security"
"value":"max-age=15724800; includeSubDomains"}
{"key":"Access-Control-Max-Age"
"value":"1728000"}]
{
"status": "success",
"code": 200,
"message": "Agent unsetCad process completed.",
"data": {
"unsetCadAgents": [],
"errors": [
{
"agentId": "1",
"message": "Agent not found or already unset."
},
{
"agentId": "14",
"message": "Agent not found or already unset."
}
]
}
}