Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Integration

b__HanumeshM
Tera Contributor

Can anyone please explain below question with simple examples:-

-Scripted REST API

-REST 

*REST API Explorer

- API

- Outbound*REST Message

- Inbound and outbound Integration
and please provide you tube links related to integration to start  from basics.

Thanks 😉

1 ACCEPTED SOLUTION

SP22
Giga Sage

Hello @b__HanumeshM,

Please find the below data and let me know whether it is useful or not.

1. Scripted REST API:

 

In ServiceNow, a scripted REST API allows developers to create custom endpoints that can receive and send data using HTTP methods (GET, POST, PUT, DELETE).


https://docs.servicenow.com/bundle/xanadu-api-reference/page/integrate/custom-web-services/concept/c...

 

Example: You can create a Scripted REST API to fetch incident details. When a user sends a GET request with an incident number, the scripted REST API will return incident details in JSON format.

 

 

(function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {

    var incidentNumber = request.queryParams.incident;

    var gr = new GlideRecord('incident');

    gr.get('number', incidentNumber);

    response.setBody(gr);

})(request, response);

 

 

2. REST:

 

REST (Representational State Transfer) is a set of principles for designing networked applications, allowing for communication between systems via HTTP.


https://docs.servicenow.com/bundle/utah-api-reference/page/integrate/inbound-rest/concept/c_RESTAPI_...

Example: In ServiceNow, you can call an external system's REST API using the REST Message functionality to send data or retrieve information.

 

 

 

3. REST API Explorer:

 

This is a tool within ServiceNow that allows you to quickly test REST endpoints by sending requests to ServiceNow or other systems.


https://developer.servicenow.com/dev.do#!/learn/learning-plans/washingtondc/servicenow_application_d...

Example: If you want to test the incident retrieval API, you can input the incident number and use GET in the REST API Explorer to check the response.

 

 

 

4. API:

 

API (Application Programming Interface) is a broader concept that refers to a set of rules that allows one software application to interact with another.


https://developer.servicenow.com/dev.do#!/learn/learning-plans/xanadu/new_to_servicenow/app_store_le...

Example: ServiceNow provides various APIs like the GlideRecord API to interact with its database and perform CRUD (Create, Read, Update, Delete) operations.

 

 

 

5. Outbound REST Message:

 

This is a message sent from ServiceNow to an external system using the REST protocol.


https://developer.servicenow.com/dev.do#!/learn/learning-plans/washingtondc/servicenow_application_d...

Example: If you want to send data from ServiceNow to an external CRM system, you would configure an outbound REST message to send the data, such as customer information, from a ServiceNow form to the CRM system.

 

 

var restMessage = new sn_ws.RESTMessageV2('External System', 'POST');

restMessage.setStringParameterNoEscape('name', 'Customer Name');

var response = restMessage.execute();

 

 

6. Inbound and Outbound Integration:

 

Inbound Integration refers to data coming into ServiceNow from an external system.

 

Outbound Integration refers to data being sent from ServiceNow to an external system.


https://docs.servicenow.com/bundle/washingtondc-financial-services-operations/page/product/fso-commo...

Example: Inbound - an external system sends a ticket update via REST to ServiceNow. Outbound - ServiceNow sends incident creation data to an external monitoring tool.

Thanks
SP

View solution in original post

3 REPLIES 3

SP22
Giga Sage

Hello @b__HanumeshM,

Please find the below data and let me know whether it is useful or not.

1. Scripted REST API:

 

In ServiceNow, a scripted REST API allows developers to create custom endpoints that can receive and send data using HTTP methods (GET, POST, PUT, DELETE).


https://docs.servicenow.com/bundle/xanadu-api-reference/page/integrate/custom-web-services/concept/c...

 

Example: You can create a Scripted REST API to fetch incident details. When a user sends a GET request with an incident number, the scripted REST API will return incident details in JSON format.

 

 

(function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {

    var incidentNumber = request.queryParams.incident;

    var gr = new GlideRecord('incident');

    gr.get('number', incidentNumber);

    response.setBody(gr);

})(request, response);

 

 

2. REST:

 

REST (Representational State Transfer) is a set of principles for designing networked applications, allowing for communication between systems via HTTP.


https://docs.servicenow.com/bundle/utah-api-reference/page/integrate/inbound-rest/concept/c_RESTAPI_...

Example: In ServiceNow, you can call an external system's REST API using the REST Message functionality to send data or retrieve information.

 

 

 

3. REST API Explorer:

 

This is a tool within ServiceNow that allows you to quickly test REST endpoints by sending requests to ServiceNow or other systems.


https://developer.servicenow.com/dev.do#!/learn/learning-plans/washingtondc/servicenow_application_d...

Example: If you want to test the incident retrieval API, you can input the incident number and use GET in the REST API Explorer to check the response.

 

 

 

4. API:

 

API (Application Programming Interface) is a broader concept that refers to a set of rules that allows one software application to interact with another.


https://developer.servicenow.com/dev.do#!/learn/learning-plans/xanadu/new_to_servicenow/app_store_le...

Example: ServiceNow provides various APIs like the GlideRecord API to interact with its database and perform CRUD (Create, Read, Update, Delete) operations.

 

 

 

5. Outbound REST Message:

 

This is a message sent from ServiceNow to an external system using the REST protocol.


https://developer.servicenow.com/dev.do#!/learn/learning-plans/washingtondc/servicenow_application_d...

Example: If you want to send data from ServiceNow to an external CRM system, you would configure an outbound REST message to send the data, such as customer information, from a ServiceNow form to the CRM system.

 

 

var restMessage = new sn_ws.RESTMessageV2('External System', 'POST');

restMessage.setStringParameterNoEscape('name', 'Customer Name');

var response = restMessage.execute();

 

 

6. Inbound and Outbound Integration:

 

Inbound Integration refers to data coming into ServiceNow from an external system.

 

Outbound Integration refers to data being sent from ServiceNow to an external system.


https://docs.servicenow.com/bundle/washingtondc-financial-services-operations/page/product/fso-commo...

Example: Inbound - an external system sends a ticket update via REST to ServiceNow. Outbound - ServiceNow sends incident creation data to an external monitoring tool.

Thanks
SP

Thank you @SP22 😊