An HTTP call can be used to perform an action in your app or any third-party app through its API. If you're making an HTTP call to an Integry-supported app, the authentication method is pre-configured for you. Simply connect your account to Integry and start testing your HTTP calls. However, if you're making an HTTP call to your app that is not supported by Integry, you'll need to configure authentication yourself.
In this example, we'll create an integration: "When a row is created in Google Sheets, create a task in Doneday" in which an HTTP call will be used to create a task in Doneday. We'll configure an API Key type auth and use our API Key to test the API call.
- Go to the Flows tab from the top menu.
- Create a new flow.
- Add the "Row Created" trigger in Google Sheets and test it.
- Select "HTTP Call" as child step. This is where you'll make an HTTP call. You can specify the HTTP method, the URL, parameters, headers, and the body. You can also specify what authentication to use; more on that below.
- In the Authorization tab, your app will be pre-selected; keep it unchanged.
- Set the authorization type to API Key.
- Add the Key name.
- Doneday's API requires the API key name to be
X-API-KEY
.
- Doneday's API requires the API key name to be
- The Key Value or access token is pre-selected and can't be changed.
authorization.token.access_token
is a syntax used to reference the specific access token property within an authorization object or token in an API request or response. Here,access_token
will be replaced with the API Key of the user making the HTTP call.
- Add the API Key (key-value pair) to the Headers or Parameters of your API call.
- Select "Headers" from the dropdown menu if your API requires the API Key to be passed in the request header. The same key-value pair you added above will be added in the Headers tab.
- Use the field "Header prefix" to add a prefix to the key value in the header. Doneday doesn't require a header prefix to be added, so we are leaving this field empty.
- You can select "Parameters" in the dropdown if your API requires the API Key to be passed in the parameters.
- Select "Headers" from the dropdown menu if your API requires the API Key to be passed in the request header. The same key-value pair you added above will be added in the Headers tab.
- Click on the Testing account dropdown and then "Add new account."
- A pop-up screen will open up where you will paste your API Key.
- Once connected, you will see your account listed in the Testing account.
- You can also add another account if you want to test with a different account.
- You can also add another account if you want to test with a different account.
- Your auth is now configured and your account is also connected. You can make an HTTP call now.
- Select an HTTP method.
- Since we're making an HTTP call to add a task in Doneday, we'll use 'POST' method.
- Since we're making an HTTP call to add a task in Doneday, we'll use 'POST' method.
- Add Doneday task endpoint as the request URL.
- Task endpoint:
https://doneday.integry.io/api/task
- Task endpoint:
- Go to the Body tab. In the code editor, define the body of the HTTP call.
- According to their API docs, Doneday requires the post task call body to be in JSON in this format:
{ "title": "My task", "description": "My task description",
"due": "2023-03-06 19:32:58.296 +0500"}
- According to their API docs, Doneday requires the post task call body to be in JSON in this format:
- Click Test. A task will be created in your Doneday account.
- Save and publish your flow.
To set up the flow, your users need to connect and configure Google Sheets. But for your app, they only need to connect their account using their API Key. The HTTP call step automatically configures your app to perform the intended action.
Comments
0 comments
Please sign in to leave a comment.