Desk360 Docs
  • Introduction to Desk360
  • ๐Ÿš€Quick Start Guide
  • Start
    • Sign Up
    • Verify Your Email
    • Add Product/Brand
    • Channel Integration
    • Add User
    • Invite Your Team
  • User Communication Channels
    • In-App Message Box Channel
    • Web Contact Us Channel
    • Email Channel
    • Apple App Store Channel
    • Google Play Store Channel
    • Huawei AppGallery Channel
    • WhatsApp Channel
    • Live Chat Channel
    • Instagram Channel
    • Facebook Channel
    • Twitter Channel
  • Desk360 Platform Navigation
    • Dashboard
    • Tickets
      • Creating Internal Tickets
      • Listing and Filtering
      • Multiple Operations
      • Actions
      • Ticket Details
      • Ticket Status
      • Ticket Types
      • Ticket Reasons
      • Ready Answers
      • Ticket History Log
      • Callback Function
      • Automatic Replies
        • Automatic Replies During Working Hours
      • Automatic Assignments
      • Assignment by Request Type
      • Prioritization Rules
        • Setting Priorities
        • Creating Folders
      • SLA Management
      • Business Hours
      • Tag Management
    • Chat
      • Chat Settings
      • Automatic Assignments
      • Manual Assignments
      • Human Agent Functionality
      • Custom Chatbots
      • Chat History Forwarding
      • Bulk Actions
    • Reports
      • Ticket Reports
        • Ticket Analysis Reports
        • User Performance
      • Chat Reports
        • Chat Reports
        • User Reports
        • Chat Cockpit
      • SLA Reports
    • Product and Communication Channel Integrations
      • In-App Message Box Channel Integration
        • In-App Message Box Integration Settings
        • Customizable In-App Message Box
        • In-App Message Box Notifications
      • Web Contact Us Channel Integration
        • Web Contact Us Form
        • FAQ and Contact Us Page Settings
          • General Settings
          • FAQ Settings
          • Contact Us Page Settings
      • Email Channel Integration
        • Gmail SMTP Integration
        • Yandex SMTP Integration
        • Outlook SMTP Integration
        • E-mail features
      • Apple App Store Channel Integration
      • Google Play Store Channel Integration
      • Huawei AppGallery Channel Integration
      • WhatsApp Channel Integration
        • WABA Prerequisites
        • New WhatsApp Business API Pricing
        • WhatsApp Integration Steps
        • WhatsApp Auto-Reply Function
        • WhatsApp Custom Bots
        • WhatsApp Message Templates
        • How to use WhatsApp Message Templates
        • WhatsApp Message Template Statistics
        • WhatsApp Web Widget
      • Live Chat Channel Integration
      • Facebook Channel Integration
      • Instagram Channel Integration
      • Twitter Channel Integration
    • Chatbot Integration
    • Settings
      • Import Data
      • Language Settings
      • Professional Support In 40 Languages
    • Users
      • User Groups
      • User Roles
      • User Settings
  • INTEGRATIONS
    • JIRA
    • Slack
    • Trello
    • Alotech
  • Desk360 Mobile SDK
    • iOS SDK
    • Android SDK
    • Flutter SDK
    • React Native SDK
  • DESK360 MOBILE CHAT SDK
    • Mobile Chat iOS SDK
    • Mobile Chat Android SDK
  • DESK360 API (1.0.0)
    • API Documentation
Powered by GitBook
On this page
  • Introduction
  • HTTP Methods
  • Rate Limit
  • Getting Started
  • Authentication
  • Login
  • Attachments
  • Errors
  • Pagination
  • Best Practices
  • Products & Tickets
  • Products
  • Get Ticket List
  • Get Ticket Details
  • Get Ticket Logs
  • Create Ticket
  • Reply Ticket
  • Add Ticket Note
  • Update Ticket Status
  • Agents
  • Get Agent List
  • Get Current Agent
  • Types
  • Get Type List
  • Create Type
  • Get Type
  • Update Type
  • Reasons
  • Get Reasons List
  • Create Reason
  • Get Reason
  • Update Reason
  • WhatsApp Message Templates
  • Get WhatsApp Message Template
  • Send WhatsApp Message Template
  • Bulk Send WhatsApp Message Template
  • WhatsApp Messages
  • Send WhatsApp Message
  • Send WhatsApp Location Message
  • Send WhatsApp Contact Message
  • Send WhatsApp Media Message
  • Get WhatsApp Media
  • Send WhatsApp Interactive Message
  • Send WhatsApp Location Request Interactive Message
  • Read WhatsApp Message
  • WhatsApp Webhooks
  • Received Messages Examples
  • Status Updates

Was this helpful?

  1. DESK360 API (1.0.0)

API Documentation

PreviousMobile Chat Android SDK

Last updated 1 year ago

Was this helpful?

Introduction

โ€‹Desk360 API is a Representational State Transfer () โ€‹โ€‹structure that provides operations such as: Reading Modifying Adding data Deleting data from your help desk.

Desk360 APIs also support Cross-Origin Resource Sharing ().

HTTP Methods

The list of API commands used by Desk360

Command

Description

GET

Fetches object(s)

POST

Creates an object

PUT

Updates/Modifies an object

All API requests must reach the secure endpoint i.e. HTTPS only

Rate Limit

This rate limit applies are based on IP address.

The limits will be company based rather than IP based in the future.

Plan

Rate Limit/Minute

Basic

10

Business

100

Enterprise

  • 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:

HTTP/1.1 200 OK
Content-Type: application/json
X-RateLimit-Limit: 180
X-RateLimit-Remaining: 178

Title

Description

X-RateLimit-Limit

Total number of API calls allowed per minute.

X-RateLimit-Remaining

The number of requests remaining in the current rate limit window.

X-RateLimit-Reset

The reset time in Unix epoch time format.

Retry-After

The number of seconds you should wait in order to trigger your next API request.

This header is returned only when the rate limit is reached.

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.

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

Name
Type
Description

email

string

An email that is already registered

password

string

The user's password

{
    "access_token": "WEFjiPUQo6FSV55RXx0T5uc5GKdmHxohsawEajAKyV1ZdUloZAExAhAAtPH1hMNbYUMsT2r7UpdN4gym",
    "token_type": "Bearer"
}
curl --location --request POST 'https://api.desk360.com/v1/login' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "abc@example.com",
    "password": "YOUR_PASSWORD"
}'
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);
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();
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);
});
<?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();
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

  1. Login to your Desk360 Panel.

  2. Go to Settings.

  3. Click API.

  4. 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:

HTTP Status Code

Status Code Definition

Description

400

Client or Validation Error

The request body/query string is not in the correct format.

For example, the Create a ticket API requires the email field to be submitted as part of the request, and if it is missing, this status code is returned.

401

Authentication Failure

This indicates that the Authorization field is either missing or incorrect.

404

Requested Resource not Found

The request contains an invalid ID / Desk360 domain or invalid parameters in the URL. For example, an API call to retrieve a ticket with an invalid ID will return an HTTP 404 status code to inform you that no such ticket exists.

405

Method not allowed

This API request has used the wrong HTTP method.

For example, a DELETE requested on /products endpoint will return an HTTP 405 as /products allows only GET requests.

406

Unsupported Accept Header

