Skip to main content
Version: 8.5.X

How to Create Request Using REST API

A REST API defines a set of functions which developers can perform requests and receive responses via HTTP protocol such as GET and POST. {Product} allows third party clients to create Requests using REST API.

Prerequisite

Before using REST API, you have to create an API Client.

Creating a Request?

You can create a request using either of the two methods:

  1. Using Access Token
  • Go to Admin > Automation > Integrations > Rest Integration.
  • Copy Client ID and Client Secret from the Integration page as shown below:

Client ID and Secret Key

  • Use the credentials (Client ID and Secret) in the third-party tool to acquire the access token. The user credentials are required, if the Access Level is selected as Specific User.
  • If the Access Level is selected as Any User, any technician registered in the system can use the REST API.
  • You will receive an access token from the server in the third-party tool as shown below:

Access Token

  • Use this access token in the API.
  1. Using API Key
  • Go to Admin > Automation > Integrations > API Integration.
  • Copy the API Key from the API Integration page as shown below.

Access Token

Now, you can create a request using the below API path.

APIhttp://{{server-url}}/api/v1/request

HTTP Method: POST

Header:

Key: Authorization

Value: Bearer {access_token/api_key}

KeysValue TypeDescription
subjectStringSubject of the ticket.
categoryNameStringCategory Name of a Request. Set to ‘Request’ as it is default to ‘Service Request’
requesterEmailStringEmail address of the user registered for the client.
ccEmailSetString ArrayEmail Address of People to whom notification is to be sent for certain events on Request
tagsString ArrayThese are additional identifiers attached to a ticket. Its a list that can contain n number of STRINGS.
impactNameStringDescribes the effect of the Request. Possible values: Low, On User , On department, Or On Business
priorityNameStringShows the importance of the Request. Possible values: Low, Medium, High or Urgent
urgencyNameStringMarks the request as urgent. Possible values: Low, Medium, High or Urgent
departmentNameStringAdditional information about the ticket.
locationNameStringName of the Location where Request happened. Note that Location Must Exist with same name
supportLevelStringDescribes the level of the provisioned support. Possible Values: Tier1, Tier2, Tier3 or Tier 4
spamBooleanPossible Values are True or False
sourceStringIt shows the origin of the ticket. The Source can be either Support Portal or the Technician portal. Default source for Rest API is ‘External’.
fileAttachmentsObject ArrayReference File Name of attachments for a Request. For example:[ { “refFileName” : “abc”, “realName” : “xyz.pdf” } ]
statusNameStringPossible values are Open, In Progress, Pending, Resolved, Closed
linkAssetIdsObject ArrayAdd asset id with model name. For example :"linkAssetIds": [{"assetModel": "asset_hardware","assetId": 1}]
linkCiIdsObject ArrayAdd CI id with model name. For example :"linkCiIds": [{"ciId": 2, "ciModel": "cmdb"}]
customFieldMAP:{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”}
note

Here, User refers to the one registered with the Client.

Request

{
"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"],
"fileAttachments": [
{}
],
"linkCiIds": [
{
"ciId": 2,
"ciModel": "cmdb"
}
],
"linkAssetIds": [
{
"assetId": 4,
"assetModel": "asset_hardware"
}
]
}

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"
}
  • Your Request is created on returning success. Similarly, you can perform other operations using APIs.

Request APIs