Outbound Rest API throwing error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2024 10:34 AM
Hi Team,
I need to integrate SNOW to SNOW using App Studio. I have created Outbound REST (POST) to send data. When I test this connection in REST Messages, it works and gives 201 (success).
But when I try to use it in the Script-include it gives the error "function getStatusCode() {[native code, arity=0]}"
Here is the Below script that I am passing through Script-Include but getting error "function getStatusCode() {[native code, arity=0]}"
===============================
var r = new sn_ws.RESTMessageV2('API Integration', 'Acknowledge Service Ticket');
r.setStringParameterNoEscape('TicketNumber', current.u_external_ticket_no);
r.setStringParameterNoEscape('CustomerTicketNumber', current.number);
gs.info(r);
var response = r.executeAsync();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode;
gs.info(httpStatus);
var parser = new global.JSON();
var responseObj = parser.decode(responseBody);
return responseObj;
=========================
Need help on this, if anyone found this issue and a solution for this.
Thanks
Balaji Prusty

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2024 12:59 PM
I think you missed a bracket in below line for getStatusCode()
var httpStatus = response.getStatusCode;
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2024 08:00 PM
Thanks, Sanjiv,
After fix the bracket, now getting the error "Status code from Taliom: 500" but when I test in Outbound Test (post) it is working fine.
Onle diff b/w outbound rest and script include is "r.executeAsync()". In the scoped app it is asking to use "executeAsync()" but when I generate the script in outbound rest it is showing "r.execute()".
Can you please help why error 500 is throwing.
Thanks
Balaji Prusty