So I have the following values in my flow variable
{"Accounts":"[{\"AccountId\":\"ABC123\",\"MaskedAccountNumber\":\"***123\"}]"}
And I want to throw this to the backend/endpoint I’m calling unescaped. How do I do that in apigees JS Policy / JS File?.
I already tried using
var decoded= unescape(variable_name);
and
var decoded = decodeURI(variable_name);
And, they just don’t work. ![]()
Here is my JS code
var link_accounts ={
"Accounts" : context.getVariable(decodeURIComponent("accesstoken.Accounts")) ,
"BillerCode": context.getVariable("accesstoken.BillerCode") ,
"UserAccessToken": context.getVariable("accesstoken.UserAccessToken") ,
"access_token": context.getVariable("apigee.access_token") ,
"refresh_token" : context.getVariable("refresh_token")
}
context.setVariable("link_accounts",JSON.stringify(link_accounts));