API Endpoints and App Access Tokens
All applets have the following API endpoints:
[app-slug].zipper.run/[path]/api/json
: returns applet run metadata, along with the output, as JSON[app-slug].zipper.run/[path]/api/yaml
: returns applet run metadata, along with the output, as YAML[app-slug].zipper.run/[path]/raw
: returns only the output of the applet without any changes
$ curl -X POST \
--header "Content-type:application/json" \
--data '{ "name":"Earth"}' \
https://greeting.zipper.run/api/json
{
"ok": true,
"data": "Hello, Earth!",
"__meta": {
"request": {
"executionId": "5c74d40c-b4df-41ae-900c-3eaebb9a1d65",
"server": "deno/aws-us-west-1",
"timing": "system;dur=0,deployment;dur=1"
}
}
}
Zipper supports GET
and POST
requests to these endpoints. For GET
requests, inputs can be supplied as query parameters. For POST
requests, inputs should be provided as JSON in the body of the request.
Personal access tokens
If the output of your applet is not public (meaning users must be authenticated with Zipper before they can run the applet), then you need to provide an App Access Token as a bearer token in the Authorization
header of your request. To generate an App Access Token, go to your applet settings and click Generate Token.
Provide a description for your token, and then copy the displayed token value.
Tokens are scoped to a single applet and are tied to a particular user.
Example without token
$ curl -X GET \
https://greeting.zipper.run/api/json?name=earth
{
"ok":false,
"error": "{\"ok\":false,\"status\":401,\"error\":\"UNAUTHORIZED\",\"errorClass\":\"Boot\"}"
}
Example with token
$ curl -X GET \
--header "Authorization: Bearer zaat.c1507063e2094d52aa639.0d62966c224949eabda56" \
https://greetingz.zipper.run/api/json?name=earth
{
"ok": true,
"data": "Hello, earth!",
"__meta": {
"request": {
"executionId": "a8604bc4-4f2c-4a08-b5ef-8b802bc450c0",
"server": "deno/aws-us-west-1",
"timing": "system;dur=173,deployment;dur=15"
}
}
}