Skip to main content

Send API request action

Send a request to a service that needs an OAuth 2.0 login, for example read contacts from your CRM, with a connection that you set up only once.

Written by Leo

Send API request is an action that sends a request to a service on your behalf and signs it with an OAuth 2.0 connection. The action list marks it with a New badge. It's meant to help you work with services that need a login, without handling tokens yourself.

You can use this action for many things, including:

  • Reading the open deals of your CRM and saving them in Tape.

  • Creating an event in a team calendar when a viewing is booked.

The action Send an API request using GET method and save response in API response, with Connection, URL, Request, and Show headers

Note:

  • A connection is required. Without a connection, Tape skips the action when the automation runs.

  • Only public addresses. Tape refuses requests to private or internal addresses, such as localhost or hosts inside a private network.

  • Requests send real data. A Manual run and a Simulated run both send real requests to the service.

Who can use the Send API request action?

  • Automations are available on the Free, Plus, and Premium plans. The number of automation actions per month depends on your plan. See the limits for your plan on our pricing page.

  • To add or change this action, you need to be a workspace admin of the workspace the app is in. You also need full access to every app the automation uses.

  • To choose, add, or edit a connection, you need to be an Organization owner or Organization admin.

Add the Send API request action

To send an API request from an automation:

  1. Open the database app and click the Create and view automations icon at the top.

  2. Open an automation, or select New automation and choose a trigger.

  3. Select Add action → Send API request. The step appears as Send an API request.

  4. Open Choose a connection and select the connection to the service. To add one, select Add connection. Enter a Connection name, then the Client ID, Client secret, Authorize URL, and Token URL from the service's API documentation. Scopes (optional) and Resource owner details URL (optional) are optional. Select Save connection. You can connect any service that supports OAuth 2.0.

  5. Select the method next to using. It starts as GET.

  6. Enter the address in URL. Without a URL, Tape skips the action.

  7. Add the data to send in Request. Type @ to insert record values.

  8. Select Save changes.

Adding Send API request in an Expenses automation: Add action, selecting Send API request, opening Choose a connection with No connection found and Add connection, keeping the method GET, typing <a href="https://api.acme.com/customers" rel="nofollow noopener noreferrer" target="_blank">https://api.acme.com/customers</a> in URL, and clicking into Request

Send API request settings

The action reads as a sentence: Send an API request using a method and save response in a variable. Below, you'll see:

  • Connection: the connection that signs the request. Select Choose a connection. Learn more about OAuth 2.0 connections →

  • method: how the request is sent. Select it to choose:

  • GET asks the service for data.

  • POST sends data, usually to create something.

  • PUT sends data to replace something.

  • PATCH sends data to change part of something.

  • DELETE asks the service to delete something.

  • API response: the name of the variable that holds the response. You can use it in later actions by typing @. API response holds the body, the statusCode, and the headers of the answer, for example var_api_response.statusCode. To read single values, use Perform calculation or Execute script.

  • URL: the address the request goes to. You can mix text with record values.

  • Request: the data to send. It must be valid JSON, otherwise the step fails with HTTP call body is not a valid JSON string. Tape sends Request with POST, PUT, and PATCH. GET and DELETE don't send it.

  • Show headers: opens the list of headers. Select Add header to add one, then fill in Header and Value. Select Hide headers to close the list. The connection adds its login for you, so you don't enter a token as a header.

The action's ••• menu has Follow redirects. It's off by default. It applies to GET requests: when it's on, the request follows redirects of the service to the new address. The menu also has Continue on error, Deactivate, Turn into, Duplicate, and Remove. Learn more about action settings →

Let's look at an example

Let's say your sales team keeps contacts in a CRM and wants every new lead in Tape to appear there. Here's how:

  1. Set the trigger to When a record is created in the app Leads.

  2. Select Add action → Send API request.

  3. Open Choose a connection and select the connection to your CRM.

  4. Set the method to POST and enter https://api.acme.com/v1/contacts in URL.

  5. Select Show headers → Add header. Enter Content-Type as Header and application/json as Value.

  6. In Request, write the contact data in JSON format and insert the lead's Name and Email fields.

  7. Select Save changes.

When a lead is created, Tape creates the contact in your CRM and saves the answer in API response.

Send API request errors

  • If the step fails, the run shows the step and its message in the automation's runs. Open the automation and select ▷ next to Manual run (View all runs, cmd + 1). Each run shows its status, for example Success; select a run to see every step. For all automations, open Runs in the Automation Center and filter by App, Automation, or Status.

  • If the connection was removed, select a connection again. If a connection shows Broken, open the connection list, click ••• next to the connection, and select Reauthorize.

  • If the service answers with an error status, such as 404 or 500, the step fails. To let the run continue anyway, turn on Continue on error in the action's ••• menu.

  • The run doesn't show the response. To check it, insert API response in a later step, for example in Add comment.

  • If the address points to a private or internal host, the request is refused.

Test, pause, or edit the Send API request action

  • Manual run runs the automation once. Under Run on, select the records, then select Save and start run. The requests go to the real service.

  • New automations you create in the editor are Active right away. The status, Active or Paused, sits right below the automation's name in the editor. To pause one, select Active. It switches to Paused. Then select Save changes.

  • To change the action, open the automation, select the Send an API request step, make your changes, then select Save changes.

Learn more

FAQs

What's the difference between Send API request and Send HTTP request?

Both send a request to a web address. Send API request signs the request with an OAuth 2.0 connection, so it can reach services that need a login. Send HTTP request sends the request as is. Learn more about Send HTTP request →

Which services can I connect to?

Any service that supports OAuth 2.0. An organization owner or admin adds it with the service's client ID, client secret, and URLs. Learn more about OAuth 2.0 connections →

Do I need to renew the login?

No, Tape refreshes the login of a connection automatically. If it can't, the connection shows Broken. Click ••• next to the connection and select Reauthorize.

Can I use the response in later actions?

Yes! The response is saved in the variable under save response in. Type @ in a later action and select it. Learn more about record values and variables →

Can I call a service in my own network?

No. Tape only sends requests to public addresses.

Are there other actions I can use?

Yes! Actions can create and update records, add comments, send emails, create PDFs, call other services, and more. See every action in Automation actions →

Are you a developer using the Tape API for automations?

The automation API has its own documentation for developers. Full reference: authenticated_http_call in the developer docs →

Still have questions? Find answers and get help from community experts in the Tape community →

Did this answer your question?