Tickets API
54 min
Criado por Knowledge Engineering Team em 01/12/2020 19:38
Atualizado por Knowledge Engineering Team em 08/12/2020 05:51

On this page

Tickets API concepts and usage

Object properties

Retrieve a ticket

Retrieve multiple tickets

Create a ticket

Update a ticket

Adding a file attachment

Watchpoints

 

 

Tickets API concepts and usage

This API can be used to retrieve, create, and update tickets. You can use the API to perform most of the same functions that can be accomplished by agents in the ticket form.

If looking to import tickets into Movidesk, tools such as Postman can be used to create or update tickets in bulk via the API.

You can also use the API to integrate Movidesk to third party systems when a standard integration is not available for that system.

API Base URL

All API endpoint URLs in this article use the following base URL:

https://api.movidesk.com/public/v1

 

Object properties

The Tickets API interacts with a large number of objects, all of which link back to a specific ticket. These objects range from parent tickets of a ticket, to the agent that created a specific time log.

All of these objects and their properties can be retrieved by this API, but not all of them can be updated through the API.

For example, contact information for the ticket Requester can be retrieved—but not updated—using the Tickets API. Instead you should use the People API to make updates to records in the People master file.

Clipboard

Note We apologize for the typos and inconsistent naming on a few objects and properties (there is quite a bit of history behind this!). We are working to fix these along with developing some new and improved APIs. We are also looking to minimize any impact to users of the current API versions.

 

Objects

Ticket

Person

Requester

Ticket note

Time log

Team

Expense

Attachment

Related ticket

Past assigned agent

Past status

Custom field

Custom field item

Asset

 

Ticket

The primary object for this API. The Ticket object is the root for all JSON paths to other objects.

JSON Paths

ticket

Property

Type

Max length

Required?

Description

id

String

 

 

Ticket ID. If using a custom numbering scheme for tickets, see the Watchpoints section for more information about this property.

Read-only.

type

Int

1

Yes

Ticket type: 1=Internal, 2=Public

subject

String

350

 

Ticket subject.

category

String

128

 

Name of the ticket category.

Must be an existing category configured in Configurations > Categories.

The category must be valid for the ticket type, and for the ticket service (if service is not blank).

urgency

String

128

 

Name of the ticket priority.

Must be an existing priority configured in Configurations > Priorities.

The priority must be an allowed priority for the ticket category (if category is not blank).

status

String

128

 

Name of the ticket status.

Must be an existing status configured in Configurations > Statuses.

The status must be valid for the ticket type.

If left blank, the first status with a Base status of New will be assigned to the ticket.

baseStatus

String

128

 

Base status of the ticket status. Read-only.

Returns the following values for each Base status:
New = New
InAttendance = In progress
Stopped = On hold
Canceled = Canceled
Resolved = Resolved
Closed = Closed

justification

String

128

Yes*

Name of the Reason for the ticket status.

Must be an existing Reason configured in Configurations > Reasons.

The Reason must be an allowed Reason for the ticket status.

Only required if the ticket status is configured to require a Reason.

origin

Int

2

 

Ticket creation channel. Read-only.

1 = Customer (in-system)
2 = Agent (in-system)
3 = Imported email
4 = System trigger
5 = Live chat
6 = Offline chat message
7 = System email
8 = Ticket web form
9 = Tickets API
10 = Recurring schedule
11 = Jira issue
12 = Redmine issue
13 = Answered call
14 = Outbound call
15 = Missed call
16 = Abandoned call
17 = Remote access [DEPRECATED]
18 = WhatsApp
19 = Integrated Movidesk instance

createdDate

UTC datetime

 

 

Date ticket was created. If left blank, the current date and time will be used.

Read-only after the ticket has been created.

originEmailAccount

String

128

 

Support email account that received the email which created the ticket. Read-only.

owner

Person

 

 

Assigned agent.

ownerTeam

String

128

Yes*

Name of the assigned agent’s team, or name of the assigned team.

Must be an existing team configured in Configurations > Teams.

Only required when owner is not blank, in which case it must be a team listed in the assigned agent’s user record.

createdBy

Person

 

Yes

Ticket creator. Read-only after the ticket has been created.

serviceFull

Array

1024

 

Names of each service in the Service catalog tree until reaching the ticket’s service. Read-only.

The array starts with the root service (serviceFirstLevel) and ends with the actual service on the ticket (serviceFirstLevelId).

serviceFirstLevelId

Int

 

 

ID of the exact service selected on the ticket.

serviceFirstLevel

String

1024

 

Name of the root service in the Service catalog from the service selected on the ticket (serviceFirstLevelId). Read-only.

serviceSecondLevel

String

1024

 

Name of the second level service in the Service catalog from the service selected on the ticket (serviceFirstLevelId). Read-only.