Only application/json and */* are supported. When uploading files multipart/form-data are supported.

415

Unsupported Content-type

Only application/json is supported.

429

Rate Limit Exceeded

500

Unexpected Server Error

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.

    "error": {
        "code": "failed_validation",
        "message": "The status field is required."
        "doc_url": "https://docs.desk360.com/api"
    }
}

Error Response Fields

Field

Description

code

Custom error code that is machine-parseable.

message

Descriptive error message.

doc_url

A link to guide you if there is a solution on the documentation.

Error Codes

Code

Description

authentication_exception

Authentication failed. The token is missing or invalid. Do not forget to put "Bearer" in the beginning of your token. eg: "Bearer YOUR-API-TOKEN"

method_not_allowed_exception

not_found_exception

You may have made a typo in your request URL.

model_not_found_exception

Requested resource not found, the resource maybe deleted or maybe the resource is not yours.

internal_server_error

insecure_request_exception

HTTP is not allowed. Use HTTPS instead.

too_many_requests_exception

invalid_credentials

You typed your email/password wrong.

password_access_disabled

too_many_attempts

If you entered your email/password wrong more than 5 times, you should wait for a minute.

not_authorized

You do not have permission to modify the resource.

not_found

Requested resource not found, the resource maybe deleted or maybe the resource is not yours.

status_update_failed

Status update failed. You can only set Resolved (1) or Waiting (2), also, if the ticket is resolved you can not change the reason.

facebook_integration_error

instagram_integration_error

twitter_integration_error

Check your integration is still active from your Desk360 Panel. If it is active and you getting the error, the issue might be coming from Facebook/Twitter servers.

email_error

There is an error while sending the email. The email might be invalid.

non_custom_type

You can not update/delete non-custom types.

failed_validation

This is a validation error, please read the message and apply what it says.

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.

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:

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.

Products

GET https://api.desk360.com/v1/products

List of your products.

Headers

Name
Type
Description

Authorization

string

Your API token

[
    {
        "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 --location --request GET 'https://api.desk360.com/v1/products' \
--header 'Authorization: Bearer YOUR_API_TOKEN'
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);
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();
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);
});
<?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;
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

Name
Type
Description

productId

integer

The id of your product

Query Parameters

Name
Type
Description

page

integer

Page number if not given will start from 1

reason_id

integer

Filter by the reason id

priority

integer

Filter by the priority (see table below)

platform

string

Filter by the platform (see table below)

start_date

string

Filter by starting date as YYYY-MM-DD format (eg: 2020-05-19)

end_date

string

Filter by ending date as YYYY-MM-DD format (eg: 2020-05-20)

status

integer

Filter by the status of the ticket (see the table below)

agent_id

integer

Filter by the id of the assigned agent

type_id

integer

Filter by the ticket type id

order

string

Sort by updated date order (default descending) to make ascending send query as "asc".

id

integer

Search by Id of the ticket

email

string

Search by Email for the ticket

name

string

Search by Name of the ticket

subject

string

Search by Subject of the ticket

Headers

Name
Type
Description

Authorization

string

Your API token

[
    {
        "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 --location --request GET 'https://api.desk360.com/v1/products/1/tickets?page=1' \
--header 'Authorization: Bearer YOUR_API_TOKEN'
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);
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();
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);
});
<?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;
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

Value

Low

0

Medium

1

High

2

Urgent

3

Platform

Value

Desk360 SDK iOS contact us tickets

iOS

AppStore review tickets

AppStore

GooglePlay review tickets

GooglePlay

Web contact us tickets

Web

Desk360 SDK Android tickets

Android

Email tickets

Mail

Facebook tickets

Facebook

Twitter mention tickets

Mention

Internal created tickets

Internal

Twitter direct message tickets

DirectMessage

Twitter retweet comment tickets

RetweetComment

Twitter tweet tickets

Tweet

Facebook messenger tickets

Messenger

Status

Value

Unresolved

0

Resolved

1

Waiting

2

Reopen

3

Type

Value

Text Message

0

GIF

1

Image

2

Video

3

External Message

4

Twitter Message

5

Note

6

Auto Reply

7

Slack

8

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

Name
Type
Description

productId

string

The id of your product

ticketId

integer

The id of the ticket

Headers

Name
Type
Description

Authorization

string

Your API token

{
    "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 --location --request GET 'https://api.desk360.com/v1/products/1/tickets/1' \
--header 'Authorization: Bearer YOUR_API_TOKEN'
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);
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();
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);
});
<?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;
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

Name
Type
Description

productId

string

The id of your product

ticketId

integer

The id of the ticket

Headers

Name
Type
Description

Authorization

string

Your API token

[
    {
        "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 --location --request GET 'api.localhost:10380/v1/products/1/tickets/1/logs' \
--header 'Authorization: Bearer YOUR_API_TOKEN'
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);
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();
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);
});
<?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;
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

Name
Type
Description

productId

string

The id of your product

Headers

Name
Type
Description

Authorization

string

Your API token

Request Body

Name
Type
Description

attachments[]

object

Attachment for the ticket (Only allowed in form-data)

name

string

Name of the customer

email

string

Email of the customer

reason_id

integer

Reason Id

description

string

Brief description of the ticket subject

status

integer

Status of the ticket (check Descriptive Tables)

assign_to_agent_id

integer

Id of the assigned agent (optional)

settings

json

JSON string format

{
    "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 --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
}'
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);
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();
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);
});
<?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;
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

Name
Type
Description

productId

string

The id of your product

ticketId

string

The id of the ticket

Headers

Name
Type
Description

Authorization

string

Your API token

Request Body

Name
Type
Description

attachments[]

object

Attachment for the ticket (Only allowed in form-data)

message

string

Message content

{
    "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 --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"
}'
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);
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();
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);
});
<?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;
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

Name
Type
Description

productId

string

The id of your product

ticketId

string

The id of the ticket

Headers

Name
Type
Description

Authorization

string

Your API token

Request Body

Name
Type
Description

attachments[]

object

Attachment for the ticket (Only allowed in form-data)

message

string

Message content

{
    "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 --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"
}'
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);
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();
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);
});
<?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;
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)

Update Ticket Status

POST https://api.desk360.com/v1/products/:productId/tickets/:ticketId/reply

Update the status of the ticket such as Resolved/Waiting.

Path Parameters

Name
Type
Description

productId

string

The id of your product

ticketId

string

The id of the ticket

Headers

Name
Type
Description

Authorization

string

Your API token

Request Body

Name
Type
Description

status

integer

Status can be 1 (Resolved) or 2 (Waiting)

reason_id

integer

The id of reason.

{
    "id": 1,
    "reason_id": 5,
    "type_id": 9,
    "agent_id": 72,
    "name": "John Doe",
    "email": "mail@mail.com",
    "subject": null,
    "last_message": null,
    "channel": "Application",
    "platform": "Android",
    "status": 1,
    "priority": 1,
    "created_at": "2020-04-02 11:19:26",
    "updated_at": "2021-01-18 10:37:53"
}

Code Samples

curl --location --request POST 'https://api.desk360.com/v1/products/1/tickets/1/status' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
    "status": 1,
    "reason_id": 5
}'
var client = new RestClient("https://api.desk360.com/v1/products/1/tickets/1/status");
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    \"status\": 1,\n    \"reason_id\": 5\n}",  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n    \"status\": 1,\n    \"reason_id\": 5\n}");
Request request = new Request.Builder()
  .url("https://api.desk360.com/v1/products/1/tickets/1/status")
  .method("POST", body)
  .addHeader("Authorization", "Bearer YOUR_API_TOKEN")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();
var axios = require('axios');
var data = JSON.stringify({"status":1,"reason_id":5});

var config = {
  method: 'post',
  url: 'https://api.desk360.com/v1/products/1/tickets/1/status',
  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);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.desk360.com/v1/products/1/tickets/1/status',
  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 =>'{
    "status": 1,
    "reason_id": 5
}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer YOUR_API_TOKEN',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://api.desk360.com/v1/products/1/tickets/1/status"

payload="{\n    \"status\": 1,\n    \"reason_id\": 5\n}"
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Agents are the people on your core support team who will log into your helpdesk.

From any response, if you get "agent_id": 0 it means Unassigned or From a Customer

Get Agent List

GET https://api.desk360.com/v1/agents

Get agent list.

Headers

Name
Type
Description

Authorization

string

Your API token

[
    {
        "id": 11,
        "name": "John Doe",
        "email": "john@mail.com",
        "avatar": null
    },
    {
        "id": 22,
        "name": "Richard Miller",
        "email": "richard@mail.com",
        "avatar": null
    },
    {
        "id": 33,
        "name": "Jane Doe",
        "email": "jane@mail.com",
        "avatar": "https://desk-360.s3.amazonaws.com/images/profile/7909604058aacab0d1e1fd719b933409.jpg"
    }
]

Code Samples

curl --location --request GET 'https://api.desk360.com/v1/agents' \
--header 'Authorization: Bearer YOUR_API_TOKEN'
var client = new RestClient("https://api.desk360.com/v1/agents");
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);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
Request request = new Request.Builder()
  .url("https://api.desk360.com/v1/agents")
  .method("GET", null)
  .addHeader("Authorization", "Bearer YOUR_API_TOKEN")
  .build();
Response response = client.newCall(request).execute();
var axios = require('axios');

var config = {
  method: 'get',
  url: 'https://api.desk360.com/v1/agents',
  headers: { 
    'Authorization': 'Bearer YOUR_API_TOKEN'
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.desk360.com/v1/agents',
  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;
import requests

url = "https://api.desk360.com/v1/agents"

payload={}
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

Get Current Agent

GET https://api.desk360.com/v1/me

Get current agent.

Headers

Name
Type
Description

Authorization

string

Your API token

{
    "id": 11,
    "name": "John Doe",
    "email": "john@mail.com",
    "avatar": "https://desk-360.s3.amazonaws.com/images/profile/7909604058aacab0d1e1fd719b933409.jpg"
}

Code Samples

curl --location --request GET 'https://api.desk360.com/v1/agents/me' \
--header 'Authorization: Bearer YOUR_API_TOKEN'
var client = new RestClient("https://api.desk360.com/v1/me");
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);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
Request request = new Request.Builder()
  .url("https://api.desk360.com/v1/me")
  .method("GET", null)
  .addHeader("Authorization", "Bearer YOUR_API_TOKEN")
  .build();
Response response = client.newCall(request).execute();
var axios = require('axios');

var config = {
  method: 'get',
  url: 'https://api.desk360.com/v1/me',
  headers: { 
    'Authorization': 'Bearer YOUR_API_TOKEN'
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.desk360.com/v1/me',
  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;
import requests

url = "https://api.desk360.com/v1/me"

payload={}
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

Types refer to ticket types, it allows you to organize and categorize your tickets by your needs.

Get Type List

GET https://api.desk360.com/v1/types

Get all the ticket types.

Headers

Name
Type
Description

Authorization

string

Your API token

[
    {
        "id": 1,
        "product_id": 0,
        "title": "Subscription",
        "description": "Subscription",
        "is_active": true,
        "is_custom": false,
        "created_at": "2019-07-11 12:43:24",
        "updated_at": "2020-11-02 07:30:05"
    },
    {
        "id": 2,
        "product_id": 0,
        "title": "Features",
        "description": "Features",
        "is_active": true,
        "is_custom": false,
        "created_at": "2019-07-11 12:47:29",
        "updated_at": "2019-07-11 12:47:29"
    },
    {
        "id": 3,
        "product_id": 0,
        "title": "Report a problem",
        "description": "Report a problem",
        "is_active": true,
        "is_custom": false,
        "created_at": "2019-07-11 12:50:23",
        "updated_at": "2019-07-11 12:50:23"
    }
]

Code Samples

curl --location --request GET 'https://api.desk360.com/v1/types' \
--header 'Authorization: Bearer YOUR_API_TOKEN'
var client = new RestClient("https://api.desk360.com/v1/types");
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);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
Request request = new Request.Builder()
  .url("https://api.desk360.com/v1/types")
  .method("GET", null)
  .addHeader("Authorization", "Bearer YOUR_API_TOKEN")
  .build();
Response response = client.newCall(request).execute();
var axios = require('axios');

var config = {
  method: 'get',
  url: 'https://api.desk360.com/v1/types',
  headers: { 
    'Authorization': 'Bearer YOUR_API_TOKEN'
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.desk360.com/v1/types',
  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;
import requests

url = "https://api.desk360.com/v1/types"

payload={}
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

Create Type

POST https://api.desk360.com/v1/types

Create a new ticket type.

Headers

Name
Type
Description

Authorization

string

Your API token

Request Body

Name
Type
Description

product_id

integer

Your product id

title

string

Title of the type

description

string

Description of the type

is_active

boolean

The status of the ticket type

{
    "id": 68,
    "product_id": 1,
    "title": "Test",
    "description": "Test",
    "is_active": false,
    "is_custom": true,
    "created_at": "2021-01-05 15:02:07",
    "updated_at": "2021-01-05 15:02:07"
}

Code Samples

curl --location --request POST 'https://api.desk360.com/v1/types' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
    "product_id": 1,
    "title": "Test",
    "description": "Test",
    "is_active": false
}'
var client = new RestClient("https://api.desk360.com/v1/types");
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    \"product_id\": 1,\n    \"title\": \"Test\",\n    \"description\": \"Test\",\n    \"is_active\": false\n}",  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n    \"product_id\": 1,\n    \"title\": \"Test\",\n    \"description\": \"Test\",\n    \"is_active\": false\n}");
Request request = new Request.Builder()
  .url("https://api.desk360.com/v1/types")
  .method("POST", body)
  .addHeader("Authorization", "Bearer YOUR_API_TOKEN")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();
var axios = require('axios');
var data = JSON.stringify({"product_id":1,"title":"Test","description":"Test","is_active":false});

var config = {
  method: 'post',
  url: 'https://api.desk360.com/v1/types',
  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);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.desk360.com/v1/types',
  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 =>'{
    "product_id": 1,
    "title": "Test",
    "description": "Test",
    "is_active": false
}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer YOUR_API_TOKEN',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://api.desk360.com/v1/types"

payload="{\n    \"product_id\": 1,\n    \"title\": \"Test\",\n    \"description\": \"Test\",\n    \"is_active\": false\n}"
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Get Type

GET https://api.desk360.com/v1/types/:typeId

Get the type by id.

Path Parameters

Name
Type
Description

typeId

string

The id of type

Headers

Name
Type
Description

Authorization

string

Your API Token

{
    "id": 11,
    "product_id": 1,
    "title": "Test",
    "description": "Test",
    "is_active": false,
    "is_custom": true,
    "created_at": "2020-08-06 08:51:11",
    "updated_at": "2020-08-06 08:55:07"
}

Code Samples

curl --location --request GET 'https://api.desk360.com/v1/types/11' \
--header 'Authorization: Bearer YOUR_API_TOKEN'
var client = new RestClient("https://api.desk360.com/v1/types/28");
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);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
Request request = new Request.Builder()
  .url("https://api.desk360.com/v1/types/28")
  .method("GET", null)
  .addHeader("Authorization", "Bearer YOUR_API_TOKEN")
  .build();
Response response = client.newCall(request).execute();
var axios = require('axios');

var config = {
  method: 'get',
  url: 'https://api.desk360.com/v1/types/28',
  headers: { 
    'Authorization': 'Bearer YOUR_API_TOKEN'
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.desk360.com/v1/types/28',
  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;
import requests

url = "https://api.desk360.com/v1/types/28"

payload={}
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

Update Type

PUT https://api.desk360.com/v1/types/:typeId

Update the ticket type.

Path Parameters

Name
Type
Description

typeId

string

The id of type

Headers

Name
Type
Description

Authorization

string

Your API token

Request Body

Name
Type
Description

is_active

boolean

The status of the ticket type

{
    "id": 68,
    "product_id": 1,
    "title": "Test",
    "description": "Test",
    "is_active": false,
    "is_custom": true,
    "created_at": "2021-01-05 15:02:07",
    "updated_at": "2021-01-05 16:02:07"
}

Code Samples

curl --location --request PUT 'https://api.desk360.com/v1/types/65' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
    "is_active": false
}'
var client = new RestClient("https://api.desk360.com/v1/types/64");
client.Timeout = -1;
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer YOUR_API_TOKEN");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n    \"is_active\": false\n}",  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n    \"is_active\": false\n}");
Request request = new Request.Builder()
  .url("https://api.desk360.com/v1/types/64")
  .method("PUT", body)
  .addHeader("Authorization", "Bearer YOUR_API_TOKEN")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();
var axios = require('axios');
var data = JSON.stringify({"is_active":false});

var config = {
  method: 'put',
  url: 'https://api.desk360.com/v1/types/64',
  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);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.desk360.com/v1/types/64',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'PUT',
  CURLOPT_POSTFIELDS =>'{
    "is_active": false
}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer YOUR_API_TOKEN',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://api.desk360.com/v1/types/64"

payload="{\n    \"is_active\": false\n}"
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN',
  'Content-Type': 'application/json'
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)

Reasons refer to ticket reasons. It allows you to tag tickets in each state, and when you need it later, the logger will be able to show why the ticket is created/updated/resolved etc.

Get Reasons List

GET https://api.desk360.com/v1/reasons

Get all the ticket reasons.

Headers

Name
Type
Description

Authorization

string

Your API token

[
    {
        "id": 1,
        "product_id": 1,
        "name": "Test1",
        "is_active": false,
        "created_at": "2019-07-09 13:40:00",
        "updated_at": "2020-05-25 14:08:53"
    },
    {
        "id": 2,
        "product_id": 1,
        "name": "Test2",
        "is_active": false,
        "created_at": "2019-07-11 08:29:40",
        "updated_at": "2020-05-25 14:08:46"
    },
    {
        "id": 3,
        "product_id": 1,
        "name": "Test3",
        "is_active": false,
        "created_at": "2019-07-11 08:30:28",
        "updated_at": "2020-05-25 14:07:42"
    }
]

Code Samples

curl --location --request GET 'https://api.desk360.com/v1/reasons' \
--header 'Authorization: Bearer YOUR_API_TOKEN'
var client = new RestClient("https://api.desk360.com/v1/reasons");
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);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
Request request = new Request.Builder()
  .url("https://api.desk360.com/v1/reasons")
  .method("GET", null)
  .addHeader("Authorization", "Bearer YOUR_API_TOKEN")
  .build();
Response response = client.newCall(request).execute();
var axios = require('axios');

var config = {
  method: 'get',
  url: 'https://api.desk360.com/v1/reasons',
  headers: { 
    'Authorization': 'Bearer YOUR_API_TOKEN'
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.desk360.com/v1/reasons',
  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;
import requests

url = "https://api.desk360.com/v1/reasons"

payload={}
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

Create Reason

POST https://api.desk360.com/v1/reasons

Create a new ticket reason.

Headers

Name
Type
Description

Authorization

string

Your API token

Request Body

Name
Type
Description

product_id

integer

Your product id

title

string

Title of the reason

is_active

boolean

The status of the ticket reason

{
    "id": 36,
    "product_id": 1,
    "title": "Test",
    "is_active": true,
    "created_at": "2021-01-05 15:19:54",
    "updated_at": "2021-01-05 15:19:54"
}

Code Samples

curl --location --request POST 'https://api.desk360.com/v1/reasons' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
    "product_id": 1,
    "title": "Test",
    "is_active": true
}'
var client = new RestClient("https://api.desk360.com/v1/reasons");
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    \"product_id\": 1,\n    \"title\": \"Test\",\n    \"is_active\": true\n}",  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n    \"product_id\": 1,\n    \"title\": \"Test\",\n    \"is_active\": true\n}");
Request request = new Request.Builder()
  .url("https://api.desk360.com/v1/reasons")
  .method("POST", body)
  .addHeader("Authorization", "Bearer YOUR_API_TOKEN")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();
var axios = require('axios');
var data = JSON.stringify({"product_id":1,"title":"Test","is_active":true});

var config = {
  method: 'post',
  url: 'https://api.desk360.com/v1/reasons',
  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);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.desk360.com/v1/reasons',
  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 =>'{
    "product_id": 1,
    "title": "Test",
    "is_active": true
}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer YOUR_API_TOKEN',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://api.desk360.com/v1/reasons"

payload="{\n    \"product_id\": 1,\n    \"title\": \"Test\",\n    \"is_active\": true\n}"
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN',
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Get Reason

GET https://api.desk360.com/v1/reasons/:reasonId

Get the reason by id.

Path Parameters

Name
Type
Description

reasonId

string

The id of reason

Headers

Name
Type
Description

Authorization

string

Your API Token

{
    "id": 11,
    "product_id": 1,
    "title": "Test",
    "is_active": true,
    "created_at": "2020-06-10 11:59:34",
    "updated_at": "2020-06-10 11:59:34"
}

Code Samples

curl --location --request GET 'https://api.desk360.com/v1/reasons/11' \
--header 'Authorization: Bearer YOUR_API_TOKEN'
var client = new RestClient("https://api.desk360.com/v1/reasons/11");
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);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
Request request = new Request.Builder()
  .url("https://api.desk360.com/v1/reasons/11")
  .method("GET", null)
  .addHeader("Authorization", "Bearer YOUR_API_TOKEN")
  .build();
Response response = client.newCall(request).execute();
var axios = require('axios');

var config = {
  method: 'get',
  url: 'https://api.desk360.com/v1/reasons/11',
  headers: { 
    'Authorization': 'Bearer YOUR_API_TOKEN'
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.desk360.com/v1/reasons/11',
  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;
import requests

url = "https://api.desk360.com/v1/reasons/11"

payload={}
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

Update Reason

PUT https://api.desk360.com/v1/reasons/:reasonId

Update the ticket reason.

Path Parameters

Name
Type
Description

reasonId

string

The id of reason

Headers

Name
Type
Description

Authorization

string

Your API token

Request Body

Name
Type
Description

product_id

integer

Your product id

title

string

Title of the reason

is_active

boolean

The status of the ticket reason

{
    "id": 11,
    "product_id": 1,
    "title": "Test",
    "is_active": false,
    "created_at": "2020-03-02 10:44:44",
    "updated_at": "2021-01-05 15:23:08"
}

Code Samples

curl --location --request PUT 'https://api.desk360.com/v1/reasons/11' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
    "product_id": 1,
    "title": "Test",
    "is_active": false
}'
var client = new RestClient("https://api.desk360.com/v1/reasons/11");
client.Timeout = -1;
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer YOUR_API_TOKEN");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n    \"product_id\": 1,\n    \"title\": \"Test\",\n    \"is_active\": false\n}",  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n    \"product_id\": 1,\n    \"title\": \"Test\",\n    \"is_active\": false\n}");
Request request = new Request.Builder()
  .url("https://api.desk360.com/v1/reasons/11")
  .method("PUT", body)
  .addHeader("Authorization", "Bearer YOUR_API_TOKEN")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();
var axios = require('axios');
var data = JSON.stringify({"product_id":1,"title":"Test","is_active":false});

var config = {
  method: 'put',
  url: 'https://api.desk360.com/v1/reasons/11',
  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);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.desk360.com/v1/reasons/11',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'PUT',
  CURLOPT_POSTFIELDS =>'{
    "product_id": 1,
    "title": "Test",
    "is_active": false
}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer YOUR_API_TOKEN',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://api.desk360.com/v1/reasons/11"

payload="{\n    \"product_id\": 1,\n    \"title\": \"Test\",\n    \"is_active\": false\n}"
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN',
  'Content-Type': 'application/json'
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)

WhatsApp Message Templates

WhatsApp message templates are message formats that let you deliver multiple notifications to customers who have agreed to receive them via WhatsApp.

Get WhatsApp Message Template

GET https://api.desk360.comv1/products/:productId/conversations/templates

Get WhatsApp message template and languages list from a product.

Path Parameters

Name
Type
Description

ProductId

Integer

The ID of your product

Headers

Name
Type
Description

Authorization

String

Your API Token

{
    โ€œcurrent_pageโ€: 1,
    โ€œdataโ€: [
        {
            โ€œidโ€: 1,
            โ€œtemplate_nameโ€: โ€œtest_caseโ€,
            โ€œlanguagesโ€: [
                {
                    โ€œtemplate_idโ€: 1,
                    โ€œlanguage_idโ€: 1,
                    โ€œheader_typeโ€: โ€œTEXTโ€,
                    โ€œheader_contentโ€: โ€œTracking Number for {{1}}โ€,
                    โ€œtextโ€: โ€œYour item is now ready for delivery.โ€,
                    โ€œparametersโ€: [
                        โ€œheader-1"
                    ],
                    โ€œlanguage_nameโ€: โ€œEnglishโ€,
                    โ€œlanguage_codeโ€: โ€œenโ€
                },
                {
                    โ€œtemplate_idโ€: 1,
                    โ€œlanguage_idโ€: 2,
                    โ€œheader_typeโ€: โ€œTEXTโ€,
                    โ€œheader_contentโ€: โ€œNumรฉro de suivi pour {{1}}โ€œ,
                    โ€œtextโ€: โ€œVotre colis est prรชt ร  รชtre expรฉdiรฉ.โ€,
                    โ€œparametersโ€: [
                        โ€œheader-dddโ€
                    ],
                    โ€œlanguage_nameโ€: โ€œFrenchโ€,
                    โ€œlanguage_codeโ€: โ€œfrโ€
                }
            ]
        },
        {
            โ€œidโ€: 13,
            โ€œtemplate_nameโ€: โ€œshipping_infoโ€,
            โ€œlanguagesโ€: [
                {
                    โ€œtemplate_idโ€: 13,
                    โ€œlanguage_idโ€: 2,
                    โ€œheader_typeโ€: โ€œPICTUREโ€,
                    โ€œtextโ€: โ€œYour item is now ready for delivery.โ€,
                    โ€œparametersโ€: [],
                    โ€œlanguage_nameโ€: โ€œEnglishโ€,
                    โ€œlanguage_codeโ€: โ€œenโ€
                }
            ]
        }
    ],
    โ€œfirst_page_urlโ€: โ€œhttp://api.localhost:10380/v1/products/1/conversations/templates?page=1โ€,
    โ€œfromโ€: 1,
    โ€œlast_pageโ€: 1,
    โ€œlast_page_urlโ€: โ€œhttp://api.localhost:10380/v1/products/1/conversations/templates?page=1โ€,
    โ€œnext_page_urlโ€: null,
    โ€œpathโ€: โ€œhttp://api.localhost:10380/v1/products/1/conversations/templatesโ€,
    โ€œper_pageโ€: 20,
    โ€œprev_page_urlโ€: null,
    โ€œtoโ€: 2,
    โ€œtotalโ€: 2
}

Code Samples

curl --location --request GET 'https://api.desk360.com/v1/products/:productId/conversations/templates/?page=1' \--header 'Authorization: Bearer YOUR_API_TOKEN'
var client = new RestClientRestClient("https://api.desk360.com/v1/products/:productId/conversations/templates");
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);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
Request request = new Request.Builder()
  .url("https://api.desk360.com/v1/products/:productId/conversations/templates")
  .method("GET", null)
  .addHeader("Authorization", "Bearer YOUR_API_TOKEN")
  .build();
Response response = client.newCall(request).execute();
var axios = require('axios');

var config = {
  method: 'get',
  url: 'https://api.desk360.com/v1/products/:productId/conversations/templates',
  headers: { 
    'Authorization': 'Bearer YOUR_API_TOKEN', 
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.desk360.com/v1/products/:productId/conversations/templates',
  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;
import requests

url = "https://api.desk360.com/v1/products/:productId/conversations/templates"

payload={}
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN',
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

Send WhatsApp Message Template

POST https://api.desk360.com/v1/products/:productId/conversations/templates:templateId/send

Send active WhatsApp message template to a WhatsApp number. If you send with attachments, use form-data. You can also send other body parameters with form-data as well.

Path Parameters

Name
Type
Description

ProductId

Integer

The ID of your product

TemplateId

Integer

Template ID to be sent

Headers

Name
Type
Description

Authorization

string

Your API Token

Request Body

Name
Type
Description

phone_number

string

WhatsApp number to be sent. It should start with (+) and a country code.

language_code

string

The language code of the template to be sent

parameters[]

array

Required parameters for the template. The key list received in the template list should be used as a key during submission.

attachment

object

Attachment for the message template (only allowed in form-data).

Code Samples

curl --location --request POST 'https://api.desk360.com/v1/products/:productId/conversations/templates/:templateId/send' \
--header 'Authorization: Bearer YOUR_API_TOKEN'
--header 'Authorization: Bearer Your Api Token' \
--form 'phone_number="+90xxxxxxxxxx"' \
--form 'language_code="en"' \
--form 'parameters[body-1]="Hi"' \
--form 'attachment=@"/Users/testuser/guard_test.png"' \
--form 'parameters[body-2]="120$"'
var client = new RestClient("https://api.desk360.com/v1/products/:productId/conversations/templates/:templateId/send");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer Your Api Token");
request.AddParameter("phone_number", "+90xxxxxxxxxx");
request.AddParameter("language_code", "en");
request.AddParameter("parameters[body-1]", "Hi");
request.AddFile("attachment", "/Users/testuser/guard_test.png");
request.AddParameter("parameters[body-2]", "120$");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("phone_number","+90xxxxxxxxxx")
.addFormDataPart("language_code","en")
.addFormDataPart("parameters[body-1]","Hi")
.addFormDataPart("attachment","guard_test.png",
RequestBody.create(MediaType.parse("application/octet-stream"),
new File("/Users/testuser/guard_test.png")))
.addFormDataPart("parameters[body-2]","120$")
.build();
Request request = new Request.Builder()
.url("https://api.desk360.com/v1/products/:productId/conversations/templates/:templateId/send")
.method("POST", body)
.addHeader("Authorization", "Bearer Your Api Token")
.build();
Response response = client.newCall(request).execute();
var axios = require('axios');
var FormData = require('form-data');
var fs = require('fs');
var data = new FormData();
data.append('phone_number', '+90xxxxxxxxxx');
data.append('language_code', 'en');
data.append('parameters[body-1]', 'Hi');
data.append('attachment', fs.createReadStream('/Users/testuser/guard_test.png'));
data.append('parameters[body-2]', '120$');

var config = {
method: 'post',
url: 'https://api.desk360.com/v1/products/:productId/conversations/templates/:templateId/send',
headers: { 
'Authorization': 'Bearer Your Api Token', 
...data.getHeaders()
},
data : data
};

axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.desk360.com/v1/products/:productId/conversations/templates/:templateId/send',
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 => array('phone_number' => '+90xxxxxxxxxx','language_code' => 'en','parameters[body-1]' => 'Hi','attachment'=> new CURLFILE('/Users/testuser/guard_test.png'),'parameters[body-2]' => '120$'),
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer Your Api Token'
),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://api.desk360.com/v1/products/:productId/conversations/templates/:templateId/send"

payload={'phone_number': '+90xxxxxxxxxx',
'language_code': 'en',
'parameters[body-1]': 'Hi',
'parameters[body-2]': '120$'}
files=[
('attachment',('guard_test.png',open('/Users/testuser/guard_test.png','rb'),'image/png'))
]
headers = {
'Authorization': 'Bearer Your Api Token'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)

Bulk Send WhatsApp Message Template

POST https://api.desk360.com/v1/products/:productId/conversations/templates:templateId/send/bulk

Send active WhatsApp message template to multiple WhatsApp number. If you send with attachments, use form-data. You can also send other body parameters with form-data as well.

Path Parameters

Name
Type
Description

ProductId

Integer

The ID of your product

TemplateId

Integer

Template ID to be sent

Headers

Name
Type
Description

Authorization

string

Your API Token

Request Body

Name
Type
Description

phones[]

array

WhatsApp numbers to be sent. It should start with (+) and a country code.

language_code

string

The language code of the template to be sent

parameters[]

array

Required parameters for the template. The key list received in the template list should be used as a key during submission.

attachment

object

Attachment for the message template (only allowed in form-data).

bulk_phone_file

object

WhatsApp numbers csv file to be sent. It should start with (+) and a country code.

Code Samples

curl --location --request POST 'https://api.desk360.com/v1/products/:productId/conversations/templates/:templateId/send/bulk' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--form 'language_code="en"' \
--form 'parameters[body-1]="Hello"' \
--form 'attachment=@"/path/to/file"' \
--form 'phones[0]="+90xxxxxxxxxx"' \
--form 'phones[1]="+90xxxxxxxxxx"' \
--form 'bulk_phone_file=@"/path/to/csv_file"'
var options = new RestClientOptions("https://api.desk360.com")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/v1/products/:productId/conversations/templates/:templateId/send/bulk", Method.Post);
request.AddHeader("Authorization", "Bearer YOUR_API_TOKEN");
request.AlwaysMultipartFormData = true;
request.AddParameter("language_code", "en");
request.AddParameter("parameters[body-1]", "Hello");
request.AddFile("attachment", "/path/to/file");
request.AddParameter("phones[0]", "+90xxxxxxxxxx");
request.AddParameter("phones[1]", "+90xxxxxxxxxx");
request.AddFile("bulk_phone_file", "/path/to/csv_file");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("language_code","en")
  .addFormDataPart("parameters[body-1]","Hello")
  .addFormDataPart("attachment","file",
    RequestBody.create(MediaType.parse("application/octet-stream"),
    new File("/path/to/file")))
  .addFormDataPart("phones[0]","+90xxxxxxxxxx")
  .addFormDataPart("phones[1]","+90xxxxxxxxxx")
  .addFormDataPart("bulk_phone_file","file",
    RequestBody.create(MediaType.parse("application/octet-stream"),
    new File("/path/to/csv_file")))
  .build();
Request request = new Request.Builder()
  .url("https://api.desk360.com/v1/products/:productId/conversations/templates/:templateId/send/bulk")
  .method("POST", body)
  .addHeader("Authorization", "Bearer YOUR_API_TOKEN")
  .build();
Response response = client.newCall(request).execute();
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
let data = new FormData();
data.append('language_code', 'en');
data.append('parameters[body-1]', 'Hello');
data.append('attachment', fs.createReadStream('/path/to/file'));
data.append('phones[0]', '+90xxxxxxxxxx');
data.append('phones[1]', '+90xxxxxxxxxx');
data.append('bulk_phone_file', fs.createReadStream('/path/to/csv_file'));

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.desk360.com/v1/products/:productId/conversations/templates/1/send/bulk',
  headers: { 
    'Authorization': 'Bearer YOUR_API_TOKEN', 
    ...data.getHeaders()
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.desk360.com/v1/products/:productId/conversations/templates/:templateId/send/bulk',
  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 => array('language_code' => 'en','parameters[body-1]' => 'Hello','attachment'=> new CURLFILE('/path/to/file'),'phones[0]' => '+90xxxxxxxxxx','phones[1]' => '+90xxxxxxxxxx','bulk_phone_file'=> new CURLFILE('/path/to/csv_file')),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer YOUR_API_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://api.desk360.com/v1/products/:productId/conversations/templates/:templateId/send/bulk"

payload = {'language_code': 'en',
'parameters[body-1]': 'Hello',
'phones[0]': '+90xxxxxxxxxx',
'phones[1]': '+90xxxxxxxxxx'}
files=[
  ('attachment',('file',open('/path/to/file','rb'),'application/octet-stream')),
  ('bulk_phone_file',('file',open('/path/to/csv_file','rb'),'application/octet-stream'))
]
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)

WhatsApp Messages

Use the messages node to send text, location, contact, media, interactive, location request and read receipt message to your customers.

Send WhatsApp Message

POST https://api.desk360.com/v1/products/:productId/conversations/messages

Send message to an active WhatsApp number.

Path Parameters

Name
Type
Description

ProductId*

Integer

The ID of your product

Headers

Name
Type
Description

Authorization *

string

Your API Token

Request Body

Name
Type
Description

to*

string

WhatsApp number to be sent. It should start with (+) and a country code.

text *

string

Message body. It should max 4096 chars.

Code Samples

curl --location --request POST 'https://api.desk360.com/v1/products/:productId/conversations/messages' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--form 'to="+90xxxxxxxxxx"' \
--form 'text="Hello!"'
var options = new RestClientOptions("https://api.desk360.com")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/v1/products/:productId/conversations/messages", Method.Post);
request.AddHeader("Authorization", "Bearer YOUR_API_TOKEN");
request.AlwaysMultipartFormData = true;
request.AddParameter("to", "+90xxxxxxxxxx");
request.AddParameter("text", "Hello!");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("to","+90xxxxxxxxxx")
  .addFormDataPart("text","Hello!")
  .build();
Request request = new Request.Builder()
  .url("https://api.desk360.com/v1/products/:productId/conversations/messages")
  .method("POST", body)
  .addHeader("Authorization", "Bearer YOUR_API_TOKEN")
  .build();
Response response = client.newCall(request).execute();
const axios = require('axios');
const FormData = require('form-data');
let data = new FormData();
data.append('to', '+90xxxxxxxxxx');
data.append('text', 'hello!');

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.desk360.com/v1/products/:productId/conversations/messages',
  headers: { 
    'Authorization': 'Bearer YOUR_API_TOKEN', 
    ...data.getHeaders()
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.desk360.com/v1/products/:productId/conversations/messages',
  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 => array('to' => '+90xxxxxxxxxx','text' => 'Hello!'),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer YOUR_API_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://api.desk360.com/v1/products/:productId/conversations/messages"

payload = {'to': '+90xxxxxxxxxx',
'text': 'Hello!'}
files=[

]
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)

Send WhatsApp Location Message

POST https://api.desk360.com/v1/products/:productId/conversations/messages

Send location message to an active WhatsApp number.

Path Parameters

Name
Type
Description

ProductId*

Integer

The ID of your product

Headers

Name
Type
Description

Authorization *

String

Your API Token

Request Body

Name
Type
Description

to*

String

WhatsApp number to be sent. It should start with (+) and a country code.

type*

String

Must be "location".

location*

Object

An object of the message.

location.longitude*

Numeric

Longitude of location.

location.latitude*

Numeric

Latitude of location.

location.name*

String

Name of location.

location.address*

String

Address of location.

Code Samples

curl --location --request POST 'https://api.desk360.com/v1/products/:productId/conversations/messages' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--data '{
    "to": "+90xxxxxxxxxx",
    "type": "location",
    "location": {
        "longitude": -122.425332,
        "latitude": 37.758056,
        "name": "Facebook HQ",
        "address": "1 Hacker Way, Menlo Park, CA 94025"
    }
}'
var options = new RestClientOptions("https://api.desk360.com")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/v1/products/:productId/conversations/messages", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer YOUR_API_TOKEN");
var body = @"{" + "\n" +
@"    ""to"": ""+90xxxxxxxxxx""," + "\n" +
@"    ""type"": ""location""," + "\n" +
@"    ""location"": {" + "\n" +
@"        ""longitude"": -122.425332," + "\n" +
@"        ""latitude"": 37.758056," + "\n" +
@"        ""name"": ""Facebook HQ""," + "\n" +
@"        ""address"": ""1 Hacker Way, Menlo Park, CA 94025""" + "\n" +
@"    }" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n    \"to\": \"+90xxxxxxxxxx\",\n    \"type\": \"location\",\n    \"location\": {\n        \"longitude\": -122.425332,\n        \"latitude\": 37.758056,\n        \"name\": \"Facebook HQ\",\n        \"address\": \"1 Hacker Way, Menlo Park, CA 94025\"\n    }\n}");
Request request = new Request.Builder()
  .url("https://api.desk360.com/v1/products/:productId/conversations/messages")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer YOUR_API_TOKEN")
  .build();
Response response = client.newCall(request).execute();
const axios = require('axios');
let data = JSON.stringify({
  "to": "+90xxxxxxxxxx",
  "type": "location",
  "location": {
    "longitude": -122.425332,
    "latitude": 37.758056,
    "name": "Facebook HQ",
    "address": "1 Hacker Way, Menlo Park, CA 94025"
  }
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.desk360.com/v1/products/:productId/conversations/messages',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': 'Bearer YOUR_API_TOKEN'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.desk360.com/v1/products/:productId/conversations/messages',
  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 =>'{
    "to": "+90xxxxxxxxxx",
    "type": "location",
    "location": {
        "longitude": -122.425332,
        "latitude": 37.758056,
        "name": "Facebook HQ",
        "address": "1 Hacker Way, Menlo Park, CA 94025"
    }
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Bearer YOUR_API_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests
import json

url = "https://api.desk360.com/v1/products/:productId/conversations/messages"

payload = json.dumps({
  "to": "+90xxxxxxxxxx",
  "type": "location",
  "location": {
    "longitude": -122.425332,
    "latitude": 37.758056,
    "name": "Facebook HQ",
    "address": "1 Hacker Way, Menlo Park, CA 94025"
  }
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Send WhatsApp Contact Message

POST https://api.desk360.com/v1/products/:productId/conversations/messages

Send contact message to an active WhatsApp number.

Path Parameters

Name
Type
Description

ProductId*

Integer

The ID of your product

Headers

Name
Type
Description

Authorization *

String

Your API Token

Request Body

Name
Type
Description

to*

String

WhatsApp number to be sent. It should start with (+) and a country code.

type*

String

Must be "contacts".

contacts*

Array

An array of the message.

contacts.*.addresses.*.street

String

Street of address.

contacts.*.addresses.*.city

String

City of address.

contacts.*.addresses.*.state

String

State of address.

contacts.*.addresses.*.zip

String

Zip code of address.

contacts.*.addresses.*.country

String

Country of address.

contacts.*.addresses.*.country_code

String

Country code of address.

contacts.*.addresses.*.type

String

Type of address.

contacts.*.birthday

String

Birtday of contacts. Must be "Y-m-d" format.

contacts.*.emails.*.email

String

Email of emails.

contacts.*.emails.*.type

String

Type of emails.

contacts.*.name.formatted_name*

String

Formatted name of name object.

contacts.*.name.first_name*

String

First name of name object.

contacts.*.name.last_name*

String

Last name of name object.

contacts.*.name.middle_name

String

Middle name of name object.

contacts.*.name.suffix

String

Suffix of name.

contacts.*.name.prefix

String

Prefix of name.

contacts.*.org.company

String

Company name of organization.

contacts.*.org.department

String

Department of organization.

contacts.*.org.title

String

Title of organization.

contacts.*.phones.*.phone

String

Phone number of phones.

contacts.*.phones.*.type

String

Type of phones.

contacts.*.phones.*.wa_id

String

WAID of phones

contacts.*.urls.*.url

String

Url of urls.

contacts.*.urls.*.type

String

Type of urls.

Code Samples

curl --location --request POST 'https://api.desk360.com/v1/products/:productId/conversations/messages' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--data-raw '{
    "to": "+90xxxxxxxxxx",
    "type": "contacts",
    "contacts": [
        {
            "addresses": [
                {
                    "city": "Menlo Park",
                    "country": "United States",
                    "country_code": "us",
                    "state": "CA",
                    "street": "1 Hacker Way",
                    "type": "HOME",
                    "zip": "94025"
                }
            ],
            "birthday": "2012-08-18",
            "emails": [
                {
                    "email": "test@whatsapp.com",
                    "type": "WORK"
                }
            ],
            "name": {
                "first_name": "John",
                "formatted_name": "John Smith",
                "last_name": "Smith"
            },
            "org": {
                "company": "WhatsApp",
                "department": "Design",
                "title": "Manager"
            },
            "phones": [
                {
                    "phone": "+1 (650) 555-1234",
                    "type": "WORK",
                    "wa_id": "16505551234"
                }
            ],
            "urls": [
                {
                    "url": "https://www.facebook.com",
                    "type": "WORK"
                }
            ]
        }
    ]
}'
var options = new RestClientOptions("https://api.desk360.com")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/v1/products/:productId/conversations/messages", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer YOUR_API_TOKEN");
var body = @"{" + "\n" +
@"    ""to"": ""+90xxxxxxxxxx""," + "\n" +
@"    ""type"": ""contacts""," + "\n" +
@"    ""contacts"": [" + "\n" +
@"        {" + "\n" +
@"            ""addresses"": [" + "\n" +
@"                {" + "\n" +
@"                    ""city"": ""Menlo Park""," + "\n" +
@"                    ""country"": ""United States""," + "\n" +
@"                    ""country_code"": ""us""," + "\n" +
@"                    ""state"": ""CA""," + "\n" +
@"                    ""street"": ""1 Hacker Way""," + "\n" +
@"                    ""type"": ""HOME""," + "\n" +
@"                    ""zip"": ""94025""" + "\n" +
@"                }" + "\n" +
@"            ]," + "\n" +
@"            ""birthday"": ""2012-08-18""," + "\n" +
@"            ""emails"": [" + "\n" +
@"                {" + "\n" +
@"                    ""email"": ""test@whatsapp.com""," + "\n" +
@"                    ""type"": ""WORK""" + "\n" +
@"                }" + "\n" +
@"            ]," + "\n" +
@"            ""name"": {" + "\n" +
@"                ""first_name"": ""John""," + "\n" +
@"                ""formatted_name"": ""John Smith""," + "\n" +
@"                ""last_name"": ""Smith""" + "\n" +
@"            }," + "\n" +
@"            ""org"": {" + "\n" +
@"                ""company"": ""WhatsApp""," + "\n" +
@"                ""department"": ""Design""," + "\n" +
@"                ""title"": ""Manager""" + "\n" +
@"            }," + "\n" +
@"            ""phones"": [" + "\n" +
@"                {" + "\n" +
@"                    ""phone"": ""+1 (650) 555-1234""," + "\n" +
@"                    ""type"": ""WORK""," + "\n" +
@"                    ""wa_id"": ""16505551234""" + "\n" +
@"                }" + "\n" +
@"            ]," + "\n" +
@"            ""urls"": [" + "\n" +
@"                {" + "\n" +
@"                    ""url"": ""https://www.facebook.com""," + "\n" +
@"                    ""type"": ""WORK""" + "\n" +
@"                }" + "\n" +
@"            ]" + "\n" +
@"        }" + "\n" +
@"    ]" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n    \"to\": \"+90xxxxxxxxxx\",\n    \"type\": \"contacts\",\n    \"contacts\": [\n        {\n            \"addresses\": [\n                {\n                    \"city\": \"Menlo Park\",\n                    \"country\": \"United States\",\n                    \"country_code\": \"us\",\n                    \"state\": \"CA\",\n                    \"street\": \"1 Hacker Way\",\n                    \"type\": \"HOME\",\n                    \"zip\": \"94025\"\n                }\n            ],\n            \"birthday\": \"2012-08-18\",\n            \"emails\": [\n                {\n                    \"email\": \"test@whatsapp.com\",\n                    \"type\": \"WORK\"\n                }\n            ],\n            \"name\": {\n                \"first_name\": \"John\",\n                \"formatted_name\": \"John Smith\",\n                \"last_name\": \"Smith\"\n            },\n            \"org\": {\n                \"company\": \"WhatsApp\",\n                \"department\": \"Design\",\n                \"title\": \"Manager\"\n            },\n            \"phones\": [\n                {\n                    \"phone\": \"+1 (650) 555-1234\",\n                    \"type\": \"WORK\",\n                    \"wa_id\": \"16505551234\"\n                }\n            ],\n            \"urls\": [\n                {\n                    \"url\": \"https://www.facebook.com\",\n                    \"type\": \"WORK\"\n                }\n            ]\n        }\n    ]\n}");
Request request = new Request.Builder()
  .url("https://api.desk360.com/v1/products/:productId/conversations/messages")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer YOUR_API_TOKEN")
  .build();
Response response = client.newCall(request).execute();
const axios = require('axios');
let data = JSON.stringify({
  "to": "+90xxxxxxxxxx",
  "type": "contacts",
  "contacts": [
    {
      "addresses": [
        {
          "city": "Menlo Park",
          "country": "United States",
          "country_code": "us",
          "state": "CA",
          "street": "1 Hacker Way",
          "type": "HOME",
          "zip": "94025"
        }
      ],
      "birthday": "2012-08-18",
      "emails": [
        {
          "email": "test@whatsapp.com",
          "type": "WORK"
        }
      ],
      "name": {
        "first_name": "John",
        "formatted_name": "John Smith",
        "last_name": "Smith"
      },
      "org": {
        "company": "WhatsApp",
        "department": "Design",
        "title": "Manager"
      },
      "phones": [
        {
          "phone": "+1 (650) 555-1234",
          "type": "WORK",
          "wa_id": "16505551234"
        }
      ],
      "urls": [
        {
          "url": "https://www.facebook.com",
          "type": "WORK"
        }
      ]
    }
  ]
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.desk360.com/v1/products/:productId/conversations/messages',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': 'Bearer YOUR_API_TOKEN'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.desk360.com/v1/products/:productId/conversations/messages',
  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 =>'{
    "to": "+90xxxxxxxxxx",
    "type": "contacts",
    "contacts": [
        {
            "addresses": [
                {
                    "city": "Menlo Park",
                    "country": "United States",
                    "country_code": "us",
                    "state": "CA",
                    "street": "1 Hacker Way",
                    "type": "HOME",
                    "zip": "94025"
                }
            ],
            "birthday": "2012-08-18",
            "emails": [
                {
                    "email": "test@whatsapp.com",
                    "type": "WORK"
                }
            ],
            "name": {
                "first_name": "John",
                "formatted_name": "John Smith",
                "last_name": "Smith"
            },
            "org": {
                "company": "WhatsApp",
                "department": "Design",
                "title": "Manager"
            },
            "phones": [
                {
                    "phone": "+1 (650) 555-1234",
                    "type": "WORK",
                    "wa_id": "16505551234"
                }
            ],
            "urls": [
                {
                    "url": "https://www.facebook.com",
                    "type": "WORK"
                }
            ]
        }
    ]
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Bearer YOUR_API_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests
import json

url = "https://api.desk360.com/v1/products/:productId/conversations/messages"

payload = json.dumps({
  "to": "+90xxxxxxxxxx",
  "type": "contacts",
  "contacts": [
    {
      "addresses": [
        {
          "city": "Menlo Park",
          "country": "United States",
          "country_code": "us",
          "state": "CA",
          "street": "1 Hacker Way",
          "type": "HOME",
          "zip": "94025"
        }
      ],
      "birthday": "2012-08-18",
      "emails": [
        {
          "email": "test@whatsapp.com",
          "type": "WORK"
        }
      ],
      "name": {
        "first_name": "John",
        "formatted_name": "John Smith",
        "last_name": "Smith"
      },
      "org": {
        "company": "WhatsApp",
        "department": "Design",
        "title": "Manager"
      },
      "phones": [
        {
          "phone": "+1 (650) 555-1234",
          "type": "WORK",
          "wa_id": "16505551234"
        }
      ],
      "urls": [
        {
          "url": "https://www.facebook.com",
          "type": "WORK"
        }
      ]
    }
  ]
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Send WhatsApp Media Message

POST https://api.desk360.com/v1/products/:productId/conversations/messages/media

Send media messages to an active WhatsApp number.

Path Parameters

Name
Type
Description

ProductId*

Integer

The ID of your product

Headers

Name
Type
Description

Authorization *

string

Your API Token

Request Body

Name
Type
Description

to*

string

WhatsApp number to be sent. It should start with (+) and a country code.

attachments[]*

object

Attachment for the message (Only allowed in form-data).

Max Count: 5, Max Size: 20MB

Code Samples

curl --location --request POST 'https://api.desk360.com/v1/products/:productId/conversations/messages/media' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--form 'to="+90xxxxxxxxxx"' \
--form 'attachments[]=@"/path/to/file"'
var options = new RestClientOptions("https://api.desk360.com")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/v1/products/:productId/conversations/messages/media", Method.Post);
request.AddHeader("Authorization", "Bearer YOUR_API_TOKEN");
request.AlwaysMultipartFormData = true;
request.AddParameter("to", "+90xxxxxxxxxx");
request.AddFile("attachments[]", "/path/to/file");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("to","+90xxxxxxxxxx")
  .addFormDataPart("attachments[]","file",
    RequestBody.create(MediaType.parse("application/octet-stream"),
    new File("/path/to/file")))
  .build();
Request request = new Request.Builder()
  .url("https://api.desk360.com/v1/products/:productId/conversations/messages/media")
  .method("POST", body)
  .addHeader("Authorization", "Bearer YOUR_API_TOKEN")
  .build();
Response response = client.newCall(request).execute();
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
let data = new FormData();
data.append('to', '+90xxxxxxxxxx');
data.append('attachments[]', fs.createReadStream('/path/to/file'));

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.desk360.com/v1/products/:productId/conversations/messages/media',
  headers: { 
    'Authorization': 'Bearer YOUR_API_TOKEN', 
    ...data.getHeaders()
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.desk360.com/v1/products/:productId/conversations/messages/media',
  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 => array('to' => '+90xxxxxxxxxx','attachments[]'=> new CURLFILE('/path/to/file')),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer YOUR_API_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://api.desk360.com/v1/products/:productId/conversations/messages/media"

payload = {'to': '+90xxxxxxxxxx'}
files=[
  ('attachments[]',('file',open('/path/to/file','rb'),'application/octet-stream'))
]
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)

Get WhatsApp Media

GET https://api.desk360.com/v1/products/:productId/conversations/messages/media/:mediaId

Get whatsapp media by media id.

Path Parameters

Name
Type
Description

ProductId*

Integer

The ID of your product

MediaId*

String

The ID of media

Headers

Name
Type
Description

Authorization *

string

Your API Token

Code Samples

curl --location --request GET 'https://api.desk360.com/v1/products/:productId/conversations/messages/media/:mediaId' \
--header 'Authorization: Bearer YOUR_API_TOKEN'
var options = new RestClientOptions("https://api.desk360.com")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/v1/products/:productId/conversations/messages/media/:mediaId", Method.Get);
request.AddHeader("Authorization", "Bearer YOUR_API_TOKEN");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
MediaType JSON = MediaType.parse("application/json; charset=utf-8");
RequestBody body = RequestBody.create(JSON, "{}");
Request request = new Request.Builder()
  .url("https://api.desk360.com/v1/products/:productId/conversations/messages/media/:mediaId")
  .method("GET", body)
  .addHeader("Authorization", "Bearer YOUR_API_TOKEN")
  .build();
Response response = client.newCall(request).execute();
const axios = require('axios');
const FormData = require('form-data');
let data = new FormData();

let config = {
  method: 'get',
  maxBodyLength: Infinity,
  url: 'https://api.desk360.com/v1/products/:productId/conversations/messages/media/:mediaId',
  headers: { 
    'Authorization': 'Bearer YOUR_API_TOKEN', 
    ...data.getHeaders()
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.desk360.com/v1/products/:productId/conversations/messages/media/:mediaId',
  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;
import requests

url = "https://api.desk360.com/v1/products/:productId/conversations/messages/media/:mediaId"

payload = {}
files={}
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.request("GET", url, headers=headers, data=payload, files=files)

print(response.text)

Send WhatsApp Interactive Message

POST https://api.desk360.com/v1/products/:productId/conversations/messages/interactive

Send interactive message to an active WhatsApp number. If you send with header, use form-data. You can also send other body parameters with form-data as well.

Path Parameters

Name
Type
Description

ProductId*

Integer

The ID of your product

Headers

Name
Type
Description

Authorization *

string

Your API Token

Request Body

Name
Type
Description

to*

String

WhatsApp number to be sent. It should start with (+) and a country code.

body*

String

Message body. It must be max 1024 chars.

buttons[]*

Array

Required parameters for the interactive message. It must be max 10 button object item.

buttons.*.id*

String

Unique identifier for your button. This ID is returned in the webhook when the button is clicked by the user. Maximum length: 200 chars.

buttons.*.title*

String

Button title. It cannot be an empty string and must be unique within the message. Emojis are supported, markdown is not. Maximum length: 20 chars.

header

Object

An object with the header of the message.

header.type

String

Required if header is set. Supported values: text, image, video or document.

header.text

String

Required if header's type is text. It must be max 60 chars.

header.document.link

String

Required if header's type is document.

header.document.filename

String

Header's document filename.

header.video.link

String

Required if header's type is video.

header.image.link

String

Required if header's type is image.

footer

Object

An object with the footer of the message.

footer.text

String

Required if footer object. It must be max 60 chars.

Code Samples

curl --location --request POST 'https://api.desk360.com/v1/products/:productId/conversations/messages/interactive' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--data '{
    "to": "+90xxxxxxxxxx",
    "header": {
        "type": "image",
        "image": {
            "link": "https://fastly.picsum.photos/id/879/200/300.jpg?hmac=07llkorYxtpw0EwxaeqFKPC5woveWVLykQVnIOyiwd8"
        }
    },
    "body": "<p>Hello</p>",
    "footer": {
        "text": "<b>Bye</b>"
    },
    "buttons": [
        {
            "id": "ID 1.1",
            "title": "Button 1"
        },
        {
            "id": "ID 1.2",
            "title": "Button 2"
        },
        {
            "id": "ID 1.3",
            "title": "Button 3"
        }
    ]
}'
var options = new RestClientOptions("https://api.desk360.com")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/v1/products/:productId/conversations/messages/interactive", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer YOUR_API_TOKEN");
var body = @"{" + "\n" +
@"    ""to"": ""+90xxxxxxxxxx""," + "\n" +
@"    ""header"": {" + "\n" +
@"        ""type"": ""image""," + "\n" +
@"        ""image"": {" + "\n" +
@"            ""link"": ""https://fastly.picsum.photos/id/879/200/300.jpg?hmac=07llkorYxtpw0EwxaeqFKPC5woveWVLykQVnIOyiwd8""" + "\n" +
@"        }" + "\n" +
@"    }," + "\n" +
@"    ""body"": ""<p>Hello</p>""," + "\n" +
@"    ""footer"": {" + "\n" +
@"        ""text"": ""<b>Bye</b>""" + "\n" +
@"    }," + "\n" +
@"    ""buttons"": [" + "\n" +
@"        {" + "\n" +
@"            ""id"": ""ID 1.1""," + "\n" +
@"            ""title"": ""Button 1""" + "\n" +
@"        }," + "\n" +
@"        {" + "\n" +
@"            ""id"": ""ID 1.2""," + "\n" +
@"            ""title"": ""Button 2""" + "\n" +
@"        }," + "\n" +
@"        {" + "\n" +
@"            ""id"": ""ID 1.3""," + "\n" +
@"            ""title"": ""Button 3""" + "\n" +
@"        }" + "\n" +
@"    ]" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n    \"to\": \"+90xxxxxxxxxx\",\n    \"header\": {\n        \"type\": \"image\",\n        \"image\": {\n            \"link\": \"https://fastly.picsum.photos/id/879/200/300.jpg?hmac=07llkorYxtpw0EwxaeqFKPC5woveWVLykQVnIOyiwd8\"\n        }\n    },\n    \"body\": \"<p>Hello</p>\",\n    \"footer\": {\n        \"text\": \"<b>Bye</b>\"\n    },\n    \"buttons\": [\n        {\n            \"id\": \"ID 1.1\",\n            \"title\": \"Button 1\"\n        },\n        {\n            \"id\": \"ID 1.2\",\n            \"title\": \"Button 2\"\n        },\n        {\n            \"id\": \"ID 1.3\",\n            \"title\": \"Button 3\"\n        }\n    ]\n}");
Request request = new Request.Builder()
  .url("https://api.desk360.com/v1/products/:productId/conversations/messages/interactive")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer YOUR_API_TOKEN")
  .build();
Response response = client.newCall(request).execute();
const axios = require('axios');
let data = JSON.stringify({
  "to": "+90xxxxxxxxxx",
  "header": {
    "type": "image",
    "image": {
      "link": "https://fastly.picsum.photos/id/879/200/300.jpg?hmac=07llkorYxtpw0EwxaeqFKPC5woveWVLykQVnIOyiwd8"
    }
  },
  "body": "<p>Hello</p>",
  "footer": {
    "text": "<b>Bye</b>"
  },
  "buttons": [
    {
      "id": "ID 1.1",
      "title": "Button 1"
    },
    {
      "id": "ID 1.2",
      "title": "Button 2"
    },
    {
      "id": "ID 1.3",
      "title": "Button 3"
    }
  ]
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.desk360.com/v1/products/:productId/conversations/messages/interactive',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': 'Bearer YOUR_API_TOKEN'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.desk360.com/v1/products/:productId/conversations/messages/interactive',
  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 =>'{
    "to": "+90xxxxxxxxxx",
    "header": {
        "type": "image",
        "image": {
            "link": "https://fastly.picsum.photos/id/879/200/300.jpg?hmac=07llkorYxtpw0EwxaeqFKPC5woveWVLykQVnIOyiwd8"
        }
    },
    "body": "<p>Hello</p>",
    "footer": {
        "text": "<b>Bye</b>"
    },
    "buttons": [
        {
            "id": "ID 1.1",
            "title": "Button 1"
        },
        {
            "id": "ID 1.2",
            "title": "Button 2"
        },
        {
            "id": "ID 1.3",
            "title": "Button 3"
        }
    ]
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Bearer YOUR_API_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests
import json

url = "https://api.desk360.com/v1/products/:productId/conversations/messages/interactive"

payload = json.dumps({
  "to": "+90xxxxxxxxxx",
  "header": {
    "type": "image",
    "image": {
      "link": "https://fastly.picsum.photos/id/879/200/300.jpg?hmac=07llkorYxtpw0EwxaeqFKPC5woveWVLykQVnIOyiwd8"
    }
  },
  "body": "<p>Hello</p>",
  "footer": {
    "text": "<b>Bye</b>"
  },
  "buttons": [
    {
      "id": "ID 1.1",
      "title": "Button 1"
    },
    {
      "id": "ID 1.2",
      "title": "Button 2"
    },
    {
      "id": "ID 1.3",
      "title": "Button 3"
    }
  ]
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Send WhatsApp Location Request Interactive Message

POST https://api.desk360.com/v1/products/:productId/conversations/messages/interactive

Send location request interactive message to an active WhatsApp number. If you send with header, use form-data. You can also send other body parameters with form-data as well.

Path Parameters

Name
Type
Description

ProductId*

Integer

The ID of your product

Headers

Name
Type
Description

Authorization *

String

Your API Token

Request Body

Name
Type
Description

to*

String

WhatsApp number to be sent. It should start with (+) and a country code.

body*

String

Message body. It must be max 1024 chars.

header

Object

An object with the header of the message.

header.type

String

Required if header is set. Supported values: text or image.

header.text

String

Required if header's type is text. It must be max 60 chars.

type*

String

Must be "location_request_message".

header.image.link

String

Required if header's type is image.

Code Samples

curl --location --request POST 'https://api.desk360.com/v1/products/:productId/conversations/messages/interactive' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--data '{
    "to": "+90xxxxxxxxxx",
    "type": "location_request_message",
    "header": {
        "type": "text",
        "text": "Location Request"
    },
    "body": "<i>Send Location</i>"
}'
var options = new RestClientOptions("https://api.desk360.com")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/v1/products/:productId/conversations/messages/interactive", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer YOUR_API_TOKEN");
var body = @"{" + "\n" +
@"    ""to"": ""+90xxxxxxxxxx""," + "\n" +
@"    ""type"": ""location_request_message""," + "\n" +
@"    ""header"": {" + "\n" +
@"        ""type"": ""text""," + "\n" +
@"        ""text"": ""Location Request""" + "\n" +
@"    }," + "\n" +
@"    ""body"": ""<i>Send Location</i>""" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n    \"to\": \"+90xxxxxxxxxx\",\n    \"type\": \"location_request_message\",\n    \"header\": {\n        \"type\": \"text\",\n        \"text\": \"Location Request\"\n    },\n    \"body\": \"<i>Send Location</i>\"\n}");
Request request = new Request.Builder()
  .url("https://api.desk360.com/v1/products/:productId/conversations/messages/interactive")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer YOUR_API_TOKEN")
  .build();
Response response = client.newCall(request).execute();
const axios = require('axios');
let data = JSON.stringify({
  "to": "+90xxxxxxxxxx",
  "type": "location_request_message",
  "header": {
    "type": "text",
    "text": "Location Request"
  },
  "body": "<i>Send Location</i>"
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.desk360.com/v1/products/:productId/conversations/messages/interactive',
  headers: { 
    'Content-Type': 'application/json', 
    'Authorization': 'Bearer YOUR_API_TOKEN'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.desk360.com/v1/products/:productId/conversations/messages/interactive',
  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 =>'{
    "to": "+90xxxxxxxxxx",
    "type": "location_request_message",
    "header": {
        "type": "text",
        "text": "Location Request"
    },
    "body": "<i>Send Location</i>"
}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json',
    'Authorization: Bearer YOUR_API_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests
import json

url = "https://api.desk360.com/v1/products/:productId/conversations/messages/interactive"

payload = json.dumps({
  "to": "+90xxxxxxxxxx",
  "type": "location_request_message",
  "header": {
    "type": "text",
    "text": "Location Request"
  },
  "body": "<i>Send Location</i>"
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Read WhatsApp Message

POST https://api.desk360.com/v1/products/:productId/conversations/messages/read

Mark messages from webhook as read.

Path Parameters

Name
Type
Description

ProductId*

Integer

The ID of your product

Headers

Name
Type
Description

Authorization *

string

Your API Token

Request Body

Name
Type
Description

message_ids[]*

object

Message ids to mark as read

Code Samples

curl --location --request POST 'https://api.desk360.com/v1/products/:productId/conversations/messages/read' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--form 'message_ids[]="xxxxxxxxxxxxxxxx"'
var options = new RestClientOptions("https://api.desk360.com")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/v1/products/:productId/conversations/messages/read", Method.Post);
request.AddHeader("Authorization", "Bearer YOUR_API_TOKEN");
request.AlwaysMultipartFormData = true;
request.AddParameter("message_ids[]", "xxxxxxxxxxxxxxxx");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("message_ids[]","xxxxxxxxxxxxxxxx")
  .build();
Request request = new Request.Builder()
  .url("https://api.desk360.com/v1/products/:productId/conversations/messages/read")
  .method("POST", body)
  .addHeader("Authorization", "Bearer YOUR_API_TOKEN")
  .build();
Response response = client.newCall(request).execute();
const axios = require('axios');
const FormData = require('form-data');
let data = new FormData();
data.append('message_ids[]', 'xxxxxxxxxxxxxxxx');

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://api.desk360.com/v1/products/:productId/conversations/messages/read',
  headers: { 
    'Authorization': 'Bearer YOUR_API_TOKEN', 
    ...data.getHeaders()
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.desk360.com/v1/products/:productId/conversations/messages/read',
  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 => array('message_ids[]' => 'xxxxxxxxxxxxxxxx'),
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer YOUR_API_TOKEN'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests

url = "https://api.desk360.com/v1/products/:productId/conversations/messages/read"

payload = {'message_ids[]': 'xxxxxxxxxxxxxxxx'}
files=[

]
headers = {
  'Authorization': 'Bearer YOUR_API_TOKEN'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)

WhatsApp Webhooks

Subscribe to Webhooks to be notified about messages and message status updates your business receives.

Received Messages Examples

Text Messages

{
  "messages": {
    "id": "ABEGkFMIcyRoAgo-sGaD-H6MgPEt",
    "text": "Hello",
    "from": "90xxxxxxxxxx",
    "timestamp": "1630913975",
    "name": "John Doe",
    "type": "text"
  }
}

Location Messages

{
  "messages": {
    "id": "ABEGkFBXUQRnAgo6cHkZc1yy0dAx",
    "text": "Main Street Beach - Main Street Beach, Santa Cruz, CA, latitude: 38.9806263495, longitude: -131.9428612257",
    "from": "90xxxxxxxxxx",
    "timestamp": "1700052659",
    "name": "John Doe",
    "location": {
      "address": "Main Street Beach, Santa Cruz, CA",
      "latitude": 38.9806263495,
      "longitude": -131.9428612257,
      "name": "Main Street Beach"
    },
    "type": "location"
  }
}

Contact Messages

{
  "messages": {
    "id": "ABEGkFBXUQRnAgo6PXn8aI1fmlOm",
    "from": "90xxxxxxxxxx",
    "timestamp": "1700052797",
    "name": "John Doe",
    "type": "contacts",
    "contacts": [
      {
        "addresses": [
          {
            "city": "Menlo Park",
            "country": "United States",
            "country_code": "us",
            "state": "CA",
            "street": "1 Hacker Way",
            "type": "WORK",
            "zip": "94025"
          }
        ],
        "birthday": "2012-08-18",
        "emails": [
          {
            "email": "kfish@fb.com",
            "type": "WORK"
          }
        ],
        "ims": [
          {
            "service": "AIM",
            "user_id": "kfish"
          }
        ],
        "name": {
          "first_name": "Kerry",
          "formatted_name": "Kerry Fisher",
          "last_name": "Fisher"
        },
        "org": {
          "company": "Meta",
          "department": "WhatsApp"
        },
        "phones": [
          {
            "phone": "+1 (650) 555-1234",
            "type": "WORK",
            "wa_id": "16505551234"
          }
        ],
        "urls": [
          {
            "url": "https://www.facebook.com",
            "type": "WORK"
          }
        ]
      }
    ]
  }
}

Media Messages

{
  "messages": {
    "id": "ABEGkFBXUQRnAgo6xTEQCONO2nW9",
    "from": "90xxxxxxxxxx",
    "timestamp": "1689756449",
    "name": "John Doe",
    "image": {
      "message": null,
      "media_id": "83518734-56a9-4b51-8372-93f1432cfa9b",
      "mime_type": "image/jpeg",
      "sha": "7e18d97d50eea65a50d9fa93db26e1c689da7c7de64d829b22aad38c4f541510"
    },
    "attachments": {
      "images": [
        {
          "url": "https://path/to/file/9oCtWHWxkv4E0PQhtHA4uW4NRinIROKCO8NEae5p.jpeg",
          "name": "9oCtWHWxkv4E0PQhtHA4uW4NRinIROKCO8NEae5p.jpeg",
          "type": "image",
          "aws": true
        }
      ]
    },
    "type": "image"
  }
}

Chatbot History Messages

{
  "bot_histories": [
    {
      "type": "Message",
      "to": "90xxxxxxxxxx",
      "is_bot": true,
      "text": "<p>Welcome to Desk360</p>"
    },
    {
      "type": "Button",
      "from": "90xxxxxxxxxx",
      "is_bot": false,
      "text": "More Information",
      "id": "ABEGkFMIcyRoAgs-sFmk8fXNlUGwIQ",
      "timestamp": "1692787287"
    },
    {
      "type": "Message",
      "to": "90xxxxxxxxxx",
      "is_bot": true,
      "text": "<p>You can get more information about Desk360 with the following options.</p>"
    },
    {
      "type": "Message",
      "to": "90xxxxxxxxxx",
      "is_bot": true,
      "text": "<p>Which stream would you like to continue with?</p><p>You can choose between Plans or Features.</p>"
    },
    {
      "type": "Button",
      "from": "90xxxxxxxxxx",
      "is_bot": false,
      "text": "Planlar",
      "id": "ABEGkFMIcyRoAgs-sKdcXA5TLZA6Kg",
      "timestamp": "1692787290"
    },
    {
      "type": "Message",
      "to": "90xxxxxxxxxx",
      "is_bot": true,
      "text": "<p><a href=\"https://desk360.com/plans\" rel=\"noopener noreferrer\" target=\"_blank\"><strong><em>Link</em></strong></a><strong><em> </em></strong>You can choose the most suitable one for you, and for more information, you can choose with the buttons below.</p>"
    },
    {
      "type": "Button",
      "from": "90xxxxxxxxxx",
      "is_bot": false,
      "text": "Business",
      "id": "ABEGkFMIcyRoAgs-sBze1AGIeGetzA",
      "timestamp": "1692787296"
    },
    {
      "type": "Button",
      "from": "90xxxxxxxxxx",
      "is_bot": false,
      "text": "Live Help",
      "id": "ABEGkFMIcyRoAgs-sKIFnZGasIlQdA",
      "timestamp": "1692787299"
    }
  ]
}

Auto Reply Messages

{
  "auto_replies": [
    {
      "id": "gBEGkFMIcyRoAgngaep4vprrvIE",
      "text": "Welcome to Desk360",
      "to": "90xxxxxxxxxx",
      "timestamp": "1692777543"
    },
    {
      "id": "gBEGkFMIcyRoAgkDpFE1rjPvhgw",
      "text": "You can review the file for more information about the Business plan.",
      "to": "905308732468",
      "timestamp": "1692777543",
      "attachments": [
        {
          "aws": true,
          "url": "https://path/to/file/0PyN0yBLlecc3DlzX5FoH45UBIA6qZk0Xlo7exfN.pdf",
          "name": "0PyN0yBLlecc3DlzX5FoH45UBIA6qZk0Xlo7exfN.pdf",
          "type": "file",
          "contentType": "application/pdf"
        }
      ]
    }
  ]
}

Status Updates

{
  "statuses": {
    "id": "gBEGkFBXUQRnAglM82HET_hbwJs",
    "from": "90xxxxxxxxxx",
    "status": "delivered|read"
  }
}

Up to your demand. For further requests, .

Getting Started

Authentication

Attachments

Replying to a ticket Adding a note to a ticket

Errors

Check for more information.

The API rate limit allowed for your Desk360 domain has been exhausted. Check.

You can't do much more here. This indicates an error on the Desk360 side. Please your API script with response headers. We will contact you and fix this issue as soon as possible.

If the method and endpoint is mismatched, you will get this error. Please check the endpoint method. eg: only allows GET method.

The error is coming from our servers. If you have been receiving this error message for a while, .

Check .

You can enable password access from your Desk360 Panel Settings. Check to learn how to enable password access.

Pagination

Best Practices

Products & Tickets

In order to find your Product ID, visit .

Agents

Types

Reasons

๐Ÿš€
๐Ÿ”’
๐Ÿ“Ž
โ—พ
โ—พ
โŒ
๐Ÿ“„
โœ…
๐ŸŽซ
๐Ÿ‘ฅ
๐Ÿงพ
๐Ÿ”Ž
๐Ÿ’ฌ
โ—พ
โ—พ
โ—พ
โ—พ
โœจ
๐Ÿ’จ
REST
CORS
Products
contact us
email us
contact us
Authentication
Rate Limit
Products
Rate Limit
Authentication