Support Ticket

Support Ticket Category List

GET ‎https://<domain>/<api prefix>/<version>/support/get/category-list/

This API endpoint will give a list of Category which was chosen when creating a support ticket.

Headers

NameTypeDescription

apikey*

string

apikey

Authorization*

string

Bearer access token

HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {
        "CategoryList": [
            {
                "id": <Category-id>,
                "category": "<Category-name>",
                "description": "<Description>"
            },
           ...
        ]
    }
}

Sample Code

Node

var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://<domain>/<api prefix>/<version>/support/get/category-list/',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access-token>'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://<domain>/<api prefix>/<version>/support/get/category-list/",
  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(
    "apikey: <apikey>",
    "Authorization: Bearer <access-token>",
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Create Support Ticket

POST ‎https://<domain>/<api prefix>/<version>/support/create/ticket/

This API endpoint will create a support ticket.

Headers

NameTypeDescription

apikey*

string

apikey

Authorization*

string

Bearer access-token

Request Body

NameTypeDescription

subject*

string

ticket subject

priority

string

priority id - Possible values are 1(Low), 2(Medium),or 3(High)

comment*

string

ticket comment

category

string

category id - Get possible values through Support Ticket Category List API endpoint.

attachment

object

attachment file - Upload a attachment file (maximum size 2Mib).

​​​​​HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {}
}

Sample Code

Node

var request = require('request');
var fs = require('fs');
var options = {
  'method': 'POST',
  'url': 'https://<domain>/<api prefix>/<version>/creat/support/ticket/',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access-token>',
  },
  formData: {
    'subject': '<subject>',
    'priority': '<priority-id>',
    'comment': '<comment>',
    'category': '<category-id>',
    'attachment': {
      'value': fs.createReadStream('<file_path>'),
      'options': {
        'filename': '<file_name>',
        'contentType': null
      }
    }
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://<domain>/<api prefix>/<version>/creat/support/ticket/",
  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('subject' => '<subject>','priority' => '<priority-id>','comment' => '<comment>','category' => '<category>','attachment'=> new CURLFILE('<file_path>')),
  CURLOPT_HTTPHEADER => array(
    "apikey: <apikey>",
    "Authorization: Bearer <access-token>",
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Error Responses

Status Code

Error Type

Field

Description

400

Validation Error

subject, comment

This field is required.

400

Validation Error

subject

Ensure this field has no more than 500 characters.

400

Validation Error

priority

"\"priority\" is not a valid choice.

400

Validation Error

category

Invalid pk"\"category\" - object does not exist.

400

Validation Error

attachment

File is too big. Max filesize: 2MiB.

401

Request Failed

Currenly Open Ticket Limit Exceed.

Support Ticket History

GET ‎https://<domain>/<api prefix>/<version>/support/get/ticket/history/

This API endpoint will provide a history of support tickets. A request without query params provides details of last created 50 tickets. To get a range of ticket history provide offset and limit values in query params. Also provides filtered details of ticket history when a request with a possible query params. Ticket subject, ticket category, and ticket status are the possible query params.

Query Parameters

NameTypeDescription

offset

string

offset value

limit

string

limit value

subject

string

ticket subject

category

string

category id - Get possible values through Support Ticket Category List API endpoint.

status

string

status id - Possible values are 1(Open), 2(Processing),or 3(Closed)

Headers

NameTypeDescription

apikey*

string

apikey

Authorization*

string

Bearer access-token

HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {
        "TicketList": [
            {
                "id": <ticket_id>,
                "subject": "<ticket_subject>",
                "priority": "<ticket_priority_id>",
                "category": <ticket_category_id>,
                "category_title": "<ticket_category_title>",
                "comment": "<ticket_comment>",
                "status": "<ticket_status_id>"
            }
            ...
        ]
    }
}


------------------------

priority_options = (
    ('1', 'Low'),
    ('2', 'Medium'),
    ('3', 'High'),
)
status_options = (
    ('1', 'Open'),
    ('2', 'Processing'),
    ('3', 'Closed'),
)

Sample code

Node

var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://<domain>/<api prefix>/<version>/get/ticket/history/',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access-token>',
  },
  formData: {}
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://<domain>/<api prefix>/<version>/get/ticket/history/",
  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(
    "apikey: <apikey>",
    "Authorization: Bearer <access-token>"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Error Responses

Status Code

Error Type

Field

Description

400

Validation Error

category

Catogory id is not valid numeric

400

Validation Error

status

Status id is not valid numeric

Support Ticket Tag List

GET ‎https://<domain>/<api prefix>/<version>/support/get/ticket/tags/

This API endpoint will give a list of Tags which was chosen when updating a support ticket.

Headers

NameTypeDescription

apikey*

string

Bearer access token

Authorization*

string

apikey

HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {
        "TicketTagList": [
            {
                "id": <tag_id>,
                "tag": "<tag_name>",
                "keyword": "<tag_keyword>"
            },
           ...
        ]
    }
}

