Need to Create a Request from REST API

Community Alums
Not applicable

Hi There,

 

 I have one requirement, i need to create a New Hire/Transfer Request from REST API,

 

For this i have navigated to REST API Explorer

And selected below fields,

Namespace : sn_sc

API Name : Service Catalog API

API Version : latest

Add Item to Cart(POST) method i have used 

 

In Path Parameters:

 sys_id: sysid of the Catalog Item

 

 

and in the Raw body

{
"sysparm_quantity":1,
"variables":{
"requestor":"Zagone, Tara",
"officer_group_approval":"Fu, Judy",
"full_name":"Test",
"employment_type":"Consultant",
"access_required_from":"Home PC",
"declaration":"The computer in question does not currently have any viruses, worms, etc. to my knowledge"

}
}

 

 

PriyaSm_0-1691046850186.pngPriyaSm_1-1691046882463.png

PriyaSm_2-1691046922906.png

 

 

and when i Run this i'm getting the Error in Response body(400 Bad Request) ie,

 

{
  "error": {
    "message": "Mandatory Variables are required",
    "detail": ""
  },
  "status": "failure"
}

 Can anyone please help me to get the proper solution 

 

Thanks,

 

0 REPLIES 0