Desk360 APIs also support Cross-Origin Resource Sharing (CORS ).
The list of API commands used by Desk360
All API requests must reach the secure endpoint i.e. HTTPS only
This rate limit applies are based on IP address.
The limits will be company based rather than IP based in the future.
Make sure to apply the rate limit-best practices and it stays within the rate limit.
Make sure to make API calls in a safe layer such as your backend, not front-end or your mobile application .
Remind that even invalid requests are included in the rate limit.
Check your current rate limit status by looking at the following HTTP headers returned in response to each API request:
Copy HTTP/1.1 200 OK
Content-Type : application/json
X-RateLimit-Limit : 180
X-RateLimit-Remaining : 178
If your API request is received after the rate limit is reached, Desk360 will return an error in the response. The Retry-After value in the response header will tell you how long to wait before sending another API request.
Copy HTTP/1.1 200 OK
Content-Type : application/json
Retry-After : 26
Who can access my helpdesk? Can anyone see my data?
Before prioritizing a ticket or responding to a customer or using any of the APIs listed above, you must authenticate or log in as you sign in to your helpdesk web portal.
To authenticate the request, you can use your personal. You can access this API key directly from the panel, or you can obtain your API token with a request with your username and password .
All Desk360 API endpoints (except login) need this token in order to respond to your request.
Option 1: Obtain your token with a request.
If you enable password access from your Desk360 Panel / Settings / API you can directly use v1/login endpoint in order to create/obtain an API token. This API will return an API token if it is already created, if not it will auto-generate a token and returns it.
To make it secure, the maximum wrong login attempt is fixed to 5 per minute .
Correct attempts do not affect the limits.
Login
GET
https://api.desk360.com/v1/login
Use a valid email and password pair to obtain a token.
Request Body
200 Your API access token return as "token"
Copy {
"access_token": "WEFjiPUQo6FSV55RXx0T5uc5GKdmHxohsawEajAKyV1ZdUloZAExAhAAtPH1hMNbYUMsT2r7UpdN4gym",
"token_type": "Bearer"
}
cURL C# Java JavaScript PHP Python
Copy curl --location --request POST 'https://api.desk360.com/v1/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "abc@example.com",
"password": "YOUR_PASSWORD"
}'
Copy var client = new RestClient ( "https://api.desk360.com/v1/login" );
client . Timeout = - 1 ;
var request = new RestRequest ( Method . POST );
request . AddHeader ( "Content-Type" , "application/json" );
request.AddParameter("application/json", "{\n \"email\": \"abc@example.com\",\n \"password\": \"YOUR_PASSWORD\"\n}", ParameterType.RequestBody);
IRestResponse response = client . Execute (request);
Console . WriteLine ( response . Content );
Copy OkHttpClient client = new OkHttpClient() . newBuilder ()
. build ();
MediaType mediaType = MediaType . parse ( "application/json" );
RequestBody body = RequestBody.create(mediaType, "{\n \"email\": \"abc@example.com\",\n \"password\": \"YOUR_PASSWORD\"\n}");
Request request = new Request . Builder ()
. url ( "https://api.desk360.com/v1/login" )
. method ( "POST" , body)
. addHeader ( "Content-Type" , "application/json" )
. build ();
Response response = client . newCall (request) . execute ();
Copy var axios = require ( 'axios' );
var data = JSON .stringify ({ "email" : "abc@example.com" , "password" : "YOUR_PASSWORD" });
var config = {
method : 'post' ,
url : 'https://api.desk360.com/v1/login' ,
headers : {
'Content-Type' : 'application/json'
} ,
data : data
};
axios (config)
.then ( function (response) {
console .log ( JSON .stringify ( response .data));
})
.catch ( function (error) {
console .log (error);
});
Copy <? php
$client = new http \ Client ;
$request = new http \ Client \ Request ;
$request -> setRequestUrl ( 'https://api.desk360.com/v1/login' ) ;
$request -> setRequestMethod ( 'POST' ) ;
$body = new http \ Message \ Body ;
$body -> append ( '{
"email": "abc@example.com",
"password": "YOUR_PASSWORD"
}' ) ;
$request -> setBody ( $body ) ;
$request -> setOptions ( array () ) ;
$request -> setHeaders ( array (
'Content-Type' => 'application/json'
) ) ;
$client -> enqueue ( $request ) -> send () ;
$response = $client -> getResponse () ;
echo $response -> getBody () ;
Copy import requests
url = "https://api.desk360.com/v1/login"
payload = "{\n \"email\": \"abc@example.com\",\n \"password\": \"YOUR_PASSWORD\"\n}"
headers = {
'Content-Type' : 'application/json'
}
response = requests . request ( "POST" , url, headers = headers, data = payload)
print (response.text)
Option 2: Create a token from Panel
Login to your Desk360 Panel .
Create a token for a user.
The following endpoints are supported with attachments:
Please follow the guidelines listed below:
Only files on a local machine can be added using the API. You can not use links!
Content-Type should always be multi-part/form-data for attached requests.
I received an error. How can I solve it?
API requests that cause errors will return an appropriate HTTP status code to help determine the type of error. You can use the following table to understand what each code means:
Sample error response
In addition to the HTTP status code, most errors also return a response with more information to help you troubleshoot the error. An example error response is shown below. The format of the error response is explained after the example.
Copy "error": {
"code": "failed_validation",
"message": "The status field is required."
"doc_url": "https://docs.desk360.com/api"
}
}
Error Response Fields
Error Codes
API responses that return a list of objects are paginated, for example, View Ticket List . Add the parameter page to the query string to navigate through the pages. The page number starts from 1 and each page is fixed to show 20 objects.
Copy https://api.desk360.com/api/v1/products/1/tickets?page=1
The "Link" header in the response will be showing the next page if it exists:
Copy Headers
"Link" : <https://api.desk360.com/v1/products/1/tickets?page=2>; rel=next
If you are on the last page the link header will not be filled.
Whenever it is possible, please queue API calls on your side. This allows you to buffer recent calls to avoid reaching the rate limit. Once you reach the rate limit, retry API calls after the retry period.
Whenever it is feasible, cache the data that does not change much on your side. For example, the mapping between agent name and ID is extremely unlikely to change, so it is a useful approach to cache this data to avoid the rate limit.
Avoid making API calls directly from a mobile app, instead, send the request to your servers and make API calls from there. This ensures that if an API endpoint is changed, you can make and deploy the change on your server instead of updating your application and forcing your customers to the latest version.
Apart from its competitors, Desk360 enables its customers to manage multiple products under one account. Therefore, for the ticket transactions, you must first determine the product under which you will perform these transactions. For exampleproducts/1/tickets
shows tickets for the product with the Product ID 1.
In order to find your Product ID , visit Products .
Products
GET
https://api.desk360.com/v1/products
List of your products.
200
Copy [
{
"id": 11,
"name": "YourApplication1",
"logo": null
},
{
"id": 22,
"name": "YourApplication2",
"logo": null
},
{
"id": 33,
"name": "YourApplicationWithLogo",
"logo": "https://desk-360.s3.amazonaws.com/images/application/logo/a007a5a216b668bfef9bcdbb3a31157b.jpg"
}
]
Code Samples
cURL C# Java JavaScript PHP Python
Copy curl --location --request GET 'https://api.desk360.com/v1/products' \
--header 'Authorization: Bearer YOUR_API_TOKEN'
Copy var client = new RestClient ( "https://api.desk360.com/v1/products" );
client . Timeout = - 1 ;
var request = new RestRequest ( Method . GET );
request . AddHeader ( "Authorization" , "Bearer YOUR_API_TOKEN" );
IRestResponse response = client . Execute (request);
Console . WriteLine ( response . Content );
Copy OkHttpClient client = new OkHttpClient() . newBuilder ()
. build ();
Request request = new Request . Builder ()
. url ( "https://api.desk360.com/v1/products" )
. method ( "GET" , null )
. addHeader ( "Authorization" , "Bearer YOUR_API_TOKEN" )
. build ();
Response response = client . newCall (request) . execute ();
Copy var axios = require ( 'axios' );
var config = {
method : 'get' ,
url : 'https://api.desk360.com/v1/products' ,
headers : {
'Authorization' : 'Bearer YOUR_API_TOKEN'
}
};
axios (config)
.then ( function (response) {
console .log ( JSON .stringify ( response .data));
})
.catch ( function (error) {
console .log (error);
});
Copy <? php
$curl = curl_init () ;
curl_setopt_array ( $curl , array(
CURLOPT_URL => 'https://api.desk360.com/v1/products' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_ENCODING => '' ,
CURLOPT_MAXREDIRS => 10 ,
CURLOPT_TIMEOUT => 0 ,
CURLOPT_FOLLOWLOCATION => true ,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1 ,
CURLOPT_CUSTOMREQUEST => 'GET' ,
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer YOUR_API_TOKEN'
) ,
) ) ;
$response = curl_exec ( $curl ) ;
curl_close ( $curl ) ;
echo $response;
Copy import requests
url = "https://api.desk360.com/v1/products"
payload = {}
headers = {
'Authorization' : 'Bearer YOUR_API_TOKEN'
}
response = requests . request ( "GET" , url, headers = headers, data = payload)
print (response.text)
Get Ticket List
GET
https://api.desk360.com/v1/products/:productId/tickets
Ticket list of a product. You can use this endpoint for getting the latest tickets , or with query params, you can filter/search within tickets . Query parameters can be used for filtering and searching purposes , all of the query parameters are optional.
Path Parameters
Query Parameters
200
Copy [
{
"id": 1,
"reason_id": 2,
"type_id": 3,
"agent_id": 4,
"name": "John Doe",
"email": "mail@mail.com",
"subject": null,
"last_message": "Hello World!",
"channel": "Application",
"platform": "Android",
"status": 1,
"priority": 1,
"created_at": "2020-04-02 11:19:26",
"updated_at": "2021-01-17 15:58:41"
},
{
"id": 2,
"reason_id": 2,
"type_id": 3,
"agent_id": 4,
"name": "John Doe",
"email": "mail@mail.com",
"subject": null,
"last_message": "Hello World2!",
"channel": "Application",
"platform": "iOS",
"status": 1,
"priority": 1,
"created_at": "2020-04-02 11:19:26",
"updated_at": "2021-01-17 15:58:41"
},
]
Code Samples
cURL C# Java JavaScript PHP Python
Copy curl --location --request GET 'https://api.desk360.com/v1/products/1/tickets?page=1' \
--header 'Authorization: Bearer YOUR_API_TOKEN'
Copy var client = new RestClient ( "https://api.desk360.com/v1/products/1/tickets" );
client . Timeout = - 1 ;
var request = new RestRequest ( Method . GET );
request . AddHeader ( "Authorization" , "Bearer YOUR_API_TOKEN" );
IRestResponse response = client . Execute (request);
Console . WriteLine ( response . Content );
Copy OkHttpClient client = new OkHttpClient() . newBuilder ()
. build ();
Request request = new Request . Builder ()
. url ( "https://api.desk360.com/v1/products/1/tickets" )
. method ( "GET" , null )
. addHeader ( "Authorization" , "Bearer YOUR_API_TOKEN" )
. build ();
Response response = client . newCall (request) . execute ();
Copy var axios = require ( 'axios' );
var config = {
method : 'get' ,
url : 'https://api.desk360.com/v1/products/1/tickets' ,
headers : {
'Authorization' : 'Bearer YOUR_API_TOKEN'
}
};
axios (config)
.then ( function (response) {
console .log ( JSON .stringify ( response .data));
})
.catch ( function (error) {
console .log (error);
});
Copy <? php
$curl = curl_init () ;
curl_setopt_array ( $curl , array(
CURLOPT_URL => 'https://api.desk360.com/v1/products/1/tickets' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_ENCODING => '' ,
CURLOPT_MAXREDIRS => 10 ,
CURLOPT_TIMEOUT => 0 ,
CURLOPT_FOLLOWLOCATION => true ,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1 ,
CURLOPT_CUSTOMREQUEST => 'GET' ,
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer YOUR_API_TOKEN'
) ,
) ) ;
$response = curl_exec ( $curl ) ;
curl_close ( $curl ) ;
echo $response;
Copy import requests
url = "https://api.desk360.com/v1/products/1/tickets"
payload = {}
headers = {
'Authorization' : 'Bearer YOUR_API_TOKEN'
}
response = requests . request ( "GET" , url, headers = headers, data = payload)
print (response.text)
Descriptive Tables
Priority Platform Status Message Types
Get Ticket Details
GET
https://api.desk360.com/v1/products/:productId/tickets/:ticketId
Get the details of the ticket. It includes multiple objects such as ticket information , ticket messages.
Path Parameters
200
Copy {
"id": 1,
"reason_id": 5,
"type_id": 9,
"agent_id": 72,
"name": "John Doe",
"email": "mail@mail.com",
"subject": null,
"channel": "Application",
"platform": "Android",
"status": 1,
"priority": 1,
"settings": null,
"country_code": "TR",
"star_rating": null,
"custom_fields": [],
"created_at": "2020-04-02 11:19:26",
"updated_at": "2021-01-17 15:58:41",
"messages": [
{
"id": 1,
"agent_id": 74,
"message": "Hello World",
"attachments": {
"images": [],
"videos": [],
"files": [],
"others": []
},
"type": 0,
"created_at": "2020-04-02 11:19:26",
"updated_at": "2020-04-02 11:19:26"
},
{
"id": 2,
"agent_id": 74,
"message": "Hello World2",
"attachments": {
"images": [],
"videos": [],
"files": [],
"others": []
},
"type": 0,
"created_at": "2020-04-02 11:19:46",
"updated_at": "2020-04-02 11:19:46"
}]
}
Code Samples
cURL C# Java JavaScript PHP Python
Copy curl --location --request GET 'https://api.desk360.com/v1/products/1/tickets/1' \
--header 'Authorization: Bearer YOUR_API_TOKEN'
Copy var client = new RestClient ( "https://api.desk360.com/v1/products/1/tickets/1" );
client . Timeout = - 1 ;
var request = new RestRequest ( Method . GET );
request . AddHeader ( "Authorization" , "Bearer YOUR_API_TOKEN" );
IRestResponse response = client . Execute (request);
Console . WriteLine ( response . Content );
Copy OkHttpClient client = new OkHttpClient() . newBuilder ()
. build ();
Request request = new Request . Builder ()
. url ( "https://api.desk360.com/v1/products/1/tickets/1" )
. method ( "GET" , null )
. addHeader ( "Authorization" , "Bearer YOUR_API_TOKEN" )
. build ();
Response response = client . newCall (request) . execute ();
Copy var axios = require ( 'axios' );
var config = {
method : 'get' ,
url : 'https://api.desk360.com/v1/products/1/tickets/1' ,
headers : {
'Authorization' : 'Bearer YOUR_API_TOKEN'
}
};
axios (config)
.then ( function (response) {
console .log ( JSON .stringify ( response .data));
})
.catch ( function (error) {
console .log (error);
});
Copy <? php
$curl = curl_init () ;
curl_setopt_array ( $curl , array(
CURLOPT_URL => 'https://api.desk360.com/v1/products/1/tickets/1' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_ENCODING => '' ,
CURLOPT_MAXREDIRS => 10 ,
CURLOPT_TIMEOUT => 0 ,
CURLOPT_FOLLOWLOCATION => true ,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1 ,
CURLOPT_CUSTOMREQUEST => 'GET' ,
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer YOUR_API_TOKEN'
) ,
) ) ;
$response = curl_exec ( $curl ) ;
curl_close ( $curl ) ;
echo $response;
Copy import requests
url = "https://api.desk360.com/v1/products/1/tickets/1"
payload = {}
headers = {
'Authorization' : 'Bearer YOUR_API_TOKEN'
}
response = requests . request ( "GET" , url, headers = headers, data = payload)
print (response.text)
Get Ticket Logs
GET
https://api.desk360.com/v1/products/:productId/tickets/:ticketId/logs
Result of the detailed ticket logs. Check Descriptive Tables to see the status options.
Path Parameters
200
Copy [
{
"id": 1,
"old_status_id": 0,
"new_status_id": 2,
"reason_id": 5,
"agent_id": 1,
"created_at": "2020-04-02 12:15:00"
},
{
"id": 2,
"old_status_id": 2,
"new_status_id": 1,
"reason_id": 5,
"agent_id": 2,
"created_at": "2020-04-02 12:16:08"
},
]
Code Samples
cURL C# Java JavaScript PHP Python
Copy curl --location --request GET 'api.localhost:10380/v1/products/1/tickets/1/logs' \
--header 'Authorization: Bearer YOUR_API_TOKEN'
Copy var client = new RestClient ( "https://api.desk360.com/v1/products/1/tickets/1/logs" );
client . Timeout = - 1 ;
var request = new RestRequest ( Method . GET );
request . AddHeader ( "Authorization" , "Bearer YOUR_API_TOKEN" );
IRestResponse response = client . Execute (request);
Console . WriteLine ( response . Content );
Copy OkHttpClient client = new OkHttpClient() . newBuilder ()
. build ();
Request request = new Request . Builder ()
. url ( "https://api.desk360.com/v1/products/1/tickets/1/logs" )
. method ( "GET" , null )
. addHeader ( "Authorization" , "Bearer YOUR_API_TOKEN" )
. build ();
Response response = client . newCall (request) . execute ();
Copy var axios = require ( 'axios' );
var config = {
method : 'get' ,
url : 'https://api.desk360.com/v1/products/1/tickets/1/logs' ,
headers : {
'Authorization' : 'Bearer YOUR_API_TOKEN'
}
};
axios (config)
.then ( function (response) {
console .log ( JSON .stringify ( response .data));
})
.catch ( function (error) {
console .log (error);
});
Copy <? php
$curl = curl_init () ;
curl_setopt_array ( $curl , array(
CURLOPT_URL => 'https://api.desk360.com/v1/products/1/tickets/1/logs' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_ENCODING => '' ,
CURLOPT_MAXREDIRS => 10 ,
CURLOPT_TIMEOUT => 0 ,
CURLOPT_FOLLOWLOCATION => true ,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1 ,
CURLOPT_CUSTOMREQUEST => 'GET' ,
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer YOUR_API_TOKEN'
) ,
) ) ;
$response = curl_exec ( $curl ) ;
curl_close ( $curl ) ;
echo $response;
Copy import requests
url = "https://api.desk360.com/v1/products/1/tickets/1/logs"
payload = {}
headers = {
'Authorization' : 'Bearer YOUR_API_TOKEN'
}
response = requests . request ( "GET" , url, headers = headers, data = payload)
print (response.text)
Create Ticket
POST
https://api.desk360.com/v1/products/:productId/tickets
Create an API ticket. If you send with attachments use form-data you can also send other body parameters with form-data as well.
Path Parameters
Request Body
201
Copy {
"id": 123,
"reason_id": 1,
"type_id": null,
"agent_id": null,
"name": "abc",
"email": "abc@def.com",
"subject": null,
"last_message": "abc",
"channel": "Api",
"platform": "Api",
"status": 1,
"priority": 0,
"created_at": "2021-01-18 10:31:57",
"updated_at": "2021-01-18 10:31:57"
}
Code Samples
cURL C# Java JavaScript PHP Python
Copy curl --location --request POST 'https://api.desk360.com/v1/products/1/tickets' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "John Doe",
"email": "mail@mail.com",
"reason_id": 1,
"description": "Hello World!",
"status": 1,
"assign_to_agent_id": 2
}'
Copy var client = new RestClient ( "https://api.desk360.com/v1/products/1/tickets" );
client . Timeout = - 1 ;
var request = new RestRequest ( Method . POST );
request . AddHeader ( "Authorization" , "Bearer YOUR_API_TOKEN" );
request . AddHeader ( "Content-Type" , "application/json" );
request.AddParameter("application/json", "{\n \"name\": \"John Doe\",\n \"email\": \"mail@mail.com\",\n \"reason_id\": 1,\n \"description\": \"Hello World!\",\n \"status\": 1,\n \"assign_to_agent_id\": 2\n}", ParameterType.RequestBody);
IRestResponse response = client . Execute (request);
Console . WriteLine ( response . Content );
Copy OkHttpClient client = new OkHttpClient() . newBuilder ()
. build ();
MediaType mediaType = MediaType . parse ( "application/json" );
RequestBody body = RequestBody.create(mediaType, "{\n \"name\": \"John Doe\",\n \"email\": \"mail@mail.com\",\n \"reason_id\": 1,\n \"description\": \"Hello World!\",\n \"status\": 1,\n \"assign_to_agent_id\": 2\n}");
Request request = new Request . Builder ()
. url ( "https://api.desk360.com/v1/products/1/tickets" )
. method ( "POST" , body)
. addHeader ( "Authorization" , "Bearer YOUR_API_TOKEN" )
. addHeader ( "Content-Type" , "application/json" )
. build ();
Response response = client . newCall (request) . execute ();
Copy var axios = require ( 'axios' );
var data = JSON.stringify({"name":"John Doe","email":"mail@mail.com","reason_id":1,"description":"Hello World!","status":1,"assign_to_agent_id":2});
var config = {
method : 'post' ,
url : 'https://api.desk360.com/v1/products/1/tickets' ,
headers : {
'Authorization' : 'Bearer YOUR_API_TOKEN' ,
'Content-Type' : 'application/json'
} ,
data : data
};
axios (config)
.then ( function (response) {
console .log ( JSON .stringify ( response .data));
})
.catch ( function (error) {
console .log (error);
});
Copy <? php
$curl = curl_init () ;
curl_setopt_array ( $curl , array(
CURLOPT_URL => 'https://api.desk360.com/v1/products/1/tickets' ,
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_ENCODING => '' ,
CURLOPT_MAXREDIRS => 10 ,
CURLOPT_TIMEOUT => 0 ,
CURLOPT_FOLLOWLOCATION => true ,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1 ,
CURLOPT_CUSTOMREQUEST => 'POST' ,
CURLOPT_POSTFIELDS => '{
"name": "John Doe",
"email": "mail@mail.com",
"reason_id": 1,
"description": "Hello World!",
"status": 1,
"assign_to_agent_id": 2
}' ,
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer YOUR_API_TOKEN' ,
'Content-Type: application/json'
) ,
) ) ;
$response = curl_exec ( $curl ) ;
curl_close ( $curl ) ;
echo $response;
Copy import requests
url = "https://api.desk360.com/v1/products/1/tickets"
payload="{\n \"name\": \"John Doe\",\n \"email\": \"mail@mail.com\",\n \"reason_id\": 1,\n \"description\": \"Hello World!\",\n \"status\": 1,\n \"assign_to_agent_id\": 2\n}"
headers = {
'Authorization' : 'Bearer YOUR_API_TOKEN' ,
'Content-Type' : 'application/json'
}
response = requests . request ( "POST" , url, headers = headers, data = payload)
print (response.text)
Reply Ticket
POST
https://api.desk360.com/v1/products/:productId/tickets/:ticketId/reply
Replying to the ticket.
Path Parameters
Request Body
201
Copy {
"id": 747,
"agent_id": 74,
"message": "Hello World!",
"type": 0,
"attachments": {
"images": [],
"videos": [],
"files": [],
"others": []
},
"created_at": "2021-01-18 10:41:26",
"updated_at": "2021-01-18 10:41:26"
}
Code Samples
cURL C# Java JavaScript PHP Python
Copy curl --location --request POST 'https://api.desk360.com/v1/products/1/tickets/1/reply' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"message": "Hello World"
}'
Copy var client = new RestClient("https://api.desk360.com/v1/products/1/tickets/1/reply");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer YOUR_API_TOKEN");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"message\": \"Hello World!\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Copy OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"message\": \"Hello World!\"\n}");
Request request = new Request.Builder()
.url("https://api.desk360.com/v1/products/1/tickets/1/reply")
.method("POST", body)
.addHeader("Authorization", "Bearer YOUR_API_TOKEN")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
Copy var axios = require('axios');
var data = JSON.stringify({"message":"Hello World!"});
var config = {
method: 'post',
url: 'https://api.desk360.com/v1/products/1/tickets/1/reply',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
Copy <?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.desk360.com/v1/products/1/tickets/1/reply',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"message": "Hello World!"
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer YOUR_API_TOKEN',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Copy import requests
url = "https://api.desk360.com/v1/products/1/tickets/1/reply"
payload="{\n \"message\": \"Hello World!\"\n}"
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Add Ticket Note
POST
https://api.desk360.com/v1/products/:productId/tickets/:ticketId/reply
Add a note to the ticket. The difference between replying is that notes are only visible to the agents.
Path Parameters
Request Body
201
Copy {
"id": 747,
"agent_id": 74,
"message": "Hello World!",
"type": 6,
"attachments": {
"images": [],
"videos": [],
"files": [],
"others": []
},
"created_at": "2021-01-18 10:41:26",
"updated_at": "2021-01-18 10:41:26"
}
Code Samples
cURL C# Java JavaScript PHP Python
Copy curl --location --request POST 'https://api.desk360.com/v1/products/1/tickets/1/note' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"message": "Hello World"
}'
Copy var client = new RestClient("https://api.desk360.com/v1/products/1/tickets/1/reply");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer YOUR_API_TOKEN");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"message\": \"Hello World!\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Copy OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"message\": \"Hello World!\"\n}");
Request request = new Request.Builder()
.url("https://api.desk360.com/v1/products/1/tickets/1/reply")
.method("POST", body)
.addHeader("Authorization", "Bearer YOUR_API_TOKEN")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
Copy var axios = require('axios');
var data = JSON.stringify({"message":"Hello World!"});