0

In my marketing cloud, landing page. Getting the error "System.InvalidOperationException: Unable to retrieve security descriptor for this frame" while trying to Parse the JSON response in a HTTP Post call.

The response is received perfectly in respContent shown below. The response has shortLink - unable to parse it to extract the shortLink. The issue is with Platform.Function.ParseJSON(result.Response);

I did try other solutions provided on SFSE but didn't work too.

Code

var url = 'xxxxxx';
var contentType = 'application/json';
var payload = '{"longDynamicLink": "https://xxxxx/?link='+encoded';
var headerNames = ["name"];
var headerValues = ["application/json"];
var result = HTTP.Post(url, contentType, payload, headerNames, headerValues);
var content = Platform.Function.ParseJSON(result.Response);

Write("<br/>respContent :" + result.Response +"<br/>");
Write("<br/>shortLink :" + content.shortLink+"<br/>");

Output

respContent :{ "shortLink": "https://xxx.link/89eQ",
 "previewLink": "https://xxx.link/89eQ?d=1" }

    The error is :{"message":"Unable to retrieve security descriptor for this frame.",
"description":"System.InvalidOperationException: Unable to retrieve security descriptor for this frame. - from mscorlib\r\n\r\n"}
2

Found the fix.

Had to use [0] for the response.

var content = Platform.Function.ParseJSON(result.Response[0]);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.