Second level services are those that have a single service above them in the Service catalog.

serviceThirdLevel

String

1024

 

Name of the third level service in the Service catalog from the service selected on the ticket (serviceFirstLevelId). Read-only.

Third level services are those that have two services above them in the Service catalog.

contactForm

String

128

 

Name of the ticket web form that created the ticket. Read-only.

tags

Array

 

 

List of tags added to the ticket.

If a nonexistent tag is added to the array, a new record will be created in the Tags master file.

cc

String

1024

 

Comma delimited list of email addresses in the Ticket’s CC.

resolvedIn

UTC datetime

 

 

Date ticket was resolved.

reopenedIn

UTC datetime

 

 

Date ticket was reopened. Read-only.

closedIn

UTC datetime

 

 

Date ticket was closed.

lastActionDate

UTC datetime

 

 

Date when the last ticket note was added. Read-only.

actionCount

Int

 

 

Number of ticket notes on the ticket. Read-only.

Includes both internal and public notes.

lastUpdate

UTC datetime

 

 

Date when the ticket was last updated. Read-only.

lifetimeWorkingTime

Int

 

 

Total business hours since the ticket was created.

Returns a numeric value in minutes. Read-only.

stoppedTime

Int

 

 

Total calendar hours since the ticket status was changed to Base status of On hold.

Returns a numeric value in minutes. Read-only.

stoppedTimeWorkingTime

Int

 

 

Total business hours since the ticket status was changed to Base status of On hold.

Returns a numeric value in minutes. Read-only.

resolvedInFirstCall

Boolean

 

 

First contact resolution (FCR) status.

Returns true if the ticket was resolved on the first contact, and false if not. Read-only.

chatWidget

String

128

 

Name of the chat widget used to create the ticket. Read-only.

chatGroup

String

128

 

Name of the chat group in the chat session that created the ticket. Read-only.

chatTalkTime

Int

 

 

Duration of the chat conversation.

Returns a numeric value in seconds. Read-only.

chatWaitingTime

Int

 

 

Wait time in queue for the chat session.

Returns a numeric value in seconds. Read-only.

sequence

Int

 

 

Number entered in the Sequence box on the ticket form.

slaAgreement

String

128

 

Name of the SLA policy applied to the ticket. Read-only.

slaAgreementRule

String

128

 

Name of the specific SLA rule applied to the ticket. Read-only.

slaSolutionTime

Int

 

 

SLA resolution time.

Returns a numeric value in minutes. Read-only.

If there are no SLA policies applied to this ticket, this property will be blank.

slaResponseTime

Int

 

 

SLA first-response time.

Returns a numeric value in minutes. Read-only.

If there are no SLA policies applied to this ticket, this property will be blank.

slaSolutionChangedByUser

Boolean

 

 

Returns true if the current ticket resolution due date was set manually, and false if it was calculated by the system. Read-only.

slaSolutionChangedBy

Person

 

 

User that manually set the resolution due date on the ticket. Read-only.

slaSolutionDate

UTC datetime

 

 

Ticket resolution due date.

If the resolution due date is updated via the API, it will be considered as having been set manually by the agent who added the last ticket note.

slaSolutionDateIsPaused

Boolean

 

 

Returns true if the SLA time for ticket resolution is paused, and false if it is not paused. Read-only.

slaResponseDate

UTC datetime

 

 

Ticket first-response due date. Read-only.

slaRealResponseDate

UTC datetime

 

 

Actual first-response date. Read-only.

jiraIssueKey

String

64

 

Issue key for the Jira issue linked to the ticket. Read-only.

redmineIssueId

Int

 

 

Issue ID for the Redmine issue linked to the ticket. Read-only.

clients

Requester array

 

Yes

Array of requesters on the ticket.

actions

Ticket note array

 

Yes

Array of ticket notes on the ticket.

parentTickets

Related ticket array

 

 

Array of parent tickets of the ticket.

childrenTickets

Related ticket array

 

 

Array of child tickets of the ticket.

ownerHistories

Past assigned agent array

 

 

Array of all past assigned agents of the ticket. Read-only.

Returns the past values of Assigned agent on the ticket in chronological order, starting with the first assigned agent or team.

statusHistories

Past status array

 

 

Array of all past statuses of the ticket. Read-only.

Returns the past values of Status on the ticket in chronological order, starting with the first status assigned to the ticket.

customFieldValues

Custom field array

 

 

Array of all custom fields on the ticket, and their values.

Will not return custom fields with blank values.

assets

Asset array

 

 

Array of all assets linked to the ticket.

 

Person

Object containing information about a record in the People master file, which can be either a user, or an organization.

All properties on this object are read-only. You can use the People API to update records in the People master file.

Clipboard

