Documentation forAdministrator
Support

Ticket API

moduleAPI Documentation Updated 17 Oct 2026

Ticket API

Product: NEXTMEGABYTE (Greenitco ITAM) · Module: API Documentation · Audience: Developer, Administrator

This page lists the NEXTMEGABYTE REST API endpoints for tickets. All URLs are relative to your portal, for example https://your-domain.com/api/.... Authenticate first with the Login API and send the standard headers described in the API Overview. Example values are shortened and anonymized.

List tickets

POST /api/v2/tickets/ajax-lists

Returns a paged list of tickets with status, priority, category, assignee and TAT details.

Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.

Top-level response fields: total, filtered, current_index, is_prev_index, is_next_index, data, profile_imgs

Example response (values shortened and anonymized)

{
  "total": 2317,
  "filtered": 2317,
  "current_index": 0,
  "is_prev_index": 0,
  "is_next_index": 1,
  "data": [
    {
      "id": 8289,
      "subject": "<string>",
      "starred": null,
      "status": "Open",
      "status_id": 1,
      "created_by": null,
      "creator_id": 251,
      "prob_cat": "<string>",
      "priority": "Critical",
      "priority_id": 1,
      "tat": 2,
      "tat_expire": "2024-08-12 12:00:00",
      "feedback": null,
      "dep_name": "<string>",
      "comp_name": "<string>",
      "asset_tag": null,
      "device_id": null,
      "spam": null,
      "create_comp_name": "<string>",
      "job_type": 1,
      "...": "29 more fields"
    }
  ],
  "profile_imgs": {
    "251": "https://your-domain.com/...",
    "1": "https://your-domain.com/...",
    "221": "https://your-domain.com/...",
    "372": "https://your-domain.com/...",
    "252": "https://your-domain.com/...",
    "244": "https://your-domain.com/...",
    "457": "https://your-domain.com/..."
  }
}

Get ticket details

POST /api/v2/ticket/get_timeline

Returns the full details and timeline of one ticket, including custom fields and feedback.

Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.

Request Body Parameters

Parameter Type Required Description
id String Yes Ticket ID

Top-level response fields: status, msg, data, tkt_data, tat_halt, custom_field, Custom_field_date, Custom_field_data, department_custom_field_value

Example response (values shortened and anonymized)

{
  "status": "success",
  "msg": "",
  "data": [],
  "tkt_data": [
    {
      "id": 8413,
      "subject": "<string>",
      "content": "<string>",
      "status": "Open",
      "status_id": 1,
      "creator_id": 363,
      "priority": "High",
      "priority_id": 2,
      "tat": 7,
      "dep_name": "<string>",
      "dep_id": 77,
      "comp_name": "<string>",
      "feedback": null,
      "asset_tag": null,
      "device_id": null,
      "starred": null,
      "spam": null,
      "job_type": 0,
      "ex_user_company": null,
      "created_via": 4,
      "...": "46 more fields"
    }
  ],
  "tat_halt": 0,
  "custom_field": [],
  "Custom_field_date": [],
  "Custom_field_data": [],
  "department_custom_field_value": [
    {
      "Start Date": "<string>"
    }
  ]
}

Update ticket status

POST /api/v2/ticket/update_status

Changes the status, priority and TAT of a ticket and adds a comment.

Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.

Request Body Parameters

Parameter Type Required Description
id int Yes Ticket ID
status_id String Yes Status ID
priority_id String Yes Priority ID
tat String Yes TAT
comment String Yes Comments
tmp_id String Yes Random ID

Example response (shortened)

{status: success, msg: Ticket status has been updated successfully}

Transfer a ticket

POST /api/v2/ticket/transfer

Moves a ticket to another department, category and assignee.

Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.

Request Body Parameters

Parameter Type Required Description
id int Yes Ticket ID
department_id String Yes Department ID
problem_category_id String Yes Problem Category ID
sub_category_id String Yes Sub Problem Category ID
assigned_to String Yes Assign to user ID
priority_id String Yes Priority ID
device_id String No Device ID

Example response (shortened)

{status: success, msg: Ticket has been transferred successfully}

Assign a ticket

POST /api/v2/ticket/assign_to

Assigns a ticket to a technician.

Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.

Request Body Parameters

Parameter Type Required Description
id int Yes Ticket ID
assigned_to String Yes Assign to user ID

Example response (shortened)

{status: success, msg: Ticket assigned successfully}

Self-assign a ticket

POST /api/v2/ticket/self_assign

Assigns a ticket to the signed-in technician.

Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.

Request Body Parameters

Parameter Type Required Description
id int Yes Ticket ID

Example response (shortened)

{status: success, msg: Ticket assigned to you successfully}

Edit a ticket

POST /api/ticket/edit

Updates ticket fields such as category, priority, TAT, assignee and device.

Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.

Request Body Parameters

Parameter Type Required Description
id int Yes Ticket ID
department_id String Yes Department ID
problem_category_id String Yes Problem Category ID
sub_category_id String Yes Sub Problem Category ID
assigned_to String Yes Assign to user ID
priority_id String Yes Priority ID
device_id String No Device ID

Example response (values shortened and anonymized)

{
  "status": "success",
  "msg": "Ticket is edited successfully"
}

Change ticket creator

POST /api/v2/ticket/change_creator

Changes the user recorded as the creator of a ticket.

Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.

Request Body Parameters

Parameter Type Required Description
id String Yes Ticket ID
creator_id String Yes Assign to user ID

Example response (values shortened and anonymized)

{
  "status": "success",
  "msg": "Ticket Creator has changed successfully"
}

Create a ticket

  • POST /api/tickets/create (for Admin or Technician)
  • POST /api/tickets/create-by-user (for Normal User)

