Skip to main content

Ticket

Fetch all data related to ImBox Ticket

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

NameTypeDescription
apiKey*StringYour API key
userId*StringYour userId
limitIntegerNumber of tickets to return
updatedAfterStringFormat: YYYY-MM-DD
updatedBeforeStringFormat: YYYY-MM-DD
latestUpdatedAfterStringFormat: YYYY-MM-DD
latestUpdatedBeforeStringFormat: YYYY-MM-DD
fromEmailStringEmail adress
statusStringOne of: ”new” OR ”reply” OR ”pending” OR ”solved” OR ”closed”
fileTypeStringResponse type: ”csv” OR ”json”
cursorIdNumberCursor for next result set
cursorUpdatedNumberCursor for next result set

Usage

curl -X GET "https://apiv2.imbox.io/message/listTickets/apiKey/userId?updatedAfter=2020-01-01&limit=2"

Example

{
"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"
}

grabTicket

Get a ticket.

Parameters

NameTypeDescription
apiKey*StringYour API key
userId*StringYour userId
ticketIdStringRequested ticket id

Usage

curl -X GET "https://apiv2.imbox.io/message/grabTicket/apiKey/userId/ticketId"

Example

{
"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&gt", // 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"
}
]
}
}

insertTicket

Create a ticket.

Parameters

NameTypeDescription
apiKey*StringYour API key
userId*StringYour userId

Body

NameTypeDescription
fromEmail*StringEx. "john.doe@example.org"
fromNameStringEx. "John"
toEmail*StringEmail connected to your ImBox account. "info@your-company.com"
subject*StringTicket subject
message*StringTicket content
appendOpenTicketBooleanAppend to already open ticket from same sender? Default: true
ticketIdStringAppend message to a specific ticket (ticket cannot be deleted)
messageTypeStringAdd "internal" to create a new ticket with a private note as first message. Or create a message to existing ticket. Default: "external"
statusStringOne of: "new" OR "reply" OR "pending" OR "solved" OR "closed"
autoReplyBooleanSend auto reply to "fromEmail" (if auto replies are activated on your ticket mailbox). Default: true
labelsArray<String>Adding label names on Ticket. Ex. "Support"
attachmentsArray<String>Adding uploaded files to ticket. Total file size limit of 50 MB. Ex: ["https://yourfile.com", "https://yourfile2.com"]

Usage

curl -X POST -H "Content-Type: application/json" -d @ticket.json "https://apiv2.imbox.io/message/insertTicket/<apiKey>/<userId"

ticket.json

{
"fromEmail": "john.doe@example.com",
"toEmail": "info@your-company.se",
"subject": "My subject",
"message": "My message"
}

Response

{
"result": "success",
"json": {
"ticketID": 1234
}
}

listTicketsEmails

Lists all email addresses for sent and received mails within a timespan. If more than limit emails exist, the next result set can be fetched using the href in ”next”.

Parameters

NameTypeDescription
apiKey*StringYour API key
userId*StringYour userId
limitIntegerNumber of emails to return
startTime*StringFormat: YYYY-MM-DD
endTime*StringFormat: YYYY-MM-DD
timezoneString”Europe/Stockholm” – Default: Europe/Stockholm
fileTypeString”csv” OR ”json” Default: ”json”
cursorIdIntegerCursor for next result set
cursorCreatedIntegerCursor for next result set

Usage

curl -X GET "https://apiv2.imbox.io/message/listTicketsEmails/apiKey/userId?startTime=2020-01-01&endTime=2020-01-02&limit=2"

Example

{
"result": "success",
"json": [
{
"createdDate": "2020-01-01T00:00:00.000Z",
"inboxName": "Company Support",
"from": { "address": "agent@example.org", "name": "agent" },
"ticketID": 1,
"to": [{ "address": "customer@example.org" }],
"cc": [],
"bcc": []
},
{
"createdDate": "2020-01-01T00:00:00.000Z",
"inboxName": "Company Support",
"from": { "address": "agent2@example.org", "name": "Agent 2" },
"ticketID": 2,
"to": [{ "address": "another-customer@example.org" }],
"cc": [{ "address": "ccd@example.org" }],
"bcc": []
}
],
"next": "https://apiv2.imbox.io/message/listTicketsEmails/apiKey/userId?startTime=2020-01-01&endTime=2020-01-02&limit=2&cursorId=1234&cursorCreated=1577836800000",
"length": 2
}