Note To update certain properties on the Ticket object, such as owner, you must change the id property of the Person object. This will not modify the record in the People master file—instead it will swap the previous People record with the record corresponding to the new id value.

 

JSON Paths

ticket.clients.organization
ticket.actions.createdBy
ticket.actions.timeAppointments.createdBy
ticket.owner
ticket.createdBy
ticket.slaSolutionChangedBy

Property

Type

Max length

Required?

Description

id

String

64

 

Reference code of the person. Read-only.

personType

Int

1

 

Person type: 1=User, 2=Company, 4=Department. Read-only.

profileType

Int

1

 

Profile type: 1=Agent, 2=Customer, 3=Agent and Customer. Read-only.

businessName

String

128

 

Name of the user, or Trade name (DBA) of the organization. Read-only.

email

String

128

 

Main email address of the person. Read-only.

phone

String

128

 

Main phone number of the person. Read-only.

 

Requester

Very similar to the Person object, but includes a few additional properties.

One property identifies the requester’s organization, and one flags whether the ticket requester has been deleted.

The object also includes three properties for the requester’s address.

Clipboard

Note There are a few other address properties which are omitted from the table below, as they are only applicable for localized use of the system in Latin America:

  • cep
  • city
  • bairro
  • number

 

JSON Paths

ticket.clients

Property

Type

Max length

Required?

Description

id

String

 

Yes

Reference code of the person. Read-only.

personType

Int

 

 

Person type: 1=User, 2=Company, 4=Department. Read-only.

profileType

Int

 

 

Profile type: 1=Agent, 2=Customer, 3=Agent and Customer. Read-only.

businessName

String

 

 

Name of the user, or Trade name (DBA) of the organization. Read-only.

email

String

 

 

Main email address of the person. Read-only.

phone

String

 

 

Main phone number of the person. Read-only.

isDeleted

Boolean

 

 

Returns true if the ticket requester was deleted from the People master file, and false if not. Read-only.

organization

Person

 

 

Organization of the ticket requester.

Note that if the ticket requester is an organization itself, it may still be associated with a parent organization in Organization.

address

String

 

 

Address line 1 of the person’s main address.

complement

String

 

 

Address line 2 of the person’s main address.

reference

String

 

 

Address line 3 of the person’s main address.

 

Ticket note

Object containing information about a single note on the ticket.

To update an existing ticket note, specify the id for that note in the JSON data packet.

To create a new note, either set id as 0 or omit the id property from the JSON data packet.

JSON Paths

ticket.actions

Property

Type

Max length

Required?

Description

id

Int

 

 

Number of the ticket note. Read-only.

type

Int

1

Yes

Note type: 1=Internal, 2=Public

origin

Int

1

 

Note creation channel. Read-only.

1 = Customer (in-system)
2 = Agent (in-system)
3 = Imported email
4 = System trigger
5 = Live chat
6 = Offline chat message
7 = System email
8 = Ticket web form
9 = Tickets API
10 = Recurring schedule
11 = Jira issue
12 = Redmine issue
13 = Answered call
14 = Outbound call
15 = Missed call
16 = Abandoned call
17 = Remote access [DEPRECATED]
18 = WhatsApp
19 = Integrated Movidesk instance

description

String

 

Yes

Plain text content of the ticket note.

htmlDescription

String

 

 

HTML content of the ticket note. Read-only.

status

String

128

 

Ticket status when note was added. Read-only.

justification

String

128

 

Ticket status Reason when note was added. Read-only.

createdDate

UTC datetime

 

 

Date ticket note was created. If left blank, the current date and time will be used.

Read-only after the note has been created.

createdBy

Person

 

Yes

Note creator. Read-only after the note has been created.

isDeleted

Boolean

 

 

Returns true if the ticket note was deleted, and false if not. Read-only.

timeAppointments

Time log array

 

 

List of time logs on the ticket note.

expenses

Expense array

 

 

List of expenses on the ticket note.

attachments

Attachment array

 

 

List of file attachments on the ticket note. Read-only.

Use the /ticketFileUpload endpoint to upload file attachments.

tags

Array

 

 

List of tags added to the ticket note.

If a nonexistent tag is added to the array, a new record will be created in the Tags master file.

 

Time log

Object containing details about a specific time log. Each time log is linked to a specific Ticket note.

You can use this object—and the Billing agreements API—to set up time tracking integrations.

To update an existing time log, specify the id for that time log in the JSON data packet.

To create a new time log, you must also create a new ticket note. You cannot add a time log to an existing ticket note.

Clipboard

Note Either the periodStart and periodEnd properties are required, or workTime is required. This is determined by the Time logging formats parameter under the Additional modules tab in Configurations > Parameters.

 

JSON Paths

ticket.actions.timeAppointments

