API call returning 400 bad request.

GopikaP
Mega Sage

Hi everyone, I am getting 400 Bad request while adding one more field as parameter in the request body. If I remove that specific field from the request body, the record will get inserted. That field is a custom field (is a string field) in incident table, and it is configured as read-only from dictionary. 

This is the error I am getting - 

 

{
  "error": {
    "message": "Error",
    "detail": "Wrong parameters: 'u_variable_name'. Allowed parameters are: additional_comments,assigned_to,assignment_group,business_service,caller,category,company,cmdb_ci,description,priority,short_description,state,ticket_type,work_notes,sub_category,correlation_id,correlation_display,impact,urgency"
  },
  "status": "failure"
}

 

 Thanks

Dr Atul G- LNG
Tera Patron

Hi @GopikaP 

This can be considered as read-only, and you're calling it at the form level via the API. Please check the syntax carefully when adding it to the API call.

 

Is it get or post  call?

 

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

Hi @Dr Atul G- LNG , it is a post call. So, is it because it is read-only?

Hi @GopikaP 

 

Is any of these are read only

 

additional_comments,assigned_to,assignment_group,business_service,caller,category,company,cmdb_ci,description,priority,short_description,state,ticket_type,work_notes,sub_category,correlation_id,correlation_display,impact,urgency"

 , if no, then i think its read only issue. 

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

Hi @Dr Atul G- LNG ,Thanks for looking into this. I tried with one another custom read only field - it is not returning any error. So, I think it is not because of read-only.