Converting cURL to Pipes
Understanding How cURL Requests Translate to Tadabase Pipes
When integrating external APIs with Tadabase through Pipes, you often need to translate a cURL request into the corresponding fields and settings in Tadabase. Below, we’ll break down a few example cURL requests and explain how each part relates to configuring a Tadabase Pipe.
Example 1: Basic GET Request
cURL Request:
curl -X GET "https://api.example.com/v1/users" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Breakdown:
Method: GET
Tadabase Pipes: In the Tadabase Pipe, this corresponds to selecting the GET method for the Pipe action. The GET
method is used when you are retrieving data from an API.
URL: https://api.example.com/v1/users
Tadabase Pipes: In the Tadabase Pipe setup, the Request URL is the endpoint where the data will be fetched from. This exact URL (https://api.example.com/v1/users
) should be entered as the API Endpoint URL.
Tadabase Pipes: The Authorization
header passes the Bearer token needed for authenticating the request. In Tadabase Pipes, you’ll need to add this under the Headers section. You would add:
Example 2: POST Request with JSON Payload
cURL Request:
curl -X POST "https://api.example.com/v1/users" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "John Doe", "email": "john.doe@example.com"}'
Method: POST
Tadabase Pipes: In the Tadabase Pipe, select POST as the method. POST
is used when you want to send data to create or update a resource.
URL: https://api.example.com/v1/users
Tadabase Pipes: Similar to the previous example, this is the API Endpoint URL where the POST request will be made.
Tadabase Pipes: Add both headers in the Headers section:
Data: -d '{"name": "John Doe", "email": "john.doe@example.com"}'
Tadabase Pipes: This is the Body of the request. Since it's JSON data, you would configure the body in the Tadabase Pipe by selecting the Raw Body (JSON) option and inputting the JSON data:
Troubleshooting
See full output
To see the full request that's being sent behind the scenes, it's helpful to use a service that can show you the request it received from the Tadabase servers.
We recommend using webhook.site for this and you can do so as follows:
Go to Webhook.site and get the Unique URL:
Paste the URL in the URL field of your pipe (It's best to create a copy for testing)
Next get the "Pipesscript" code by clicking "Copy Code"
Paste the code in any pages Javascript:
Preview the page and view the console
We'd love to hear your feedback.