Skip to main content
Version: Streamsheets 3.0

HTTP Requests

HTTP Requests start an exchange of information to an HTTP server. There are different requests called "methods," and every HTTP server requires other headers, payload, or authorization types to allow a valid request. This is usually documented in the documentation of the HTTP server you try to reach. The most generic approach to connect to any HTTP server is using the function HTTP.REQUEST(). There are other functions like HTTP.GET() or integration functions serve direct access to APIs (Openweather, Binance, etc.).

HTTP Request

This tutorial covers two different kind of HTTP/REST Calls, one is POST and the other is GET. The differences are that with a "POST" information is transmitted from the HTTP Client to a server and a "GET" transmits information to the HTTP Client from the server.

1. Method "Post": As an example, for an HTTP Request with the method. "POST," we will create an alert service for Slack. Slack is a messenger which offers the possibility to add self-made applications. We will use this option to add an Alert Application to a Slack channel, posting status updates.

To begin, create such an App in Slack and add an Incoming Webhook. This generates the HTTP. Request the URL we will be posting information. Choose a Channel on Slack to add your Application to. This is where we will post the information to. Now we can start building an App in Streamsheets. Create a new App and create a JSON Range with the key Value is "text," and the Value is any message you would like to send. Create an HTTP Request function and select "POST" as the method. Add the created URL and select the JSON Range as the body. Choose a Target (e.g., a cell range) for the server's response message. Now with every new Step, the App will send your message to Slack 😊

slackwebhook

slackwebhook

2. Method "GET": The "GET" method is very similar to the "POST." method, but in this case, we do not need to define any message because we will be consuming messages. A good example is the "API of Ice and Fire" https://anapioficeandfire.com/. It is an HTTP Request based online wiki for Game of Thrones-related Information. Depending on the URL, different Information can be accessed and displayed. Let's choose the following URL: https://anapioficeandfire.com/api/characters/583. It shows all Information regarding Jon Snow in a JSON-Object. So lets again create a new App. Add an HTTP.Request Function to a cell. Enter the URL, select "GET" as the method and choose the Target, where it should display the Information (e.g. INBOX). Confirm your input by clicking "OK." After starting the App, the requested Information will now appear in the Target Range.

Your function will look like this: =HTTP.REQUEST("https://anapioficeandfire.com/api/characters/583","GET",,,,INBOX()) or =HTTP.GET("https://anapioficeandfire.com/api/characters/583")

httpreq