Creates a new ticket. Use /api/tickets/create for administrators and technicians and /api/tickets/create-by-user for normal users.

Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.

Request Body Parameters

Parameter Type Required Description
id int Yes Ticket ID
department_id String Yes Department ID
problem_category_id String Yes Problem Category ID
sub_category_id String Yes Sub Problem Category ID
creator_id String Yes Assign to user ID
priority_id String Yes Priority ID
tat Map No TAT hours
subject String Yes Subject of Ticket
content String Yes Description of Ticket
device_id String No Device ID
tags List No Tags of Ticket

Example response (values shortened and anonymized)

{
  "status": "success",
  "msg": "New Ticket (ID) has been created successfully."
}

Generate a ticket ID

POST /api/v2/tickets/init

Initializes a new ticket and returns a temporary ID used for attachments before the ticket is created.

Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.

Example response (shortened)

{status: success, msg: Ticket ID generated successfully, id: {ID}}

Get ticket configuration

POST /api/v2/ticket/config

Returns ticket configuration such as statuses, priorities and handler permissions.

Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.

Example response (shortened)

{action_controls: {user_permission: {create_for_others: 1, merge_privilege: 1, ctrl_transfer: 1, ctrl_assign: 1, ctrl_delete: 1, ctrl_self_assign: 1, ctrl_change_creator: 1}, field: {eu_hide_priority: 1, eu_hide_assigned_to: 1, eu_hide_expire_at: 1, eu_hide_tat: 1}}}

Get ticket type fields

POST /api/tickets/fields-by-ticket/{id}

Returns the custom fields of a ticket's ticket type.

Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.

Example response (shortened)

[{End Date: }, {Xenos Bender: }, {Test_field: }, {Company Name: }, {branch: }, {Ticket: }, {Approved By: }, {Requirement: }]

Remove a ticket attachment

POST /api/v2/ticket/attachment/remove

Deletes an attachment from a ticket.

Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.

Request Body Parameters

Parameter Type Required Description
id String Yes Ticket ID

Example response (shortened)

{status: success, msg: Attachment removed}

Get ticket filter options

GET /api/v2/service-tickets/filter-options

Returns the values available for ticket filters, such as statuses, priorities, departments and categories.

Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.

Top-level response fields: status, msg, statuses, priorities, ticket_handlers, ticket_creators, filter_by_dates_opts, creatorLogger, locations, createdVia, ticketOrSR, ticketVip, ticketFeedback, ticketTag

Example response (values shortened and anonymized)

{
  "status": "success",
  "msg": "",
  "statuses": [
    {
      "id": 1,
      "name": "Open"
    },
    "..."
  ],
  "priorities": [
    {
      "id": 1,
      "name": "Critical",
      "service_time": "<string>"
    },
    "..."
  ],
  "ticket_handlers": [
    {
      "id": 1,
      "full_name": "<string>"
    },
    "..."
  ],
  "ticket_creators": [
    {
      "id": 1,
      "full_name": "<string>"
    },
    "..."
  ],
  "filter_by_dates_opts": [
    {
      "id": 1,
      "text": "<string>"
    },
    "..."
  ],
  "creatorLogger": [
    {
      "id": 1,
      "text": "<string>"
    },
    "..."
  ],
  "locations": [
    {
      "id": 1,
      "name": "Turin"
    },
    "..."
  ],
  "createdVia": [
    {
      "id": 1,
      "text": "<string>"
    },
    "..."
  ],
  "ticketOrSR": [
    {
      "id": 1,
      "text": "<string>"
    },
    "..."
  ],
  "ticketVip": [
    {
      "id": 1,
      "text": "<string>"
    },
    "..."
  ],
  "ticketFeedback": [
    {
      "id": 1,
      "text": "<string>"
    },
    "..."
  ],
  "ticketTag": [
    {
      "id": 1,
      "tags": "<string>"
    },
    "..."
  ]
}

List ticket types

GET /api/tickets/ticket-types

Returns the active ticket types.

Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.

Example response (values shortened and anonymized)

{
  "status": "success",
  "msg": "Data fetched successfully",
  "data": [
    {
      "id": 1,
      "name": "Bug",
      "status": 1,
      "created_at": "2022-12-28T07:19:05.000000Z",
      "updated_at": "2024-08-28T10:33:27.000000Z",
      "department_id": null,
      "created_by": null,
      "updated_by": null
    },
    "..."
  ]
}

Star or unstar a ticket

POST /api/v2/ticket/staring

Marks a ticket as starred (important) or removes the star.

Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.

Request Body Parameters

Parameter Type Required Description
id String Yes Ticket ID

Example response (values shortened and anonymized)

{
  "status": "success",
  "msg": "Star added successfully.",
  "star": true
}

Get tags

POST /api/ticket/getTagDetails

Returns the tags that can be added to tickets or knowledge articles.

Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.

Top-level response fields: status, msg, tot, data

Example response (values shortened and anonymized)

{
  "status": "success",
  "msg": "Tags fetched successfully",
  "tot": 48,
  "data": [
    {
      "id": 1,
      "text": "<string>"
    },
    "..."
  ]
}

List departments for a company

POST /api/v2/departments/by-company/privilage/{company_id}

Returns the departments of a company that the user is allowed to create tickets for.

Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.

Example response (values shortened and anonymized)

{
  "status": "success",
  "msg": "success",
  "results": [
    {
      "id": 1,
      "text": "<string>"
    },
    "..."
  ]
}

Mark a ticket as spam

POST /api/v2/ticket/spam

Marks a ticket as spam or not spam.

Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.

Request Body Parameters

Parameter Type Required Description
id String Yes Ticket ID
is_spam String Yes true/false

Example response (values shortened and anonymized)

{
  "status": "success",
  "msg": "Added to Spam list"
}