Guest API: Tickets
The user’s support tickets, and writing on one.
| What it does | Route |
|---|---|
| List the ticket forms | GET /guest/v1/ticket-forms |
| List the user’s tickets | GET /guest/v1/tickets |
| Open a ticket | POST /guest/v1/tickets |
| Read a ticket | GET /guest/v1/tickets/{ticket_id} |
| Write on a ticket | POST /guest/v1/tickets/{ticket_id}/messages |
List the ticket forms
Section titled “List the ticket forms”GET /guest/v1/ticket-forms
The kinds of ticket your team lets users open themselves, with the fields each asks for.
Needs: the app key (X-CRM-App-Key) and the signed-in user’s token (Authorization: Bearer …), or their id for an app with unverified sign-in. See From a website or web app.
Answers
| Status | Body | Meaning |
|---|---|---|
| 200 | TicketForms | OK |
| 400 | problem | The request could not be read: the problem names the field. |
| 401 | problem | No credential, or one that is not right. |
| 403 | problem | Refused: the app is switched off, or this is not allowed. |
| 404 | problem | Not found, or the part is switched off. |
| 429 | problem | Too many requests: wait for Retry-After. |
List the user’s tickets
Section titled “List the user’s tickets”GET /guest/v1/tickets
Needs: the app key (X-CRM-App-Key) and the signed-in user’s token (Authorization: Bearer …), or their id for an app with unverified sign-in. See From a website or web app.
Answers
| Status | Body | Meaning |
|---|---|---|
| 200 | SupportTicketPage | OK |
| 400 | problem | The request could not be read: the problem names the field. |
| 401 | problem | No credential, or one that is not right. |
| 403 | problem | Refused: the app is switched off, or this is not allowed. |
| 404 | problem | Not found, or the part is switched off. |
| 429 | problem | Too many requests: wait for Retry-After. |
Open a ticket
Section titled “Open a ticket”POST /guest/v1/tickets
Opens a ticket from one of the ticket forms, with what the user wrote as its first message. A user may open ten an hour.
Needs: the app key (X-CRM-App-Key) and the signed-in user’s token (Authorization: Bearer …), or their id for an app with unverified sign-in. See From a website or web app.
Parameters
| Name | In | Description |
|---|---|---|
Idempotency-Key | header | Your own id for this send (at most 200 bytes): sent again after a timeout, it is kept once. |
Body (application/json): NewTicketBody
| Field | Type | Description |
|---|---|---|
fields | array of TicketField | |
text | string | |
title (always) | string | |
type_id (always) | string |
Answers
| Status | Body | Meaning |
|---|---|---|
| 201 | SupportTicket | Made |
| 400 | problem | The request could not be read: the problem names the field. |
| 401 | problem | No credential, or one that is not right. |
| 403 | problem | Refused: the app is switched off, or this is not allowed. |
| 404 | problem | Not found, or the part is switched off. |
| 429 | problem | Too many requests: wait for Retry-After. |
Read a ticket
Section titled “Read a ticket”GET /guest/v1/tickets/{ticket_id}
The ticket, where it has got to, and its conversation.
Needs: the app key (X-CRM-App-Key) and the signed-in user’s token (Authorization: Bearer …), or their id for an app with unverified sign-in. See From a website or web app.
Parameters
| Name | In | Description |
|---|---|---|
ticket_id (required) | path | The ticket’s id. |
Answers
| Status | Body | Meaning |
|---|---|---|
| 200 | SupportTicket | OK |
| 400 | problem | The request could not be read: the problem names the field. |
| 401 | problem | No credential, or one that is not right. |
| 403 | problem | Refused: the app is switched off, or this is not allowed. |
| 404 | problem | Not found, or the part is switched off. |
| 429 | problem | Too many requests: wait for Retry-After. |
Write on a ticket
Section titled “Write on a ticket”POST /guest/v1/tickets/{ticket_id}/messages
Needs: the app key (X-CRM-App-Key) and the signed-in user’s token (Authorization: Bearer …), or their id for an app with unverified sign-in. See From a website or web app.
Parameters
| Name | In | Description |
|---|---|---|
ticket_id (required) | path | The ticket’s id. |
Idempotency-Key | header | Your own id for this send (at most 200 bytes): sent again after a timeout, it is kept once. |
Body (application/json): MessageBody
| Field | Type | Description |
|---|---|---|
attachment_ids | array of string | Pictures uploaded through an AttachmentUpload and not yet sent. |
text (always) | string |
Answers
| Status | Body | Meaning |
|---|---|---|
| 201 | Part | Made |
| 400 | problem | The request could not be read: the problem names the field. |
| 401 | problem | No credential, or one that is not right. |
| 403 | problem | Refused: the app is switched off, or this is not allowed. |
| 404 | problem | Not found, or the part is switched off. |
| 409 | problem | Refused as things stand: the problem says why. |
| 422 | problem | A value that is not right: the problem says which. |
| 429 | problem | Too many requests: wait for Retry-After. |