Categories:
  1. Web Services Integration – ServiceNow
  2. What is integration?
  3. Type of Integration
  4. Basic Requirements for Integrate any system
  5. Integration Testing Tools
  6. Integration Module
  7. Inbound Integration
  8. SOAP VS REST API
  9. Table API Web Service – REST
  10. Direct web services – SOAP
  11. Import Set Web Service – SOAP
  12. Import Set API – REST
  13. Scripted Web Services – SOAP
  14. Scripted Web Services – REST
  15. SOAP Message – Outbound
  16. REST Message – Outbound
  17. ServiceNow to ServiceNow Incident Integration
  18. OAuth 2.0 Authentication
  19. ServiceNow – OAuth application connect
  20. Access Token VS Refresh Token

REST Message – Outbound

Another method for outbound is REST Message. Create a REST message and trigger it from the ServiceNow system.

For example, we can take any third-party application. Example:- https://documenter.getpostman.com/

Code to use in BR or UI Action:

try { 
 var r = new sn_ws.RESTMessageV2('TestAPI', 'SendData');
 r.setStringParameterNoEscape('short_description', 'test');
 r.setStringParameterNoEscape('number', 'inc001');
 var response = r.execute();
 var responseBody = response.getBody();
 var httpStatus = response.getStatusCode();
}
catch(ex) {
 var message = ex.message;
}

Total Views: 1350

One response

  1. Hello Rohit,

    I have been following your integration training and I am currently at the 11th video.

    I have tried to use the fake API you have mentioned getting a username and a password, however when I send requests to these endpoints I keep getting 404 errors.

    What I get basically is the following:

    Error Message: Method failed: (/) with code: 404

    Content:

    {
    “method”: “get”,
    “path”: “/INC001”,
    “responses”: [
    {
    “status”: 200,
    “content”: “test”,
    “content_type”: “text/plain”
    }
    ]
    }

    Reponse:

    Heroku | Application Error

    html,body,iframe {
    margin: 0;
    padding: 0;
    }
    html,body {
    height: 100%;
    overflow: hidden;
    }
    iframe {
    width: 100%;
    height: 100%;
    border: 0;
    }

    Could you please let me know what the problem could be?

    I have tried searching on the web, however I see no mentioning of this FakeAPI thing I am trying to run.

Leave a Reply

Your email address will not be published. Required fields are marked *