Property

Type

Max length

Required?

Description

id

Int

 

 

ID of the time log. Read-only.

activity

String

128

Yes

Name of the Activity for the time log.

Must be an existing activity configured in Configurations > Activities.

date

UTC datetime

 

Yes

Date of the time log, with the time component set to zeroes:

YYYY-MM-DDT00:00:00

periodStart

Time

 

Yes*

Start time for the time log, in the following format:

HH:MM:SS

Only required if using the Start and end times format for time tracking.

periodEnd

Time

 

Yes*

End time for the time log, in the following format:

HH:MM:SS

Only required if using the Start and end times format for time tracking.

workTime

Time

 

Yes*

Total time for the time log, in the following format:

HH:MM:SS

Only required if using the Time spent format for time tracking.

workTypeName

String

 

Yes

Name of the Time type for the time log.

Must be an existing time type configured in Configurations > Time types.

createdBy

Person

 

Yes

Creator of the ticket note. Read-only after the time log has been created.

createdByTeam

Team

 

Yes

Team of the agent in createdBy.

 

Team

Object containing basic data to identify which team is associated with a Person object.

JSON Paths

ticket.actions.timeAppointments.createdByTeam

Property

Type

Max length

Required?

Description

id

Int

 

Yes

ID of the team. Read-only.

name

String

128

 

Name of the team. Read-only.

 

Expense

Object containing details about a specific expense. Each expense is linked to a specific Ticket note.

You can use this object—and the Billing agreements API—to set up expense tracking integrations.

To update an existing expense, specify the id for that expense in the JSON data packet.

To create a new expense, you must also create a new ticket note. You cannot add an expense to an existing ticket note.

JSON Paths

ticket.actions.expenses

Property

Type

Max length

Required?

Description

id

Int

1

 

ID of the expense. Read-only.

type

String

128

Yes

Name of the expense type.

Must be an existing expense type configured in Configurations > Expense types.

serviceReport

String

128

 

Number of the service report that includes the expense. Read-only.

createdBy

Person

 

Yes

Creator of the ticket note. Read-only after the expense has been created.

createdByTeam

String

128

 

Name of the associated team for the agent in createdBy.

date

UTC datetime

 

Yes

Date for the expense.

quantity

Int

 

Yes*

Quantity for the expense

Only required when value is blank.

value

Decimal

 

Yes*

Monetary amount of the expense.

Only required when quantity is blank.

 

Attachment

Object containing information about file attachments on a ticket note.

This object is read-only and cannot be used to manipulate file attachments. Use the /ticketFileUpload endpoint to upload file attachments.

JSON Paths

ticket.actions.attachments

Property

Type

Max length

Required?

Description

fileName

String

255

 

Name of the attached file. Read-only.

path

String

255

 

Hash value of the attached file. Read-only.

createdBy

Person

 

 

Creator of the ticket note. Read-only.

createdDate

UTC datetime

 

 

Date when the file was uploaded. Read-only.

 

Related ticket

Object containing identifying information for a related ticket—either a parent ticket or a child ticket.

JSON Paths

ticket.parentTickets
ticket.childrenTickets

Property

Type

Max length

Required?

Description

id

Int

 

Yes

id of the related ticket.

subject

String

128

 

Ticket subject. Read-only.

isDeleted

Boolean

 

 

Returns true if the ticket has been deleted, and false if not. Read-only.

 

Past assigned agent

Object containing information about an agent that was previously assigned to the ticket.

Information on this object is read-only, as it is primarily used for auditing purposes.

JSON Paths

ticket.ownerHistories

Property

Type

Max length

Required?

Description

ownerTeam

String

128

 

Name of the agent’s team. Read-only.

owner

Person

 

 

Agent that was previously assigned to ticket. Read-only.

permanencyTimeFullTime

Double

 

 

Duration of the agent’s assignment in calendar hours. Read-only.

Returns the total time in seconds.

permanencyTimeWorkingTime

Double

 

 

Duration of the agent’s assignment in business hours. Read-only.

Returns the total time in seconds.

changedBy

Person

 

 

User that re-assigned the ticket.

changedDate

UTC datetime

 

 

Date when the ticket was re-assigned.

 

Past status

Object containing information about previous statuses of the ticket.

Information on this object is read-only, as it is primarily used for auditing purposes.

JSON Paths

ticket.statusHistories

Property

Type

Max length

Required?

Description

status

String

128

 

Name of the ticket status. Read-only.

justification

String

128

 

Ticket status Reason. Read-only.

permanencyTimeFullTime

Double

 

 

Duration of the status in calendar hours. Read-only.

Returns the total time in seconds.

permanencyTimeWorkingTime

Double

 

 

Duration of the status in business hours. Read-only.

