REST API extended special characters
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2021 03:05 PM
Hi, the “????” (eye chars) in the following REST POST JSON payload is resulting in HTTP 500 failure. Is there anyway available to pass these characters?
{
"sysparm_quantity": 1,
"variables": {
"AS_Support_var112": "Engineering Request",
"Messaging_Detailed_Desc": "High Priority: Message Pullback Request\nPlease prioritize this request in order to mitigate the threat contained within these emails.\r\nWe need your assistance with removing the following email(s) from users' mailboxes and also submitting a sample to Cisco to classify the email(s) as Phishing/Malware to prevent their future delivery. These emails were delivered as part of a recent phishing campaign that GCR observed.\r\n\r\nPhishing Email(s) Details\r\n\r\nSender: marketing@mention.com\r\n\r\nRecipient: XXX.XXX@XXX.com, XXX.XXX@XXX.com\r\n\r\nSubject: XXX.XXXAdmin #o38A3s#, \", which Christmas song are you? ????\"\r\n\r\nAttachment Name: \r\n\r\nDelivery Timeframe: \r\n\r\nEmail Type: Phishing/Malware\r\n\r\nPlease contact GCR if you require any additional information.",
"common_ReqBy": "7e0675dadb215090e6a99ac4db96193f",
"common_ReqFor": "7e0675dadb215090e6a99ac4db96193f"
}
}
Thank you, Charlie
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2021 09:35 PM
Did you replace the "????" in this post substituting the eye chars so that it doesn't display as the eyes in this post?
Or are the question marks being replaced from however the payload is being generated?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2021 02:05 PM
Thanks guys,
The eye chars were in the text when I pasted it into the Now support form, and was changed to "????" by the form processing.
I tried both of those encoded character sequences by directly replacing the eyes in the form. When the REST API created the RITM on the other instance, the encoded character sequences were displayed as is. Perhaps if I do this programmatically it would work? First I'll need to determine how to identify and parse those eyes... TBD...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2021 03:45 AM
On the sending side, stringify() the json and use urlencode(). This is replace the eye character with encoded sequence.
var obj = {}; // json message to send
var json = JSON.stringify(obj); // convert json to string
json = GlideStringUtil.urlEncode(json);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2021 08:21 AM
Thank you for your reply. This did partially work, although as this is a scoped app I had to replace urlEncode() with encodeURIComponent(). The issue remaining is that the uncoded value on the target server, of which we don't have direct access, remains encoded, so this not really usable. The REST API I'm invoking is /api/sn_sc/servicecatalog/items/${sys_id}/order_now.