Help desk tickets

Use these methods to manage the ticketing system (help desk).

Third-party solutions for providing help desk services, such as SupportPal, can be integrated with B2Core to allow you to manage the tickets submitted by clients via the B2Core UI.

GET[host]/api/v2/my/tickets

Get a list of tickets

GET[host]/api/v2/my/tickets/{ticketId}

Get ticket details

GET[host]/api/v2/my/tickets/fields

Get ticket fields

POST[host]/api/v2/my/tickets

Submit a ticket

POST[host]/api/v2/my/tickets/{ticketId}/close

Close a ticket

POST[host]/api/v2/my/tickets/{ticketId}/reopen

Reopen a ticket

GET[host]/api/v2/my/tickets/{ticketId}/messages

Get a list of messages

POST[host]/api/v2/my/tickets/{ticketId}/messages

Send a message

GET[host]/api/v2/my/tickets/attachments/{attachmentId}

Download ticket attachments

Get a list of tickets

Use this method to get a list of the tickets submitted by a client to a help desk system.

To obtain detailed information about a specific ticket, use a separate method to get ticket details.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Query parameters:

The following filter parameters are available for this method:

type

The filter type. Possible values:

  • subject — to filter by ticket subject

  • message_text — to filter by ticket message

typeValue

The value used to filter a list of tickets.

The following sorting parameter is available for this method:

createTime

The date and time when a ticket was submitted by a client.

Refer to the Query parameters section of the API Overview for details on applying filter and sorting parameters.

GET[host]/api/v2/my/tickets

curl --location -g --request GET 'https://host.name/api/v2/my/tickets?limit=10&offset=0&sort_order=desc&sort_by=createTime&filter[type]=subject&filter[typeValue]=bug' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'

Response

A response contains an array of Ticket objects providing information about the tickets matching the request parameters.

Get ticket details

Use this method to get detailed information about a specified ticket.

To obtain a list of submitted tickets, use a separate method to get a tickets list.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

ticketId required

The ticket identifier.

GET[host]/api/v2/my/tickets/{ticketId}

curl --location --request GET 'https://host.name/api/v2/my/tickets/1' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'

Response

A response contains a Ticket object providing information about the specified ticket.

Get ticket fields

Use this method to get a list of the custom fields that clients must fill in to submit a ticket to a help desk system.

Request

Header parameters:

  • Authorization: Bearer <access_token>

GET[host]/api/v2/my/tickets/fields

curl --location --request GET 'https://host.name/api/v2/my/tickets/fields' \
--header 'Authorization: Bearer <token>'

Response

A response contains an array of objects providing the data about the custom fields configured in the third-party help desk system integrated with your B2Core instance, such as SupportPal.

RESPONSE EXAMPLE
{
  "name": "customFields",
  "label": "Custom fields",
  "type" :0,
  "rules": [],
  "subFields": [
    {
      "id":1,
      "priority":1,
      "name":"requestType",
      "label": {
          "value":"Request type",
          "raw":false,
          "hint":null
      },
      "type":"select",
      "rules":[],
      "initialValue":null,
      "options": [
        {
          "name":"Finance (Deposits/Withdrawals)",
          "value":1,
          "disabled":false,
          "hint":""                
        },
        {
          "name":"IB",
          "value":2,
          "disabled":false,
          "hint":""            
        },
        {
          "name":"Tech support",
          "value":3,
          "disabled":false,
          "hint":""
        },                
        {
          "name":"General questions",
          "value":4,
          "disabled":false,
          "hint":""
        }
      ]
    }
  ]
}

Submit a ticket

Use this method to submit a ticket to a help desk system.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Body:

Specify the following parameters for submitting a ticket:

text string required

The ticket text describing an issue or including a question.

subject string required

The ticket subject.

attachments array

An array of string values specifying the attachments that you want to add to a ticket.

attachments array

An array of string values specifying the attachments that you want to add to a ticket. A maximum of 10 files can be attached.

supportpalSendEmail boolean

If true, an email notification about a submitted ticket is sent to a client from SupportPal; otherwise, false.

customFields object

The objects specifying the custom fields that must be filled in for submitting a ticket.