Returns the total time in seconds.

changedBy

Person

 

 

User that changed the ticket status.

changedDate

UTC datetime

 

 

Date when the status was changed.

 

Custom field

Object containing custom field data on a ticket. The object also includes identifying information on which custom field—and which display rule—are storing the data.

There will be a separate object for each individual field on the ticket form. This includes display rules that allow multiple entries for the field group. For example, a display rule with two custom fields and three separate entries on a ticket will constitute a total of six Custom field objects.

Clipboard

Note Date and time data in the value property must be in UTC datetime:

Date: YYYY-MM-DDT00:00:00
Time: 1991-01-01THH:MM:SS
Date and time: YYYY-MM-DDTHH:MM:SS

 

JSON Paths

ticket.customFieldValues

Property

Type

Max length

Required?

Description

customFieldId

Int

64

Yes

ID of the custom field where the data is stored.

customFieldRuleId

Int

64

Yes

ID of the display rule that contains the custom field.

line

Int

64

Yes

Line number where the data is stored. Only applicable for display rules that allow multiple entries.

If the display rule does not allow for multiple entries, this value should always be 1.

value

String

 

Yes*

Value in the custom field. Only required for the following custom field types:

Single-line text
Multiline text
Rich text
Regular expression
Numeric
Date
Time
Date and time
Email
Phone number
URL

items

Custom field item array

 

Yes*

List of items selected in the custom field.

The array should only contain a single value if the custom field is configured with the Allow multiple selection parameter disabled.

Only required for the following custom field types:

Custom dropdown
People search
Customer search
Agent search
Multiple selection
Single selection

 

Custom field item

Object containing data for custom field types that allow the selection of discrete values. Always relates back to a Custom field object.

JSON Paths

ticket.customFieldValues.items

Property

Type

Max length

Required?

Description

personId

Int

64

Yes*

Reference code of the person.

Only required for custom fields of the type People search.

clientId

Int

64

Yes*

Reference code of the customer.

Only required for custom fields of the type Customer search.

team

String

128

Yes*

Name of the agent’s team.

Must be an existing team configured in Configurations > Teams.

Only required for custom fields of the type Agent search. The specific agent should be identified in the personId property.

customFieldItem

String

256

Yes*

Name of the item selected on the custom field.

Must be one of the options or items configured on the custom field in Configuration > Custom fields.

Only required for custom fields of the type Custom dropdown, Multiple selection, or Single selection.

 

Asset

Object containing information about an asset linked to the ticket. All properties on this object are read-only.

Clipboard

Note To update the assets property on the Ticket object, you must change the id property of the Asset object. This will not modify the record in the Assets master file—instead it will swap the previous Asset record with the record corresponding to the new id value.

 

JSON Paths

ticket.assets

Property

Type

Max length

Required?

Description

id

String

64

Yes

Reference code of the asset. Read-only.

name

String

128

Yes

Name of the asset. Read-only.

label

String

128

 

Label of the asset. Read-only.

serialNumber

String

128

 

Serial number of the asset. Read-only.

categoryFull

Array

 

 

Names of each category going down the levels on the category tree until reaching the asset’s category. Read-only.

The array starts with the root category (categoryFirstLevel) and ends with the Category on the asset.

categoryFirstLevel

String

128

 

Name of the root category in the category tree from the Category on the asset. Read-only.

categorySecondLevel

String

128

 

Name of the second level category in the category tree from the Category on the asset. Read-only.

Second level categories are those that have a single category above them in the category tree.

categoryThirdLevel

String

128

 

Name of the third level category in the category tree from the Category on the asset. Read-only.

Third level categories are those that have two categories above them in the category tree.

isDeleted

Boolean

 

 

Returns true if the asset was deleted from the Asset master file, and false if not. Read-only.

 

 

Retrieve a ticket

Retrieve all properties—and expand all objects—of a specific ticket.

GET: /tickets

 

Parameters

Location

Type

Required?

Description

token

Query string

String

Yes

Movidesk API token found in Configurations > Account > Parameters

id

Query string

Int

Yes

id of the ticket that will be retrieved

includeDeletedItems

Query string

Boolean

 

Determines whether deleted objects should also be retrieved by the query, such as deleted requesters and ticket notes.

Has false as the default value.

 

This example is a request to retrieve the ticket with id 25, which returns all properties of that ticket.

Sample request

GET: https://api.movidesk.com/public/v1/tickets?token=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&id=25

Sample response