Sample Code

Node

var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://<domain>/<api prefix>/<version>/get/ticket/tags/',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access-token>'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://<domain>/<api prefix>/<version>/get/ticket/tags/",
  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(
    "apikey: <apikey>",
    "Authorization: Bearer <access-token>"
  ),
));
$response = curl_exec($curl);

curl_close($curl);
echo $response;

Update Support Ticket

POST ‎https://<domain>/<api prefix>/<version>/support/update/ticket/

This API endpoint will update a support ticket.

Headers

NameTypeDescription

apikey*

string

apikey

Authorization*

string

Bearer access-token

Request Body

NameTypeDescription

ticket_id*

string

Id of ticket which wants to update

priority

string

priority id - Possible values are 1(Low), 2(Medium),or 3(High)

tags*

string

tag id - Get possible values through Support Ticket Tag List API endpoint.

​​​​​HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {}
}

Sample Code

Node

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://<domain>/<api prefix>/<version>/update/support/ticket/',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access-token>'
  },
  formData: {
    'ticket_id': '<ticket id>',
    'priority': '<priority id>',
    'tags': '<tag id>'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://<domain>/<api prefix>/<version>/update/support/ticket/",
  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('ticket_id' => '<ticket id>','priority' => '<ticket id>','tags' => '<tag id>'),
  CURLOPT_HTTPHEADER => array(
    "apikey: <apikey>",
    "Authorization: Bearer <accsess-token>",
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Error Responses

Status Code

Error Type

Field

Description

400

Invalid Input

ticket

You are not the owner of the requested ticket,

Ticket id is not valid,

Ticket id is required and this may not be blank.

400

Validation Error

priority

"\"priority\" is not a valid choice.

400

Validation Error

tags

This list may not be empty.

Incorrect type. Expected pk value, received str.

Invalid pk \"tags\" - object does not exist.

Get Ticket Detailed View

GET ‎https://<domain>/<api prefix>/<version>/support/ticket/detailed-view/

This API endpoint will provide a detailed view of support ticket.

Headers

NameTypeDescription

apikey*

string

apikey

Authorization*

string

Bearer access-token

Request Body

NameTypeDescription

ticket_id*

string

ticket id

HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {
        "ticket": {
            "id": <ticket id>,
            "subject": "<subject>",
            "priority": "<priority_id>",
            "category": <category_id>,
            "comment": "<comment>",
            "status": "<status_id>",
            "tags": [
                tag id
            ]
        },
        "author": "<author_email>",
        "conversations": [            
            {
                "id": <conversations_id>,
                "ticket": <ticket_id>,
                "comment": "<comment>",
                "author":"<conversation_author_email>"
            },
            ...
        ],
        "attachments": [
            {
                "id": <attachments id>,
                "conversation_id": <conversation id>
            },
            ...
        ]
    }
}

Sample Code

Node

var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://<domain>/<api prefix>/<version>/support/ticket/detailed-view/',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access token>',
  },
 formData: {
  'ticket_id': '<ticket id>'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "https://<domain>/<api prefix>/<version>/support/ticket/detailed-view/",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_POSTFIELDS => array('ticket_id' => '<ticket id>'),
  CURLOPT_HTTPHEADER => arra(
    "apikey: <apikey>",
    "Authorization: Bearer <access token>",
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Error Responses

Status Code

Error Type

Field

Description

400

Invalid Input

ticket

You are not the owner of the requested ticket,

Ticket id is not valid.

Ticket id is required and this may not be blank.

Get Attachment

GET ‎https://<domain>/<api prefix>/<version>/support/ticket/download/<attachment_id>/

This API endpoint will return an HTTP Response of the attachment file.

Headers

NameTypeDescription

apikey*

string

Apikey

Authorization*

string

Bearer access token

Get HTTP Response of attachment file.

Sample Code

Node

var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://<domain>/<api prefix>/<version>/support/ticket/download/<attachment_id>/',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access token>',
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/support/ticket/download/<attachment_id>/',
  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(
    'apikey: <apikey>',
    'Authorization: Bearer <access token>',
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Ticket Add Conversation

POST ‎https://<domain>/<api prefix>/<version>/support/ticket/conversation/

This API endpoint will add a conversation to support ticket.

Headers

NameTypeDescription

apikey*

string

apikey

Authorization*

string

Bearer access-token

Request Body

NameTypeDescription

ticket*

string

ticket id

comment*

string

conversation comment

attachment

string

Upload a attachment file (maximum size 2Mib).

​​​​​HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {}
}

Sample Code

Node

var request = require('request');
var fs = require('fs');
var options = {
  'method': 'POST',
  'url': 'https://<domain>/<api prefix>/<version>/support/ticket/conversation/',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access token>',
  },
  formData: {
    'ticket': '<ticket id>',
    'comment': '<comment>',
    'attachment': {
      'value': fs.createReadStream('file path'),
      'options': {
        'filename': '<filename>',
        'contentType': null
      }
    }
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://<domain>/<api prefix>/<version>/support/ticket/conversation/",
  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('ticket' => '<ticket id>','comment' => '<comment>','attachment'=> new CURLFILE('file path')),
  CURLOPT_HTTPHEADER => array(
    "apikey: <apikey>",
    "Authorization: Bearer <access token>",
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Error Responses

Status Code

Error Type

Field

Description

400

Validation Error

ticket

This field is required.

You are not the owner of the requested ticket.

Incorrect type. Expected pk value, received str.

Invalid pk \"ticket\" - object does not exist.

This field may not be null.

400

Validation Error

comment

This field is required.

This field may not be blank.

400

Validation Error

attachment

File is too big. Max filesize: 2MiB.

Change Ticket Status

POST ‎https://<domain>/<api prefix>/<version>/‎support/ticket/status/

This API endpoint will change status of support ticket.

Headers

NameTypeDescription

apikey*

string

apikey

Authorization*

string

Bearer access-token

Request Body

NameTypeDescription

ticket*

string

ticket id

status*

string

status id - Possible values are 2(to open) and 3(to close)

​​​​​HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {}
}

Sample Code

Node

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://<domain>/<api prefix>/<version>/‎support/ticket/status/',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access token>',
  },
  formData: {
    'ticket': '<ticket id>',
    'status': '<status id>'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

PHP

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://<domain>/<api prefix>/<version>/‎support/ticket/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 => array('ticket' => '<ticket id>','status' => '<status id>'),
  CURLOPT_HTTPHEADER => array(
    "apikey:<apikey>",
    "Authorization: Bearer <access token>",
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Error Responses

Status Code

Error Type

Field

Description

400

Validation Error

ticket

You Can't open or close this Ticket,

Ticket id is not valid

Ticket is already closed,

Ticket is already processing, Ticket is already open,

Ticket id is required and this may not be blank.

400

Validation Error

status

"\"status\" is not a valid choice.

Status id is required and this may not be blank.

Last updated