I am writing a script to retrieve data from one of our Data Extensions, and send it to an external API. Here is my script for this:
<script runat="server">
Platform.Load("core", "1.1.5");
var SMS_RBBB = "External ID for DE";
var dataRows = DataExtension.Init(SMS_RBBB).Rows.Retrieve();
var endpointUrl = "https://api.attentivemobile.com/v1/attributes/custom";
var bearerToken = "My Bearer Token";
for (var i = 0; i < dataRows.length; i++) {
var payload = {
properties: {
zipcode: dataRows[i]["ZIP_CODE"]
}
,
user: {
phone: dataRows[i]["MOBILE_PHONE"]
}
};
try {
var result = HTTP.Post(endpointUrl, "application/json", Stringify(payload), {
"Authorization": "Bearer " + bearerToken}
);
var jsonResponse = Platform.Function.ParseJSON(result.Response);
Write(Stringify(jsonResponse));
}
catch (e) {
Write("Error occurred: " + e.message);
}
}
</script>
When running this script, I receive the error: Error Message: Error occurred: Unable to retrieve security descriptor for this frame
This error is returned over and over for each record from the DE. Any input would be greatly appreciated.
Thanks,
Nick