GlideStringUtil.base64Decode returning an JSON object rather String
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā12-04-2024 11:56 AM
Hi All,
Thanks in advance for assisting me in resolving the issue.
I am trying to convert an encoded base64 to JSON object and read content.
Ex: encoded base64 message as below when I decode and JSON parse throwing an error
var inputMessage = "eyJndWlkIjoiMjhmZDdiYmQtM2U2Ny00MDMwLTlhN2YtN2YzMzk1Zjc3Nzg2IiwiYWN0aW9uIjoidXBkYXRlIiwiZmllbGRzIjoiZW1haWwsbGFzdF9uYW1lIn0=";
//inputMessage = inputMessage.pathParams.obj.toString();
var decodedString = GlideStringUtil.base64Decode(inputMessage); // this is returning typeof --object
var responseData = JSON.parse(decodedString);//I am getting error as unauthorisedtoken: u
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā12-05-2024 02:34 AM
Hello @MadavapeddiK
Glad to know that the queries are solved.
If this helped, can you please mark it as helpful and accepted solution. It will help other to find the solution easily.
Thank You
Juhi Poddar