POST[host]/api/v2/my/tickets

curl --location --request POST 'https://host.name/api/v2/my/tickets' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "text": "Ticket text",
  "subject": "Ticket subject",
  "attachments": [
    "example.png,
    "example.csv"
  ],
  "supportpalSendEmail": 0,
  "customFields": {}
}'

Response

A response contains a Ticket object providing information about the submitted ticket.

Close a ticket

Use this method to close a ticket after it was resolved.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

ticketId required

The ticket identifier.

Body:

Specify the following parameters:

comment string

The feedback comment.

status string

The client satisfaction rating. Possible values:

  • extraPositive

  • positive

  • neutral

  • negative

  • extraNegative

POST[host]/api/v2/my/tickets/{ticketId}/close

curl --location --request POST 'https://host.name/api/v2/my/tickets/1/close' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "comment": "The issue was solved really quickly",
  "status": "positive"
}'

Response

In case of success, the response body includes the following data:

uuid string

The universally unique identifier (UUID) assigned to a procedure of closing the specified ticket.

RESPONSE EXAMPLE
{
  "uuid": "36f59381-5b54-48bd-a0c7-3b908c476732"
}

Reopen a ticket

Use this method to reopen a ticket that was previously closed.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

ticketId required

The ticket identifier.

POST[host]/api/v2/my/tickets/{ticketId}/reopen

curl --location --request POST 'https://host.name/api/v2/my/tickets/1' \
--header 'Authorization: Bearer <token>'

Response

In case of success, the response body includes the following data:

uuid string

The universally unique identifier (UUID) assigned to a procedure of reopening the specified ticket.

RESPONSE EXAMPLE
{
  "uuid": "36f59381-5b54-48bd-a0c7-3b908c476732"
}

Get a list of messages

Use this method to get a list of the messages related to a specific ticket that were sent to the support chat.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

ticketId required

The ticket identifier.

Query parameters:

The following sorting parameter is available for this method:

createTime

The date and time when a message was sent to the support chat.

Refer to the Query parameters section of the API Overview for details on applying filter and sorting parameters.

GET[host]/api/v2/my/tickets/{ticketId}/messages

curl --location --request GET 'https://host.name/api/v2/my/tickets/1/messages?limit=10&offset=0&sort_order=desc&sort_by=createTime' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'

Response

A response contains the following data about each message:

id integer

The message identifier.

text string

The message text.

attachments array

An array of string values specifying the attachments added to a message.

ticketId integer

The identifier of a ticket to which a message relates.

createTime string or null

The date and time when a message was sent.

updateTime string or null

The date and time when a message was last updated.

isSentByUser boolean

If true, a message was sent by a client; otherwise, false.

RESPONSE EXAMPLE
{
  "id": 1,
  "text": "Message text",
  "attachments": [],
  "ticketId": 20,
  "createTime": "2022-01-01T00:00:00+00:00",
  "updateTime": "2022-01-01T00:00:00+00:00",
  "isSentByUser": true
}

Send a message

Use this method to send a massage to the support chat.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

ticketId required

The identifier of a ticket to which a message relates.

Body:

Specify the following parameters:

text string required

The message text.

attachments array

An array of string values specifying the attachments that you want to add to a message.

POST[host]/api/v2/my/tickets/{ticketId}/messages

curl --location --request POST 'https://host.name/api/v2/my/tickets/1/messages' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "text": "Message text",
  "attachments": [
    "example.png",
    "example.csv"
  ]
}'

Response

In case of success, the response body includes the following data:

uuid string

The universally unique identifier (UUID) assigned to a procedure of sending a message.

RESPONSE EXAMPLE
{
  "uuid": "36f59381-5b54-48bd-a0c7-3b908c476732"
}

Download ticket attachments

Use this method to download the files attached to help desk tickets.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

attachmentId required

The attachment identifier.

GET[host]/api/v2/my/tickets/attachments/{attachmentId}

curl --location --request GET 'https://host.name/api/v2/my/tickets/attachments/1' \
--header 'Authorization: Bearer <token>'

Response

A response contains a string value specifying the name of the downloaded file.