POST Create a Request
URL: {{server-url}}/api/v1/request
In order to create a new request, you have to call the above endpoint with the following key-values:
Header
Key | Description |
---|---|
Authorization | Bearer {access token obtained after authorization} |
Content-Type | application/json |
Body
You would be sending a JSON request that will create a ticket and populate its details. Some of the key-value pairs are compulsory, notice the description of each.
note
Keys with asterisk are compulsory.
Key | Value Type | Description |
---|---|---|
subject* | String | Subject of the ticket. |
categoryName | String | Category Name of a Request. Set to ‘Request’ as it is default to ‘Service Request’. |
requesterEmail* | String | Email address of the user registered for the client. |
ccEmailSet | String Array | Email Address of People to whom notification is to be sent for certain events on Request. |
tags | String Array | These are additional identifiers attached to a ticket. Its a list that can contain n number of STRINGS. |
impactName | String | Describes the effect of the Request. Possible values are: Low, On User , On department, Or On Business. |
priorityName | String | Shows the importance of the Request. Possible values are: Low, Medium, High, or Urgent. |
urgencyName | String | Marks the request as urgent. Possible values are: Low, Medium, High, or Urgent. |
departmentName | String | Additional information about the ticket. |
locationName | String | Name of the Location where Request happened. Note that Location Must Exist with same name. |
supportLevel | String | Describes the level of the provisioned support. Possible Values are: Tier1, Tier2, Tier3, or Tier 4. |
spam | Boolean | Possible Values are True or False. |
assigneeEmail | String | Name of the Assignee. |
Technician Group Name | String | Name of the group to which the Technician belongs. |
source | String | It shows the origin of the ticket. The Source can be either Support Portal or the Technician portal. Default source for Rest API is ‘External’. |
fileAttachments | Object Array | Reference File Name of attachments for a Request. For example:[ { “refFileName” : “abc”, “realName” : “xyz.pdf” } ] |
statusName | String | Possible values are Open, In Progress, Pending, Resolved, and Closed. |
linkAssetIds | Object Array | Add asset id with model name. For example :”linkAssetIds”: [{“assetModel”: “asset_hardware”,”assetId”: 1}]. |
customField | MAP:{key: STRING, value: OBJECT} | This key is related to custom fields. Example “customField”: {“New Dropdown”: “1”, “New Number”: 110.1,”New Text Area”: “a11”, “New Text Input”: “111”} |
Example (Request & Response)
Request
curl --request POST
--url 'http://{Server-url}/api/v1/request'\
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1ODUxNTk0MTksInVzZXJfbmFtZSI6Im5pcmF2LnBhdGVsQG1vdGFkYXRhLmNvbSIsImp0aSI6ImZhZTY2YTdiLTY0NDQtNGY4OS1hNGNmLWZmOGY3NDIyMThhZiIsImNsaWVudF9pZCI6ImZsb3RvLXdlYi1hcHAiLCJzY29wZSI6WyJOTy1TQ09QRSJdLCJ0ZW5hbnRJZGVudGlmaWVyIjoiYXBvbG8ifQ.i65Huu91E5xP2fXk7hY45VBN1wZSRhvDAT1WRCqcuRw'
--header "Content-type: application/json"
--data '{
"requesterEmail": "a@b.com",
"ccEmailSet": [
"a@b.com"
],
"subject": "asdasd",
"impactName": "Low",
"priorityName": "Low",
"statusName": "Open",
"urgencyName": "Low",
"departmentName":"IT",
"spam":false,
"supportLevel":"tier2",
"customField": {
"New Dropdown": "1",
"New Number": 110.1,
"New Text Area": "a11",
"New Text Input": "111"
},
"name": "INC-1",
"tags": ["asdasd"]
}'
Response
{
"id": 1,
"createdTime": 1584699527485,
"updatedTime": 1584699528033,
"requesterEmail": "a@b.com",
"requesterName": "utsav",
"ccEmailSet": [
"a@b.com"
],
"subject": "asdasd",
"impactName": "Low",
"priorityName": "Low",
"statusName": "Open",
"urgencyName": "Low",
"tags": [],
"customField": {},
"source": "Technician Portal",
"spam": false,
"departmentName": "IT",
"supportLevel": "tier1",
"name": "INC-1"
}