Recieving error "mandatory fields required" on API response

Aindrila Mondal
Tera Expert

Recieving error "mandatory fields required" on API response

 

{ "error": {
        "message": "Mandatory Variables are required",
        "detail": ""
    },
    "status": "failure"
}
 
But i rechecked everything the mandatory fields are all filled from json, nothing is missed and all backend variable names are correct still don't understand the error cause.
 
Please find below the catalog details and the json:
 
Json:
{
"sysparm_quantity": "1",
"short_description":"To manage AP invoice and payment related queries",
"priority":"3",
"due_date":"2023-01-12",
"stage":"fulfillment",
"assignment_group":"REQ-AS-TEST-APBGL-AP",
"description":"testdescription",
"variables":
{
"requested_for":"utkarsh.kuralkar@hp.com",
"short_description": "To manage AP invoice and payment related queries",
"description": "check for api response",
"ap_what_can_we_help_you_with": "Other Accounts Payable Queries",
    "VM_description_of_the_request":"please put description of the request",
    "ap_is_there_any_other_ap_related_support_required":"Yes",
      "OAP_description_of_issue":"please put description of the issue",
      "OAP_country":"Australia",
      "OAP_vendor_name":"(K)THI WEIBU",
    "criticality":"3",
"requestor_emp_id":"20217569",
"requestor_email":"prasanna-v.sree-hari@hp.com"
}
}
AindrilaMondal_1-1718174776012.png

 

AindrilaMondal_0-1718174733599.png

 Any help is really appreciated.

Thanks

1 ACCEPTED SOLUTION

Sandeep Rajput
Tera Patron
Tera Patron

 

@Aindrila Mondal Please share this JSON with your API team and take their feedback on the missing field. I doubt if someone here would be able to help you out in this case.

View solution in original post

3 REPLIES 3

dgarad
Giga Sage

Hi @Aindrila Mondal 

Refer to the below link.

https://www.servicenow.com/community/developer-articles/service-catalog-rest-api-ordernow-to-check-a...

If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad

Sandeep Rajput
Tera Patron
Tera Patron

 

@Aindrila Mondal Please share this JSON with your API team and take their feedback on the missing field. I doubt if someone here would be able to help you out in this case.

Aindrila Mondal
Tera Expert

Thank you so much everyone.The issue got resolved someone made 2 fields mandatory from the field level but those were displayed on the catalog form depending on ui policy.

So instead of making those fields mandatory from the ui policy level itself they did it form the field level which was causing the error.

 

Thank you all for replying.