GlideStringUtil.base64Decode returning an JSON object rather String

MadavapeddiK
Tera Contributor

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

5 REPLIES 5

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