HTTP
Last updated
Last updated
In the last section, we explained how Webhooks work. In this section, you'll learn about other components that come under the HTTP module in Appmixer. Namely, we'll talk about some of the most common HTTP requests like POST, PUT, GET, RESPONSE, UPTIME or DELETE.
To start using HTTP requests in Appmixer, drag the "HTTP" module from the left panel and drop it to the canvas.
Note that there are multiple requests you can send using Appmixer.
Webhooks This trigger is fired every time a request is delivered to the URL that was generated for you in the Webhook configuration. ➡️ Learn more about Webhooks
DELETE This action sends HTTP DELETE request to external services.
GET This action sends HTTP GET request to external services.
POST This action sends HTTP POST request to external services.
PUT This action sends HTTP PUT request to external services.
RESPONSE This component sends an HTTP response to an app that initiated the request to the Webhook URL. Use the Response in combination with the Webhook component if you want to send back to the client data that are a result of your flow pass. For example, in a flow like Webhook -> ListGoogleSpreadsheets -> Response, the app that initiated the HTTP request to the Webhook URL will receive a list of spreadsheets in a JSON response.
UPTIME Periodically checks if a site is up or down. Message is sent to output port when site's availability is changed (site goes up or down).
Let's look at an example where the GET method is used. Say we wanted to get the current Bitcoin price (USD) to our email every day at 10 AM. Knowing there are open APIs that allow us to get the current Bitcoin price, the setup in Appmixer will already be pretty simple.
We'll start the flow with the Scheduling module that will be presented later in the Knowledge Base. For now, let's just say this trigger makes sure the flow starts every day at 10 AM.
Next, we want to use the HTTP module or, more specifically, the GET component. We need to define the Host URL from which we'll gather the data. In this example, we use this Host URL to get the current Bitcoin price: https://min-api.cryptocompare.com/data/price?fsym=BTC&tsyms=USD
Almost done! The last piece of the puzzle is the "SendEmail" component that will ensure we get notified via email when the flow executes. Let's set the email address, subject, and as the body of the email, we may want to use the current Bitcoin price. Notice how we use both Variables and Modifiers to extract the data we need.
It's important to note that the way you alter the data using Modifiers depends on the response you get when calling the API. In our case, we set the JSON path to "USD".
Once we hit the "Start Flow" button, miracles happen... Well, maybe not miracles, but we certainly get the current Bitcoin price sent to our email address.
You may wonder why we received the email immediately after launching the flow, and not at the 10 AM we defined in the trigger. There is a little toggle that says "Trigger immediately" in the Scheduler trigger setup. If this is turned on, the Scheduler triggers immediately when it's started.
Now that you know how to use HTTP requests, let's look at another powerful Utility module, Filters.