REST
It's easy to send REST requests from Airplane. With REST tasks, you can build / use existing APIs and have Airplane act as an interface to them.

Getting Started

Visit the New Task page to get started.

Define Your Task

You'll be asked to give your task a name and (optional) description.

Parameters

Like other tasks, SQL tasks support parameters. Parameters have slugs (a human-readable ID) and can be interpolated into queries by entering {{slug}}.
Parameters can be used in most fields, but they cannot be used in URL parameter keys or header keys. If you try to use parameters in these fields, you will receive a warning.
Parameters show the slug underneath. For example, this parameter "User Email" has a slug "user_email":

Build Your Task

Select the REST API resource you'd like to query. If you don't have any configured, you'll see a link that takes you to create a new resource.
Specify the method, path, and other details of your REST request:
Here, you'll be able to interpolate the parameters you specified earlier. By using the parameter slug in curly braces, the parameter value will get inserted into the request.
For example, this would interpolate the entered email into the path:
A user who runs this task with [email protected] as the user_email would make an HTTP request to /users/[email protected].
You can interpolate in path, URL parameters, headers, and the body.
For example, this interpolates user_name into a JSON request body:

Configure Settings

In this last step, you can optionally configure permissions, timeouts, and run constraints. These settings are optional.
That's it! Finish the task creation wizard and you have a shrinkwrapped task for safely making REST requests.

Interpolation Limitations

When constructing a JSON body with parameters, you should quote the parameter if it needs quoting (e.g. string-type). For number types and booleans where the value should not be quoted, the parameter should also not be quoted.
1
// Example JSON body.
2
// location is a string and should have quotes.
3
// count is a number and should NOT have quotes.
4
{
5
"location": "{{location}}",
6
"count": {{count}}
7
}
Copied!
Note that if you are ending a JSON object with a parameterized value, you should separate the double ending curly brace of the parameter from the single ending curly brace of the object, otherwise the body will not parse:
1
// Correct
2
{ "location": "{{location}}", "format": {{format}} }
3
// Wrong
4
{"location": "{{location}}", "format": {{format}}}
Copied!
Last modified 3mo ago