4

Trying to query a 3rd party API through a post request from a SSJS script. However, I get the following error:

System.Net.Sockets.SocketException: A connection attempt failed 
because the connected party did not properly respond after a period of 
time, or established connection failed because connected host has 
failed to respond XX.XX.XX.XX:8088 - from System

In postman I can query the API successfully in a reasonable time (500ms), well under the SFMC timeout of 30s. However I can't query the API from SFMC. I can get SFMC to query the 3rd party website on port 80 correctly.

I noticed on the following page, it says that the HTTPost fails if it attempts to connect to HTTP to a port that's not 80. https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-programmatic-content.meta/mc-programmatic-content/ssjs_platformContentSyndicationHTTPPost.htm

However, I noticed that there's no such restriction on this page: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-programmatic-content.meta/mc-programmatic-content/ssjs_httpPost.htm

So I suspect it may have something to do with the port being 8088. Anyone else seen anything like this before?

2

Sadly this is not possible. I discussed this with SFMC developers who received my ticket.

If it's not on port 80 on HTTP or port 443 on HTTPS, both the HTTPPost, HTTP.Post and Script.Util.HttpRequest will fail.

I created a cloud page to try all of these, and always the same exception:

System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond XX.XX.XX.XX:8088 - from System

I managed to convince the 3rd party to host their API on port 80 over HTTP and it worked; so it looks like definitively the non-standard port was the cause of the exception.

|improve this answer|||||
  • Thanks for the follow up with your solution and information! – Gortonington Feb 15 '19 at 14:28

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.