Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Having an issue with REST API Explorer using PATCH method on CMDB Instance API

Jay Jav
Tera Contributor

Hi,

I am trying to test and use the CMDB Instance API, but I faced an issue with PATH Method.

In REST API Explorer,when I want to change the value of "ram" for any class and specific CI using the SYS ID, I receive the 500 Internal Error message. I tested with PDI and other instances and the issue persists.

it says the attributes is null, how can I address the issue in the REST API explorer?

 

 

{
"error": {
"message": "Exception while executing request: Cannot invoke \"java.util.Map.put(Object, Object)\" because \"attributes\" is null",
"detail": "Cannot invoke \"java.util.Map.put(Object, Object)\" because \"attributes\" is null Check logs for error trace or enable glide.rest.debug property to verify REST request processing"
},
"status": "failure"
}

 

 

 

14 REPLIES 14

palanikumar
Giga Sage

Can you share the input payload used

Thank you,
Palani

Javad
Tera Contributor

Hi @palanikumar 

 

here is the input:

curl "https://devxxxxxxxx.service-now.com/api/now/cmdb/instance/cmdb_ci_linux_server/f366fad19f030200fe2ab..." \
--request PATCH \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--data "{\"ram\":\"2024\"}" \
--user 'admin':'admin'

Hi,

For CMDB Instance API, you need to follow a payload structure. Use the below:

curl "https://devxxxxxxxx.service-now.com/api/now/cmdb/instance/cmdb_ci_linux_server/f366fad19f030200fe2ab..." \
--request PATCH \
--header "Accept:application/json" \
--header "Content-Type:application/json" \
--data "{\"attributes\": {\"ram\":\"2024\"},\"source\":\"ServiceNow\"}" \
--user 'admin':'admin'

 

Thank you,
Palani

Hi @palanikumar,

Where can I add the \"attributes\": in the REST API explorer?