Tickets
Fetch all data related to ImBox Ticket.
Important Notes
When using insertTicket you will bypass mail flow. This means for example any automatic labeling usually done by mail flow will not work on these tickets.
listTickets
Get tickets within a given timespan. If more than limit tickets exist, the next result set can be fetched using the href in ”next”.
Parameters
Name | Type | Description |
---|---|---|
apiKey* | String | Your API key |
userId* | String | Your userId |
limit | Integer | Number of tickets to return |
updatedAfter | String | Format: YYYY-MM-DD |
updatedBefore | String | Format: YYYY-MM-DD |
latestUpdatedAfter | String | Format: YYYY-MM-DD |
latestUpdatedBefore | String | Format: YYYY-MM-DD |
fromEmail | String | Email adress |
status | String | One of: ”new” OR ”reply” OR ”pending” OR ”solved” OR ”closed” OR ”on-hold” |
fileType | String | Response type: ”csv” OR ”json” |
cursorId | Number | Cursor for next result set |
cursorUpdated | Number | Cursor for next result set |
Usage
curl -X GET "https://apiv2.imbox.io/message/listTickets/apiKey/userId?updatedAfter=2020-01-01&limit=2"
Response
{
"result": "success",
"json": [
{
"sid": 1,
"inboxName": "Support",
"ticketID": 1,
"status": "pending",
"subject": "Re: Booking",
"fromEmail": "john.doe@example.org",
"labels": ["label1", "label2"],
"createdDate": "2020-01-01T00:00:00.000Z",
"updatedDate": "2020-01-01T00:00:00.000Z",
"latestUpdated": "2020-01-01T00:00:00.000Z"
},
{
"sid": 1,
"inboxName": "Info",
"ticketID": 2,
"status": "new",
"subject": "My booking",
"fromEmail": "john.doe@example.org",
"labels": [],
"createdDate": "2020-01-01T00:00:00.000Z",
"updatedDate": "2020-01-01T00:00:00.000Z",
"latestUpdated": "2020-01-01T00:00:00.000Z"
}
],
"length": 2,
"next": "https://apiv2.imbox.io/message/listTickets/apiKey/userId?updatedAfter=2020-01-01&limit=2&cursorId=2&cursorUpdated=1686819359320"
}
API key scope access
Scope | Access |
---|---|
Tickets | Read |
grabTicket
Get a ticket.
Parameters
Name | Type | Description |
---|---|---|
apiKey* | String | Your API key |
userId* | String | Your userId |
ticketId | String | Requested ticket id |
Usage
curl -X GET "https://apiv2.imbox.io/message/grabTicket/apiKey/userId/ticketId"
Response
{
"result": "success",
"json": [
{
"sid": 1,
"ticketID": "1",
"from": "john.doe@example.org",
"fromName": "John",
"agentID": 1, // Null if not sent by agent
"messageType": "external", // External / Internal / Log
"messagePlain": "Hello", // Plain text content
"messageHtml": "<p>Hello</p>", // Raw HTML content
"date": "2020-01-01T00:00:00.000Z" // Sent time
}
],
"length": 1,
"meta": {
"tags": [{ "tag": "tag name" }],
"labels": [{ "label": "label name" }],
"linkedTickets": [{ "ticketId": 123 }],
"ticketStatus": "pending",
"assignedAgents": [
{
"id": 7878,
"agentName": "Agent1 Name",
"agentEmail": "agent1@company.com"
},
{
"id": 7979,
"agentName": "Agent2 Name",
"agentEmail": "agent2@company.com"
}
]
}
}
API key scope access
Scope | Access |
---|---|
Tickets | Read |
insertTicket
Create a ticket.
Parameters
Name | Type | Description |
---|---|---|
apiKey* | String | Your API key |
userId* | String | Your userId |
Body
Name | Type | Description |
---|---|---|
fromEmail* | String | Ex. "john.doe@example.org" |
fromName | String | Ex. "John" |
toEmail* | String | Email connected to your ImBox account. "info@your-company.com" |
subject* | String | Ticket subject |
message* | String | Ticket content |
appendOpenTicket | Boolean | Append to already open ticket from same sender? Default: true |
ticketId | String | Append message to a specific ticket (ticket cannot be deleted) |
messageType | String | Add "internal" to create a new ticket with a private note as first message. Or create a message to existing ticket. Default: "external" |
status | String | One of: "new" OR "reply" OR "pending" OR "solved" OR "closed" OR "on-hold" |
autoReply | Boolean | Send auto reply to "fromEmail" (if auto replies are activated on your ticket mailbox). Default: true |
labels | Array<String> | Adding label names on Ticket. Ex. "Support" |
attachments | Array<String> | Adding uploaded files to ticket. Total file size limit of 50 MB. Ex: ["https://yourfile.com", "https://yourfile2.com"] |