- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 03:55 AM
Can anyone explain what is the difference between scripted rest api and rest message with real-time example?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 04:04 AM
Scripted REST API (ServiceNow):
Purpose: A Scripted REST API in ServiceNow allows you to create a custom API endpoint within the ServiceNow platform, where you can define custom logic and data retrieval to expose specific functionalities or data.
Customization: It is highly customizable and is typically used for creating custom APIs within the ServiceNow platform. You can define the structure of the response, perform data transformations, and even implement custom authentication and authorization logic.
Platform Integration: Scripted REST APIs are often used to interact with and manipulate data within the ServiceNow platform itself.
Example (ServiceNow): Suppose you are a ServiceNow administrator, and you want to create a custom API that returns a list of high-priority incidents along with additional information. You can create a Scripted REST API to define the structure of the response, apply custom filters, and perform any necessary data transformations. This API can then be accessed within ServiceNow or by external systems to retrieve this specific dataset.
REST Message (ServiceNow):
Purpose: In ServiceNow, a REST message is used to make outbound HTTP requests from within the platform to external web services or APIs. It is primarily used for integrating with external systems or services.
Communication: REST messages are not APIs themselves; instead, they are used to send HTTP requests (GET, POST, PUT, DELETE) to external web services or APIs and receive responses.
Integration: REST messages in ServiceNow are essential for connecting your ServiceNow instance to external systems, such as third-party APIs, and fetching data from those external sources.
Example (ServiceNow): Imagine you are using ServiceNow for IT service management, and you need to retrieve incident data from an external incident tracking system. In this scenario, you would create a REST message in ServiceNow to send an HTTP GET request to the external system's API endpoint, fetch the incident data, and then use this data within your ServiceNow instance to maintain an integrated view of incidents from both systems.
Go through below link you will find better understanding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 04:05 AM
Hi @Kishor O ,
A "Rest Message" in ServiceNow is designed for sending updates from ServiceNow to an external system, provided the external system supports REST. It enables you to share data with external applications.
1)Let's say your company uses a weather service to get current weather data, and you want to integrate this data into your ServiceNow incident records.
Example: You create a REST Message named "WeatherAPI" that sends an HTTP GET request to the weather service's API endpoint for retrieving weather data based on a given location. The response from the weather service contains the current weather conditions. You can use this REST Message in a business rule or script to automatically update the weather information in your incident records based on their location.
On the other hand, a "Scripted REST API" allows for inbound updates from an external system. If you need to receive data in ServiceNow and perform custom processing like validations, especially when the standard REST APIs do not support your requirements, you can create a scripted REST web service. This allows you to process incoming requests from external systems and perform custom actions.
1)Suppose you want to provide external partners with access to a list of the latest product prices stored in your ServiceNow instance.
Example-You create a Scripted REST API named "ProductPricing" with an endpoint "/getLatestPrices." In the script for this API, you write code that queries the latest product prices from your database and returns them in a structured format, like JSON. External systems can now make requests to this endpoint to get up-to-date product prices.
Please mark it as solution proposed and helpful if it serves your purpose.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 04:04 AM
Scripted REST API (ServiceNow):
Purpose: A Scripted REST API in ServiceNow allows you to create a custom API endpoint within the ServiceNow platform, where you can define custom logic and data retrieval to expose specific functionalities or data.
Customization: It is highly customizable and is typically used for creating custom APIs within the ServiceNow platform. You can define the structure of the response, perform data transformations, and even implement custom authentication and authorization logic.
Platform Integration: Scripted REST APIs are often used to interact with and manipulate data within the ServiceNow platform itself.
Example (ServiceNow): Suppose you are a ServiceNow administrator, and you want to create a custom API that returns a list of high-priority incidents along with additional information. You can create a Scripted REST API to define the structure of the response, apply custom filters, and perform any necessary data transformations. This API can then be accessed within ServiceNow or by external systems to retrieve this specific dataset.
REST Message (ServiceNow):
Purpose: In ServiceNow, a REST message is used to make outbound HTTP requests from within the platform to external web services or APIs. It is primarily used for integrating with external systems or services.
Communication: REST messages are not APIs themselves; instead, they are used to send HTTP requests (GET, POST, PUT, DELETE) to external web services or APIs and receive responses.
Integration: REST messages in ServiceNow are essential for connecting your ServiceNow instance to external systems, such as third-party APIs, and fetching data from those external sources.
Example (ServiceNow): Imagine you are using ServiceNow for IT service management, and you need to retrieve incident data from an external incident tracking system. In this scenario, you would create a REST message in ServiceNow to send an HTTP GET request to the external system's API endpoint, fetch the incident data, and then use this data within your ServiceNow instance to maintain an integrated view of incidents from both systems.
Go through below link you will find better understanding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 04:05 AM
Hi @Kishor O ,
A "Rest Message" in ServiceNow is designed for sending updates from ServiceNow to an external system, provided the external system supports REST. It enables you to share data with external applications.
1)Let's say your company uses a weather service to get current weather data, and you want to integrate this data into your ServiceNow incident records.
Example: You create a REST Message named "WeatherAPI" that sends an HTTP GET request to the weather service's API endpoint for retrieving weather data based on a given location. The response from the weather service contains the current weather conditions. You can use this REST Message in a business rule or script to automatically update the weather information in your incident records based on their location.
On the other hand, a "Scripted REST API" allows for inbound updates from an external system. If you need to receive data in ServiceNow and perform custom processing like validations, especially when the standard REST APIs do not support your requirements, you can create a scripted REST web service. This allows you to process incoming requests from external systems and perform custom actions.
1)Suppose you want to provide external partners with access to a list of the latest product prices stored in your ServiceNow instance.
Example-You create a Scripted REST API named "ProductPricing" with an endpoint "/getLatestPrices." In the script for this API, you write code that queries the latest product prices from your database and returns them in a structured format, like JSON. External systems can now make requests to this endpoint to get up-to-date product prices.
Please mark it as solution proposed and helpful if it serves your purpose.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2024 02:49 AM
I am bit confused in example that you provide.