Outbound REST Post Request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2018 04:34 AM
Hello, I have set up an outbound POST REST request to a third party endpoint. When I test this within my developer instance it returns a valid response. I am sending no parameters.
I have created a business rule and copied the code implementation script. However, when I try and run the same request from the business rule I get a HTTP status 500 response returned from my endpoint.
If I run the request using execute() I get "Illegal access to outbound HTTP in getFileDrop. Use an async business rule to perform outbound HTTP requests."
To repeat, the call works from the 'test' button link within SN, but not when called from the business rule it fails. My thinking is that the request for this Post has some sort SSL Handshake error when rule form the business rule?
Can anyone help?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2018 11:06 AM
Hi Simon,
Can you post your business rule here?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2018 11:40 AM
Really difficult to say without seeing the BR but it might be a good idea to compare the request-bodys between the test you trigger and the one created from the BR just to see if there are any differences that might cause the issue. Just write the requestbody to the logs like below
var requestBody = r.getRequestBody();
gs.info("This is the requestbody:" + requestBody);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2018 02:01 AM
Hi Sree, Simon
My business rule script is:
var r = new sn_ws.RESTMessageV2('x_256847_deltek_po.Deltek', 'GetFileDrop');
var response = r.executeAsync();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();
gs.addInfoMessage( httpStatus );
responseBody is empty, a status 500 is retruned. If I run it in Outbound Integrations | REST Messages I get a 201 status code and a valid body:
{"location":"http://myEndPoint/filedrop/v1/dev/7583593909590593545"}
It is odd as I can successfully make other POST calls to this third party site. I can only assume the business rule packages this particular HTTP request in a different way to the Outbound Integrations call, and thus rejects with a 500 response code

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2018 11:31 AM
What kind of BR are you running it on? Before, after, etc?