{
    "id": "25",
    "type": 2,
    "subject": "New data extractor",
    "category": "Service request",
    "urgency": "High",
    "status": "New",
    "baseStatus": "New",
    "justification": null,
    "origin": 2,
    "createdDate": "2019-11-12T03:05:23.7055716",
    "isDeleted": false,
    "originEmailAccount": null,
    "owner": {
        "id": "429079974",
        "personType": 1,
        "profileType": 1,
        "businessName": "Brad Johnson",
        "email": "brad.johnson@movidesk.com",
        “phone”: “5553219999”
    },
    "ownerTeam": "Level 1 Agents",
    "createdBy": {
        "id": "429079974",
        "personType": 1,
        "profileType": 1,
        "businessName": "Brad Johnson",
        "email": "brad.johnson@movidesk.com",
        “phone”: “5553219999”
    },
    "serviceFull": [
        "ETL",
        "Extractor development"
    ],
    "serviceFirstLevelId": 450254,
    "serviceFirstLevel": "Extractor development",
    "serviceSecondLevel": "ETL",
    "serviceThirdLevel": null,
    "contactForm": null,
    "tags": [],
    "cc": null,
    "resolvedIn": null,
    "closedIn": null,
    "canceledIn": null,
    "actionCount": 1,
    "lifeTimeWorkingTime": null,
    "stoppedTime": null,
    "stoppedTimeWorkingTime": null,
    "resolvedInFirstCall": false,
    "chatWidget": null,
    "chatGroup": null,
    "chatTalkTime": null,
    "chatWaitingTime": null,
    "sequence": null,
    "slaAgreement": null,
    "slaAgreementRule": null,
    "slaSolutionTime": 0,
    "slaResponseTime": 0,
    "slaSolutionChangedByUser": false,
    "slaSolutionChangedBy": {
        "id": "429079974",
        "personType": 1,
        "profileType": 1,
        "businessName": "Brad Johnson",
        "email": "brad.johnson@movidesk.com",
        “phone”: “5553219999”
    },
    "slaSolutionDate": null,
    "slaSolutionDateIsPaused": false,
    "jiraIssueKey": null,
    "redmineIssueId": null,
    "movideskTicketNumber": null,
    "linkedToIntegratedTicketNumber": null,
    "reopenedIn": null,
    "lastActionDate": "2019-11-12T03:06:55.1954731",
    "lastUpdate": "2019-11-12T03:06:54.3038665",
    "slaResponseDate": null,
    "slaRealResponseDate": null,
    "clients": [
        {
            "id": "350002",
            "personType": 2,
            "profileType": 2,
            "businessName": "Western Manufacturing",
            "email": null,
            "phone": "5553819431",
            "isDeleted": false,
            "organization": null,
            "address": "1250 Commerce Ave",
            "complement": "Unit 15",
            "cep": null,
            "city": null,
            "bairro": null,
            "number": null,
            "reference": "Concord – NH"
        }
    ],
    "actions": [
        {
            "id": 1,
            "type": 2,
            "origin": 0,
            "description": "We need a new data extractor for our new ERP module: Payroll.\n",
            "htmlDescription": "<p>We need a new data extractor for our new ERP module: Payroll.</p>",
            "status": "New",
            "justification": null,
            "createdDate": "2019-11-12T03:06:55.1954731",
            "createdBy": {
                "id": "429079974",
                "personType": 1,
                "profileType": 1,
                "businessName": "Brad Johnson",
                "email": "brad.johnson@movidesk.com",
                “phone”: “5553219999”
            },
            "isDeleted": false,
            "timeAppointments": [
                {
                    "id": 24254852,
                    "activity": "Online services",
                    "date": "2019-11-11T00:00:00",
                    "periodStart": "22:05:00",
                    "periodEnd": "22:06:00",
                    "workTime": "00:01:00",
                    "workTypeName": "Regular",
                    "createdBy": {
                        "id": "429079974",
                        "personType": 1,
                        "profileType": 1,
                        "businessName": "Brad Johnson",
                        "email": "brad.johnson@movidesk.com",
                        “phone”: “5553219999”
                    },
                    "createdByTeam": {
                        "id": 55623,
                        "name": "Level 1 Agents"
                    }
                }
            ],
            "attachments": [],
            "expenses": [],
            "tags": []
        }
    ],
    "parentTickets": [],
    "childrenTickets": [],
    "ownerHistories": [
        {
            "ownerTeam": "Level 1 Agents",
            "owner": {
                "id": "429079974",
                "personType": 1,
                "profileType": 1,
                "businessName": "Brad Johnson",
                "email": "brad.johnson@movidesk.com",
                “phone”: “5553219999”
            },
            "changedBy": {
                "id": "429079974",
                "personType": 1,
                "profileType": 1,
                "businessName": "Brad Johnson",
                "email": "brad.johnson@movidesk.com",
                “phone”: “5553219999”
            },
            "changedDate": "2019-11-12T03:05:23.7055716",
            "permanencyTimeFullTime": null,
            "permanencyTimeWorkingTime": null
        }
    ],
    "statusHistories": [
        {
            "status": "New",
            "justification": null,
            "changedBy": {
                "id": "429079974",
                "personType": 1,
                "profileType": 1,
                "businessName": "Brad Johnson",
                "email": "brad.johnson@movidesk.com",
                “phone”: “5553219999”
            },
            "changedDate": "2019-11-12T03:05:23.7055716",
            "permanencyTimeFullTime": null,
            "permanencyTimeWorkingTime": null
        }
    ],
    "satisfactionSurveyResponses": [],
    "customFieldValues": [],
    "assets": [],
    "webhookEvents": null
}

 

