it seems I'm stuck with the SSJS code to retrieve the short.io response.Do you know why i'm getting the no response or status -2 call failed as per HTTP.Response?
Please find below my code and screenshots showing the POSTMan results.
<script runat=server>
Platform.Load("core", "1.1.1");
var payload = '{';
payload += '"domain": "i58.short.gy",'
payload += '"https://mail.google.com/mail/u/0/?tab=rm&ogbl#inbox/FMfcgxwLtZxtzfxMzzdMfqMbsgSbdZTq",'
payload += '"allowDuplicates": false'
payload += '}';
var auth = 'XXX';
var req = new Script.Util.HttpRequest('https://api.short.io/api/links');
req.emptyContentHandling = 0;
req.retries = 2;
req.continueOnError = true;
req.contentType = ("Content-Type","application/json");
req.setHeader("authorization", auth);
req.method = "POST";
req.postData = payload;
var resp = req.send();
try {
var result_status = Platform.Function.ParseJSON(String(resp.returnStatus));
var result_status_code = Platform.Function.ParseJSON(String(resp.statusCode));
var result_header = Platform.Function.ParseJSON(String(resp.headers));
var result_content = Platform.Function.ParseJSON(String(resp.contentType));
Platform.Response.Write("<br>Status:"+result_status +"");
Platform.Response.Write("<br>Status Code:"+result_status_code +"");
Platform.Response.Write("<br>Return header: "+result_header+"");
Platform.Response.Write("<br>Return content: "+result_content+"");
} catch (e) {
Write(Stringify(e));
}
</script>
These are the CloudPage results and PostMAN evidence that I get a 200 success status response.
If you encounter any solution, I will be gladly appreciated ! Many thanks