Movidesk API - Maintenance and manipulation of additional fields
12 min
Created by Cassio Fiorin on 1/6/2023 11:09 AM
Updated by Karine Moreira on 9/24/2024 4:28 PM
Important: Our APIs have a limit of 10 requests per minute to ensure healthy usage. If you have a specific scenario that requires increased usage, please contact our support team for a feasibility analysis. Learn more about API schedules and limits
https://api.movidesk.com/public/v1/ticketCustomFieldValue/

Tickets

  URL: /ticketCustomFieldValue
  Methods: POST
 
This API uses only the POST method; the operation must be indicated in the URL, as shown in the examples below.
 
Application Description:

The developed API provides three endpoints for modifying additional field values, centralized in the resource: public\v1\ticketCustomFieldValue\{operation}.
The operation can be one of: InsertValues, UpdateValues, and DeleteValues.
Each resource is responsible for inserting new data, updating existing data, and deleting data, respectively.  
 
InsertValues

Allows inserting new values within an additional field.
Support for: Value List
Contract:
Body:
{
"customfieldid": "number";
"customfieldvalues": ["string"]
}
 
Layout
Property
Type
Description
Required
Example
customfieldid
Numeric
Identifier of the additional field to be modified
5
customfieldvalues
List of strings
List of values to be inserted
["Option A", "Option B"]
 
Blocking Errors:

Invalid body format! -> If the request format is incorrect (missing parameters or incomplete fields)
Field with ID {id} not found -> If an additional field with the provided ID is not found.
 
 
Response:

The API will return a new list indicating the status of each inserted value, with a success property if no issues are found, or a Message property indicating what went wrong:
The value {value} already exists as an option for the field {name}. -> If a value that already exists in the field with the provided ID is inserted.
 
UpdateValues.

Allows editing values within an additional field.
Support For: List of Values
Contract:
Body:
{ 
"customfieldid": "number",
 
"customfieldvalues": [
{
"oldname": "string",
"newname": "string"
}
]
}


Layout

Property
Type
Description
Required
Example
customfieldid
Numeric
Identifier of the additional field that will be modified
5
customfieldvalues
List of strings
List of values to be modified
[{"oldname": "Option A", "newname": "Main Option"}]

Critical Errors:

Invalid body format! -> If the request format is incorrect (missing parameters or incomplete fields) or if there are no values within the customfieldvalues parameter.
Field with ID {id} not found -> If an additional field with the provided ID is not found.

Return:

The API will return a new list indicating the status of each inserted value, with a success property if no issues are found, or a Message property indicating what went wrong:
The value {oldName} does not exists on the custom field {name}. → If a field with the name value to be modified is not found.
The value {newName} already exists on the custom field {name}. → If the value being attempted to change already exists within the field with the provided ID.

DeleteValues.

Allows deleting values within an additional field.
Support For: List of Values
Contract:
body: 
{
 "customfieldid": number,
 "customfieldvalues": [string]
}

Layout

Property
Type
Description
Required
Example
customfieldid
Numeric
Identifier of the additional field to be modified
5
customfieldvalues
List of strings
List of values to be removed
["Option A", "Option B"]
Critical Errors:

Invalid body format! -> If the request format is incorrect (missing parameters or incomplete fields) or if there are no values within the customfieldvalues parameter.
Field with ID {id} not found -> If an additional field with the provided ID is not found.

Return:

The API will return a new list indicating the status of each value inserted, with a success property if no issues are found, or a Message property indicating what went wrong:
Could not delete {name}, the field {field} will be empty! If this is intentional, a manual delete must be done. → If attempting to delete the last value from a field with the provided ID, as a rule, fields without values are not allowed.
The value {name} does not exist on the custom field {field}. → If a name value is not found to be deleted in the field with the provided ID.
 
Inserting Values
Method: POST
 {
"customfieldid": "125529",
"customfieldvalues": ["Option A", "Option B", "Option C"]
}
Return:
{
"values": [
{
"name": "Option A",
"success": true,
"message": ""
},
{
"name": "Option B",
"success": true,
"message": ""
},
{
"name": "Option C",
"success": true,
"message": ""
}
]
}
 
Updating Values
Method: POST
POST: /UpdateValues
Parameters: token


Example:
{
"customfieldid": "125529",
"customfieldvalues": [
{
"oldname": "OPTION A",
"newname": "OPTION 1"
},
{
"oldname": "OPTION B",
"newname": "OPTION 2"
},
{
"oldname": "OPTION C",
"newname": "OPTION 3"
}
]
}

Return:
{
"values": [
{
"name": "OPTION A",
"success": true,
"message": ""
},
{
"name": "OPTION B",
"success": true,
"message": ""
},
{
"name": "OPTION C",
"success": true,
"message": ""
}
]
}
Deleting Values
Method: POST
POST: /DeleteValues
Parameters: token


Example:
POST:https://api.movidesk.com/public/v1/ticketCustomFieldValue/DeleteValues/?token=ec3d4562-5438-4138-8af6-dc7708e0c75a


Body:

{
"customfieldid": "125529",
"customfieldvalues":
[

"Option 1",
"Option 2",
"Option 3"
]
}


Return:

{
"values": [
{
"name": "Option 1",
"success": true,
"message": ""
},
{
"name": "Option 2",
"success": true,
"message": ""
},
{
"name": "Option 3",
"success": true,
"message": ""
}
]
}
Was this article useful?
Recently viewed