Skip to content
nsin docs

Get a ticket with its messages

GET
/tickets/{id}
curl --request GET \
--url https://api.nsin.ir/tickets/1 \
--header 'Authorization: Bearer <token>'

One of your tickets with its whole thread, oldest message first, each message with its author and attachments. Fetching a ticket marks it read for you, so the unread count drops.

id
required
integer

The ticket, including its message thread.

Media type application/json
object
id
integer
user_id
integer
subject
string
status
string
Allowed values: open closed
closed_at
string format: date-time
closed_by_user_id
integer
closed_reason

Why the ticket is closed: staff when a person closed it, auto when it closed itself after ticket_auto_close_days without a new message. Absent while open. Posting a message to an auto closed ticket reopens it; a staff close is final.

string
user_last_read_message_id

The newest message you have read; replies after it are unread.

integer
staff_last_read_message_id

The newest message support has read.

integer
messages

The thread. Populated when fetching a single ticket.

Array<object>
object
id
integer
ticket_id
integer
author_user_id
integer
author

The message author.

object
key
additional properties
any
body
string
is_staff

True when written by support staff.

boolean
attachments
Array<object>
object
id
integer
message_id
integer
original_name
string
content_type
string
size_bytes
integer
url

Where to download the attachment.

string
created_at
string format: date-time
edited_at

When the message was last edited. Absent on a message that has never been edited — render the “edited” marker off this field, not off updated_at.

string format: date-time
edited_by_user_id

Who made the last edit. Absent on a message that has never been edited.

integer
edit_count

How many times the message has been edited. 0 for an untouched message.

integer
created_at
string format: date-time
updated_at
string format: date-time
Example
{
"status": "open"
}

Invalid id.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Example
{
"error": "read-only API key"
}

Missing, malformed, revoked or expired API key. (A valid key whose account has been deactivated gets 403 account is inactive instead.)

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example invalidKey
{
"error": "invalid API key"
}

No such ticket on this account.

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Example
{
"error": "read-only API key"
}

The key exceeded its request budget (300 requests per minute by default).

Media type application/json

The single error shape used by every endpoint.

object
error
required

Human-readable description of what went wrong.

string
Examples
Example limited
{
"error": "rate limit exceeded"
}