HTTP
Built-in step · 2 steps
Call any REST or GraphQL endpoint, or start a workflow when a web address lists something new.
To learn when to use these steps, with examples, read Call an API or run code.
Call a GraphQL API
Send a query or mutation to any GraphQL API that Lodol has no built-in step for. Write the query as in the API's own explorer, fill in its variables, and the data comes back ready for later steps to read, with any errors the API reported. Store an API token as a workspace secret and reference it in a header.
Inputs
- URL
urltextRequired - The GraphQL endpoint, starting with https://, such as https://api.github.com/graphql. It can be built from workspace values.
- Query
querytextRequired - The query or mutation to send, written in GraphQL. Declare the values that change as variables, such as query ($id: ID!), and set them below rather than writing them into the query.
- Variables
variablesobject - A value for each variable the query declares, named without the dollar sign. A value can be a reference to an earlier step, or JSON for an object or a list. Put text that looks like a number in quotes, such as "12345".
- Operation name
operation_nametext - Which operation to run when the query holds more than one. Leave it empty for a query with a single operation.
- Headers
headersobject - Headers to send, such as an Authorization header. Use a workspace secret for a token so it is never stored in the workflow.
- Error responses
on_errortext - What an error means for this step: an error status (a 401, a 500) or a reply whose errors list is not empty. Treating them as results lets later steps read the errors themselves and use any data that did come back. A request that gets no answer at all still fails the step; the step's own "If this step fails" setting decides what happens then.One of:
fail(Fail the step),continue(Treat them as results). Default:fail.
Outputs
dataobjecterrorslistheadersobjectoktrue/falsestatusnumberurltext
Example output
{
"data": {},
"errors": [],
"headers": {},
"ok": true,
"status": 1,
"url": "example_value"
}Call an API
Call any REST or GraphQL endpoint that Lodol has no built-in step for. Set the method, URL, headers, query parameters, and body, and the response comes back ready for later steps to read. Store an API token as a workspace secret and reference it in a header to make an authenticated call.
Inputs
- URL
urltextRequired - The full address to call, starting with https://. It can be built from workspace values, for example @values.BASE_URL followed by the path.
- Method
methodtext - The HTTP method the endpoint expects.One of:
GET,POST,PUT,PATCH,DELETE,HEAD,OPTIONS. Default:GET. - Headers
headersobject - Headers to send, such as an Authorization header. Use a workspace secret for a token so it is never stored in the workflow.
- Query parameters
queryobject - Values added to the end of the URL as a query string. Anything already written into the URL is kept.
- Body
bodyobject - What to send with the request, as JSON or a reference to a value from an earlier step. Leave it empty for a request that carries no body, such as a GET.
- Body format
body_formattext - How to encode the body. JSON suits most APIs, including GraphQL. Form sends it the way an HTML form would. Multipart uploads files: each field of the body is text, or a file from an upload or an earlier step.One of:
json,form,text,multipart(Multipart (files)),none. Default:json. - Response format
response_formattext - How to read what comes back. Auto follows the response's own content type, so JSON becomes an object and a download becomes a file.One of:
auto,json,text,file. Default:auto. - Error responses
on_errortext - What an error status (a 404, a 500) means for this step. Treating it as a result lets later steps check the status themselves, which suits a 404 that just means not found. A request that gets no answer at all still fails the step; the step's own "If this step fails" setting decides what happens then.One of:
fail(Fail the step),continue(Treat them as results). Default:fail. - Connection
connection_idtext - Log in as one of the workspace's connected accounts (a Salesforce, Google or Notion account, ...), which adds that account's credentials for you. For calling an endpoint of a connected app that its actions don't cover. The request can only go to that app's own servers.
- Paging type
pagingtext - Pick the type your API's docs describe.One of:
none(Off),link_header(Link header),next_url(Next-page URL),cursor,page_number(Page number). Default:none. - Results field
paging_itemstext - The field in each response that holds the list, like data. Leave empty if the response is the list.
- Next-page field
paging_nexttext - The field in each response that holds the next page's link or cursor, like links.next.
- Page parameter
paging_paramtext - The URL parameter that asks for a page, like page or cursor.
- Maximum pages
paging_max_pagesnumber - Stops here even if there are more pages.From 1 to 100. Default:
10.
Outputs
bodyobjecthas_moretrue/false- Whether the page cap stopped it early.
headersobjectoktrue/falsepagesnumber- How many pages were fetched, when paging.
statusnumberurltext
Example output
{
"body": {},
"has_more": true,
"headers": {},
"ok": true,
"pages": 1,
"status": 1,
"url": "example_value"
}