What does the action do?

Zluri action : Make an HTTP request lets you make an API call to any 3rd party application, your on-prem application or any automation platform to automate an action which is already not present in zluri.

Use cases

Making an API call to any application if you have the correct body parameters and authorisation can automated a few actions on any application that zluri can’t directly talk to or rely on an integration

  1. Automate on an On-prem application or a custom application : Making an API call makes it possible to automate any task if you have the correct parameters to setup the action

  1. Make a call to a 3rd party application: Incase you have already an integration internally set in a 3rd party application, you can use zluri’s make an http request action to trigger that integration or any action

  1. Trigger an event : Incase you have an automation in place to trigger an event, alert or any action, zluri’s make an http request action can solve the purpose.

API requests defined

Zluri action enables you to create and send API requests to third party applications.

Methods available

  • GET retrieves data from an API.

  • POST sends new data to an API

  • PATCH and PUT update existing data.

  • DELETE removes existing data.

Send a request to an endpoint, retrieve data from a data source, or test an API's functionality. You don't need to enter commands in a terminal or write any code. Create a new endpoint and the API response appears right on the application through Zluri.

Where to find the action?

Ready to send your first request?

  1. Head to Workflows and create a New workflow/Playbook

  1. In the Application search bar, Click on the Zluri Actions

  1. Click on Add an action -> Make an HTTP Request

  1. Setup the action

Understanding more about an HTTP Request:

Request

An HTTP request must have the following:

A request can also optionally have:

  • Body

  • Headers

  • Query strings

  • HTTP version

Response

A response must have the following:

  • Protocol version (like HTTP/1.1)

  • Status code (like 200)

  • Status text (OK)

  • Headers

A response may also optionally have:

  • Body

HTTP Methods Explained

Now that we know what HTTP is and why it’s used, let’s talk about the different methods we have available to us.

These are all different functions – retrieve data, update data, create new data – and there are HTTP methods for all of these.

HTTP POST request

You can use POST to create a new resource. A POST request requires a body in which you define the data of the entity to be created.

A successful POST request would be a 200 response code.

HTTP GET request

You can use GET to read or retrieve a resource. A successful GET returns a response containing the information you requested.

HTTP PUT request

You can use PUT to modify a resource. PUT updates the entire resource with data that is passed in the body payload. If there is no resource that matches the request, it will create a new resource.

HTTP PATCH request

You can use PATCH to modify a part of a resource. With PATCH, you only need to pass in the data that you want to update.

HTTP DELETE request

You can use DELETE to delete a resource. In our weather app, we could use DELETE to delete a city we no longer wanted to track for some reason.

HTTP Method FAQs

What’s the difference between PUT and POST?

PUT requests are idempotent, meaning that executing the same PUT request will always produce the same result.

On the other hand, a POST will produce different outcomes. If you execute a POST request multiple times, you'll create a new resource multiple times despite them having the same data being passed in.

What’s the difference between PUT and PATCH?

The key differences are that PUT will create a new resource if it cannot find the specified resource. And with PUT you need to pass in data to update the entire resource, even if you only want to modify one field.

With PATCH, you can update part of a resource by simply passing in the data of the field to be updated.

What if I just want to update part of my resource? Can I still use PUT?

If you just want to update part of your resource, you still need to send in data for the entire resource when you make a PUT request. The better-suited option here would be PATCH.

Why is a body optional for a request and response?

A body is optional because for some requests, like resource retrievals using the GET method, there is nothing to specify in the body of your request. You are requesting all data from the specified endpoint.

Similarly, a body is optional for some responses when a status code is sufficient or there is nothing to specify in the body, for example with a DELETE operation.

HTTP Request Examples

Now that we’ve covered what an HTTP request is, and why we use them, let’s make some requests! We’re going to be playing with the GitHub Users API.

You will need a GitHub account for this.

A quick walkthrough:

  • There is a drop down menu where you can select the method you want to create a request with.

  • There is a text box where you should paste the URL of of the API endpoint you want to access.

  • There is a Headers section where we will be passing in headers as instructed by the GitHub docs. (You can either copy the cURL and paste the raw data in postman to get the headers and other values as well)

  • There is a body area where we will pass in content to our body as instructed by the GitHub docs.

  • After running, the recent run screen log of that workflow will quickly let you know if your request was successful. If it is ‘Completed’, you successfully made your request, and if it's ‘Failed’ there was an error.

Did this answer your question?