- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 05:24 AM
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 😉
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 05:54 AM - edited 09-16-2024 05:55 AM
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).
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.
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.
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.
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.
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.
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 05:26 AM
looks like duplicate question to https://www.servicenow.com/community/intelligence-ml-forum/rest-integration/m-p/3046196#M1232
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 05:54 AM - edited 09-16-2024 05:55 AM
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).
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.
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.
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.
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.
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.
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 07:34 AM
Thank you @SP22 😊