REST Web Service
  • 26 Mar 2024
  • 4 Minutes to read
  • PDF

REST Web Service

  • PDF

Article summary

REST Web Service for Service Automation 
What is a Webhook?

Webhooks are tools that allow one web service to communicate with another and pull data from that service. Applications use webhooks when they need to connect with one another. Webhooks can also alert/notify the connected applications of a change in the system.

Let us consider a simple example of how webhooks work:

Figure: Interaction between E-commerce and Banking application

The process is as follows:

  1.  The customer places an order in an E-commerce shopping application.
  2.  This application requires customers' bank account details to have a smooth payment operation. This is possible by establishing a connection with a Banking Service application.
  3.  The Banking application (Source) sends a webhook when a customer does a payment (Event Trigger) to the E-commerce application's email service (Destination). This connection is possible with Webhooks.
  4.  Banking system's webhooks include information about the charge (Event data), which the emailing service of the shopping application uses to construct a suitable message for the customer.
  5.  The customer then receives the payment success notification through E-commerce application.

Webhook can be technically defined as follows:

A Webhook is an HTTP request that is delivered to a destination system in response to an event in the source system and frequently includes a payload of data. Webhooks are automated; as such, they are automatically sent when an event is triggered in the source system.
This gives one system (Source) a method to communicate with another system ( Destination) when an event occurs and share information (Request payload) about the event that occurred.

Webhook and API: The Difference

API and Webhooks, both enable two-way communication between software applications. While both perform a similar function, there is a fine line of difference between them. 

Let's dive deep and understand the difference!

Figure: Webhooks and API- The difference 

APIs require manual requests to retrieve or modify data. Webhooks automatically send data in response to a specified event without the need for a request from another software application. Webhooks are a subset of APIs, and they can only send information.


Below illustration lists the basic differences between Webhooks and APIs:

Figure: Webhook vs API

Why is a Webhook important?

The web is ruled by information, and acquiring information instantly boosts the efficiency and responsiveness of online businesses. Today's value of internet services is largely due to separate web platform's connectivity and data sharing.
Webhooks provide a simple method for enabling real-time information transmission between internet platforms.

Webhooks are important for the following reasons:

1. Real-time and efficient communication
2. Flexibility
3. Better user experience 
4. Easy integration
5. Event-driven architecture
6. Cost savings

Webhooks: Getting started

There are two commonly used HTTP methods for webhooks : GET and POST

GET Webhook

1. A GET webhook utilizes a GET request to retrieve data from a designated resource.
2. Event information is conveyed through query parameters within the URL.
3. This approach allows for acquiring server information or initiating processes based on the specifics provided within the query parameters.

POST Webhook

1. A POST webhook leverages a POST request to transmit data to a server for the purpose of creating or updating a resource.
2. The event data is conveyed within the request body as a JSON payload.
3. This approach facilitates adding, updating, or deleting data from the server, or prompting the recipient application to take certain actions based on the received information.

Note:
  • Generally, POST webhooks are deemed to be more secure than GET webhooks since the data payload can be encrypted and is not visible in the URL.
  • GET webhooks are easier to debug as the information is included in the URL.
  • The choice between utilizing GET or POST webhooks depends on the specific use case, the amount and type of data being transmitted, and other factors.

REST Web Service in Service Automation

Webhooks allow integration of Summit Service Automation with other applications, which enables sending information from Summit Service Automation to external applications such as ITSM solutions, Automation solutions, etc.

It is done as follows:

1. The REST Web Service can be invoked and consumed through Workflow Designer.
2. The REST Web Service option provides both GET and POST methods.
3. GET and POST can be used easily in a workflow by drag-and-drop functionality.

Use Case

Let us consider a simple use case of new employee onboarding process. On successful completion of onboarding, the employee must receive a WhatsApp message with the relevant details like AD ID, Email ID, and access codes. 

To understand this use case, refer to the following flow diagram:

Figure: Employee onboarding flow diagram

The process flow is explained as follows:

1. HR Manager initiates the new employee onboarding process by updating all the relevant details of the employee to HRMS portal. 
Examples of HRMS portal: SAP, PeopleSoft, Workday, etc

2. Automation Trigger (API call) triggers the Summit Service Automation application.

3. Workflow containing employee onboarding script along with POST Web Service script is executed. 

Note:
POST Web Service is used in this use case, as this activity involves the data collection from the source and providing an update to destination.

4. Post execution of both scripts, the activities mentioned in the flow diagram are performed successfully.

Curious to see how this configuration is performed in the application?
Don't stop here! Head to Configure REST Web Service to learn more. 



Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.