TypeError: Cannot convert null to an object

This is the body data which I am trying to send. While it is generating a 500 return code in the application, I went and tried to send the data via Postman and get the error mentioned in the title.

At one point there were fields which were set to null, but I cleaned those up. Any empty field has a value of string.Empty in it, and that works when I try to send a different type of record.

{
"short_description":"Job RMFDLYGT failed on SYE3 with CC0012",
"symptom":"job_failure",
"configuration_item":"Enterprise Notification System",
"caller_id":"ENS",
"location":"NY0563",
"description":"Job RMFDLYGT failed on SYE3 with CC0012",
"urgency":"2",
"impact":"2",
"category":"hosting_services",
"subCategory":"mainframe",
"assignment_group":"b63cfbbd1302ee40727db9785144b039",
"work_notes":"MFAAS_ABM_TIER1",
"comments":"",
"external_ticket_type":"ENS",
"u_integration_field_1":"",
"critical_notification":"false"
}

Where do you get the error?

Before, during or after the request? In the console log?

Can you see the request in the console log?

Do you get a status code for the attempted request?

500 errors are usually server side, but can be generated by sending incorrect client information (although you would hope that would generate a different error code).

I get the error after I send the data. I see the same error in the console response body that I do in the window showing the Pretty version of the body response. The status code is 500. This is the code I use for doing the post for both types of records. This works fine for the other type of record.

string recnum = Client.UploadString(new Uri(ServiceNowUrl), “POST”, body);

Code?

Can you share a screenshot of your request, including the error.

What I can’t ascertain is whether the error is being generated by Postman (by code in the pre-request script or tests tab) or in the request response.

This just sounds like you just need to confirm with the API supplier what needs to be sent for that particular record type.

Can you provide the link to the documentation\API spec that you are using to craft this request? (Looks like its Service Now).

Also include what a working record looks like.

If you are sending two requests to the same end point with different bodies, and that is generating the error, then this is more of a question for the supplier.

I sent the data and error message to one of the team members, and got no reply. I’ll send it to an email thread we have going. Here’s the record which works. The format is the same. It is just the data which is different.

{“short_description”:“CITEEOCZ VFE2 WTG DB00501E WTGAMUF:DB00501E - OPEN ERROR - RETURN CODE 74 081 CXX=WTGAMUF FIH00529 MUFNAME=WTGAMUF”,
“symptom”:“OTHER”,
“configuration_item”:“FNE1”,
“caller_id”:“OPSMVS”,
“location”:“NJ0153”,
“description”:“CITEEOCZ VFE2 WTG DB00501E WTGAMUF:DB00501E - OPEN ERROR - RETURN CODE 74 081 CXX=WTGAMUF FIH00529”,
“urgency”:“1”,
“impact”:“2”,
“category”:“HOSTING_SERVICES”,
“subCategory”:“MAINFRAME”,
“assignment_group”:“5dfc77fd1302ee40727db9785144b0d5”,
“work_notes”:“MFAAS_MFDATACOM_SUPPORT”,
“comments”:“”,
“external_ticket”:“”,
“u_integration_field_1”:“OPSMVS”,
“critical_notification”:“true”
}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.