Create a Service Request
You can create Service Requests using Rest API.
Base URL:
https://{tenant url}/api/rest/ServiceRequest/new

Here is an example to create a Service Request.
URL | https://{tenant url}/api/rest/ServiceRequest/new |
Method |
POST |
Header Name | Authorization: JWT Token/Session Key/REST API Key |
Request Payload |
![]() { "attachmentsToDelete": [], "attachmentsToUpload": [], "parameters": {}, "delayedFulfill": false, "formName": "ServiceReq.ResponsiveAnalyst.DefaultLayout", "saveReqState": false, "serviceReqData": { "Subject": "SR from RESTAPI", "Symptom": "Test02" }, "strCustomerLocation": "West", "strUserId": "2F851094BFE5437C97D19871D1C539C7", "subscriptionId": "0C1780F4EC814CB2B8E045325D8CFB66", "localOffset": -330 } For details on how to fetch the values for these fields, see Field Values and Parameters. All the fields shown in this example are mandatory, the API will return an error if any of the field is missing. However, the value for |
Status Code |
200 |
Response Payload |
![]() { "IsSuccess": true, "ErrorText": "", "ServiceRequests": [ { "bNew": true, "strSubscriptionRecId": "0C1780F4EC814CB2B8E045325D8CFB66", "strRequestRecId": "6730C50F527A481A81FFE15D7D60725F", "strIssueRecId": null, "strRequestNum": "10288", "strName": "MinimalSR", "strStatus": null, "strStatusId": null, "strService": null, "strServiceId": null, "strDetails": null, "parameterTemplateParameterIds": {}, "DateApproved": null, "DateCancelled": null, "DateCompleted": null } ], "InvalidServiceRequests": {} } |
Field Values
How to fetch the values of the fields used for executing the Create Service Request API is detailed below.

To fetch the value for strCustomerLocation
and strUserId
, execute the API - https://{tenant URL}/api/odata/businessobject/Frs_CompositeContract_Contacts?$filter=NetworkUserName eq '{your user name}'
From the response that you get - the value for Employee Location
will be your strCustomerLocation
value and the value for RecID
will be your strUserId
value.

To fetch the value for subscriptionId
, execute the API - https://{tenant URL}/api/rest/Template/<User_RecId>/_All_
This will give you all the published templates in Service Catalog. From the response that you get - the value for strSubscriptionId
will be your subscriptionId
value.

The value for localoffset
is the difference in minutes from the Coordinated Universal Time for a particular place. For example, if your location is India, your GMT/UTC is +5.30 hours which is 330 minutes, therefore, the localoffset
value for your location is -330.
Parameters
The base structure of the Parameter is -
"parameters": {
// {parameter name}
"par-{Parameter RecID}": "value",
}

"parameters": {
// Checkbox
"par-{Parameter RecID}": "true",
// Text Field
"par-{Parameter RecID}": "Text Field",
// Text Area
"par-{Parameter RecID}": "Text Area",
// Drop Down
"par-{Parameter RecID}": "Scheduled",
"par-{Parameter RecID}-recId": "{Field RecID of Scheduled}",
// Time Field
"par-{Parameter RecID}": "{system generated time}",
// DateTime Field
"par-{Parameter RecID}": "{system generated time}",
// Pick List
"par-{Parameter RecID}": "Active",
"par-{Parameter RecID}-recId": "{Field RecID of Active}"
}
Sample Service Request with Parameters
Drop-down lists/pick-lists and Attachments work differently from other parameters. For details, see Drop-down and Pick-list and Attachments.

In case of drop-down and pick-list you will need the value's RecID, to fetch it execute the following API:
GET: {tenant_url}/api/rest/ServiceRequest/{Parameter_RecID}/ValidationList
Use Postman or a similar app instead of browser and set the Content-Type as application/json.
Example:
1.Execute - GET: {tenant_url}/api/rest/ServiceRequest/ 6B5A00312E00430AAF8769D1A27326C6/ValidationList
The response contains the Rec IDs of all values. For example, the RecID of the value Alex is "026221D7927F4104810ABF14672FCC3".
2.Use it for the parameter XYZ as given below:
"parameters": {
"par-A72D69AF2A9B420F874BA8A5A293EF17": "Alex",
"par-A72D69AF2A9B420F874BA8A5A293EF17-recId": "026221D7927F4104810ABF14672FCC3"
}

To upload attachments in Service Request, you will need the attachment's token.
To fetch the token execute the following API:
1.POST: api/rest/Attachment/newSR
Use Postman or a similar app instead of browser and set the Request Body as Form-data.
2.Copy the token from the response.
Sample response containing token
Using the token in the Service Request:
attachmentsToUpload: [["{token ID}", "<attachment file name"]]
Unsuccessful Responses

Scenario: Trying to create a Service Request with empty request body.
Header Name:
Authorization: Sessionkey
Code |
ISM_4000 |
Description | Invalid Request Payload |
Message |
{ "Message body cannot be empty." } |
HTTP STATUS CODE |
400 |

Scenario: Trying to create a Service Request with invalid request body.
Header Name:
Authorization: Sessionkey
Code |
ISM_4000 |
Description | Invalid Request Payload |
Message |
[ "Invalid Business Object." ], |
HTTP STATUS CODE |
400 |

Scenario: Trying to create a Service Request with missing mandatory fields.
Header Name:
Authorization: Sessionkey
Code |
ISM_4000 |
Description | Invalid Request Payload |
Message |
[ "Required field parameters is missing" ] |
HTTP STATUS CODE |
400 |

Scenario: When the application fails to save when trying to create a Service Request.
Header Name:
Authorization: Sessionkey
Code |
ISM_5000 |
Description | Internal server error |
Message |
[ "The server encountered an internal error. Please retry the request." ], |
HTTP STATUS CODE |
500 |