If API JSON payload contains '%' (Percentage) character then REST call is not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2015 12:54 PM
If description or short_description fields contains '%' then API response getting as 200 but no incident id in response as incident is not created in ServiceNow. Is this issue with sending side or ServiceNow side? If I remove the '%' from payload then it was working fine.
The sample payload i am using is
{
"third_party_incident_number":"00000000012",
"company":"xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"caller":"xxxxxxxxxxxxxxxxxxxxxxxxxxx",
"service_offering":"xxxxxxxxxxxxxxxxxxxxxxxxxxx",
"configuration_item":"xxxxxxxxx",
"urgency":"Medium",
"category":"Error",
"assignment_group":"XXXxxxxxxx",
"short_description":"Average (5 samples) total cpu is now 80.19%, which is above the warning threshold (80%)",
"description":"Average (5 samples) total cpu is now 80.19%, which is above the warning threshold (80%)"
}
I verified whether above JSON payload is valid or not in JSONLint - The JSON Validator.and confirmed it was valid JSON

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2015 09:04 PM
Hi Srini,
use encodeURI() to encode payload.
--
Cheers,
AR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2015 09:29 PM
Hi Srini,
I suggest you to use encode your payload with encodeURIComponent(payload). This will ensure encoding special characters.
Thanks
Srini