Retrieve multiple tickets

Retrieve specific properties from multiple tickets.

GET: /tickets

 

Parameters

Location

Type

Required?

Description

token

Query string

String

Yes

Movidesk API token found in Configurations > Account > Parameters

$select

Query string

OData

Yes

Comma delimited list of which object properties should be retrieved

$expand

Query string

OData

 

Comma delimited list of which properties should be expanded.

For example, expand the clients property to retrieve the nested Requester objects and their properties.

$filter

Query string

OData

 

Expressions to specify which tickets should be retrieved.

$orderby

Query string

OData

 

Determines whether objects will be retrieved in ascending (asc) or descending (desc) order.

Has asc as the default value.

$top

Query string

OData

 

Determines how many tickets should be retrieved. Used for paging results.

$skip

Query string

OData

 

Determines how many tickets should be skipped before retrieving tickets. Used for paging results.

 

Head with gears

Tip See the official OData guide on query options for details on how to sort, filter, and page the results.

 

This example is a request to retrieve the id, subject, owner, clients, and urgency properties of all tickets assigned to team “Level 1 Agents” that have a status of “New.”

The request is also specifying that it only wants the businessName property for the assigned agent and the requesters.

The response shows two tickets that fit the filter criteria.

Clipboard

Note The $filter parameter uses single quotation marks on strings, instead of double quotation marks.

 

Sample request

GET: https://api.movidesk.com/public/v1/tickets?token=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&$select=id,subject,owner,clients,urgency&$filter=ownerTeam eq 'Level 1 Agents' and status eq 'New'&$expand=owner($select=businessName),clients($select=businessName)

 

Sample response

[
    {
        "urgency": "Low",
        "subject": "Triggers - Limits",
        "id": 11,
        "clients": [
            {
                "businessName": "Matthew J. Smith"
            }
        ],
        "owner": {
            "businessName": "Brad Johnson"
        }
    },
    {
        "urgency": "Low",
        "subject": "Automation triggers",
        "id": 25,
        "clients": [
            {
                "businessName": "Matthew J. Smith"
            }
        ],
        "owner": null
    }
]

 

Create a ticket

Create a new ticket.

POST: /tickets

 

Parameters

Location

Type

Required?

Description

Content-Type

Header

Content type

Yes

Should always be application/json

token

Query string

String

Yes

Movidesk API token found in Configurations > Account > Parameters

returnAllProperties

Query string

Boolean

Yes

Determines whether all properties of the new ticket will be returned, or only the id of the new ticket.

Has false as the default value.

Ticket properties

Body

JSON

 

Properties of the new ticket.

 

This example is a request to create a new public ticket with the subject “New data extractor” from ticket requester with reference code 350002.

The API returns a Status 200 (OK) and the id of the new ticket.

Clipboard

Note The property id will be ignored if it is included in the JSON content of the request, but will not cause an error.

 

Sample request

POST: https://api.movidesk.com/public/v1/tickets?token=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
Headers: Content-Type: application/json

{
    "type": 2,
    "subject": "New data extractor",
    "category": "Service request",
    "urgency": "High",
    "status": "New",
    "createdBy": {
        "id": "350002",
    },
    "serviceFirstLevelId": 450254,
    "clients": [
        {
            "id": "350002",
        }
    ],
    "actions": [
        {
            "id": 0,
            "type": 2,
            "description": "We need a new data extractor for the ERP module: Payroll.<br>Thank you,<br>Matthew",
            "createdBy": {
                "id": "350002"
            }
        }
    ]
}

 

Sample response

{
    "id": 27
}

 

Update a ticket

Make changes to a ticket by sending JSON key/value pairs for the properties you want to change.

Warning

Warning Updating array properties such as clients will replace all values in the array with the values in your request.

Exceptions to this are the following properties, which will not delete items in the array:

  • actions (Ticket object)
  • timeAppointments (Ticket note object)
  • expenses (Ticket note object)
  • attachments (Ticket note object)

 

PATCH: /tickets

 

Parameters

Location

Type

Required?

Description

Content-Type

Header

Content type

Yes

Should always be application/json

token

Query string

String

Yes

Movidesk API token found in Configurations > Account > Parameters

id

Query string

Int

Yes

id of the ticket that will be updated

Ticket properties

Body

JSON

 

Properties to be updated.

 

This example is a request to update the ticket with id 27, which was created in the previous example.

The request is adding a new ticket note by the user with reference code 429079974, and removing any tags currently in place.

The API returns a status, but no JSON data.

Clipboard

Note The property id will be ignored if it is included in the JSON content of the request, but will not cause an error.

 

Sample request

PATCH: https://api.movidesk.com/public/v1/tickets?token=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&id=27
Headers: Content-Type: application/json

{
    "actions": [
        {
            "id": 0,
            "type": 2,
            "description": "We can certainly do that. Could you send us a spec of the data fields you need to extract? You can add it as an attachment to this ticket<br>We will send you an estimate after reviewing the spec.",
            "createdBy": {
                "id": "429079974"
            }
        }
    ],
    "tags":[]
}

 

Adding a file attachment

Adds one or more file attachments to a specific ticket note.

POST: /ticketFileUpload

 

Parameters

Location

Type

Required?

Description

Content-Type

Header

Content type

Yes

Should always be multipart/form-data

token

Query string

String

Yes

Movidesk API token found in Configurations > Account > Parameters

id

Query string

Int

Yes

id of the ticket that will be updated

actionId

Query string

Int

Yes

id of the ticket note that will be updated

File attachments

Body

File

Yes

Files that will be attached to the ticket note.

 

This example is a request to attach a file to the ticket note with id 3 on the ticket with id 27.

The API returns the attached file’s details, including any errors that may have happened in the file attachment process.

Sample request

POST: https://api.movidesk.com/public/v1/ticketFileUpload?token=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&id=27&actionId=3
Headers: Content-Type: multipart/form-data

Sample response

[
    {
        "fileName": "DataExtractorSpecs.docx",
        "path": "BF05F001CDD62AE70C623F10E8DE8D8A",
        "error": null
    }
]

 

Watchpoints

When using the Tickets API, there are a few important watchpoints to consider:

API performance

Movidesk's APIs are made available without processing limitations so that you can best address your company's specific needs. However, should Movidesk's monitoring systems identify an unreasonable amount of requests and data traffic, one or more APIs used by you may be subjected to throttling.

When configuring API integrations, we recommend maintaining the frequency and number of API requests to a rate equivalent to what human agents would be able to manually accomplish in the system.

OData query options can also significantly impact your system’s performance if used inappropriately. In particular complex queries using $filter. Examples of complex queries include queries that loop through multiple levels of objects, or that use the performance intensive contains function.

We recommend keeping queries as simple as possible to accomplish your needs. For example, don’t use $select to retrieve properties that are not needed—especially on queries that will return a large number of tickets.

 

Paging

The tickets API has a limit of 1000 results for the GET: /tickets resource.

To improve performance—and to ensure that no results are missed due to the 1000 record limit—we strongly recommend using the $top and $skip OData query options for paging.

For example, the following request will retrieve the first 100 tickets from team “Level 1 Agents”:

GET: https://api.movidesk.com/public/v1/tickets?token=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&$select=id&$filter=ownerTeam eq 'Level 1 Agents'&$top=100

You could also add $skip=0 to the request above, as it would have no effect.

This request would return the second “page” of 100 results, by skipping the first 100 results retrieved in the last request:

GET: https://api.movidesk.com/public/v1/tickets?token=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&$select=id&$filter=ownerTeam eq 'Level 1 Agents'&$top=100&$skip=100

The third request would then skip 200 results, and so on until no more records are returned:

GET: https://api.movidesk.com/public/v1/tickets?token=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&$select=id&$filter=ownerTeam eq 'Level 1 Agents'&$top=100&$skip=200

 

Custom ticket numbering

By default, the ticket numbering scheme in Movidesk is sequential—starting with ticket number 1. However, you can configure a custom numbering scheme in Configurations > Parameters. If using a custom numbering scheme, additional considerations are necessary when using the Tickets API.

When using a custom numbering scheme, Movidesk will still store the sequential ticket IDs internally—we’ll refer to these as the internal ID. This allows customers to more easily transition away from a custom numbering scheme at a later date if they so choose.

On the other hand, we have the ticket custom ID, which follows the custom numbering scheme.

Below is a list of specific API handling of internal ID and custom ID in different situations:

The id parameter on GET requests will match on both the custom ID and the internal ID.

Retrieving a single ticket using the id parameter with GET will return the custom ID.

Retrieving multiple tickets with GET, and using $select to return the id property, will return the internal ID

The $filter query option, when retrieving multiple tickets with GET, will only match on the internal ID.

API token
Classifique este artigo
Últimos artigos visitados