foreign-sapphire•16mo ago
POST API Block test
in the API Block, in the Body tab we can select "form data" field.
what data should we enter ?
same question for the field "variable" ?
2 Replies
To test the POST API Block in Voiceflow, follow these steps:
Body Tab - Form Body Field
1. Select "form body": In the Body tab of the API Block, select the "form body" option.
2. Enter Data: Input the data you want to send in key-value pairs. For example, if you are sending a task to Airtable, you might enter:
- Key:
fields[Task]
- Value: Buy milk
Variable Field
1. Create a Variable: In the Capture Response section, create a variable to store the response from the API. For example, you can create a variable named {Task}
.
2. Map the Response: Map the response data to the variable. For example, if the API response contains a field named task
, you would map it as follows:
- Path: response.fields.Task
- Variable: {Task}
Example
Here’s a step-by-step example for adding a task to Airtable:
1. Select POST Option: Choose the POST request type.
2. Add Headers: Include necessary headers such as Authorization.
3. Form Body Data:
- Key: fields[Task]
- Value: Buy milk
4. Capture Response:
- Path: response.fields.Task
- Variable: {Task}
5. Test the Request: Click "Send Request" to test the API call.
If successful, the new task should appear in Airtable, and the response should be captured in the {Task}
variable.
For more detailed instructions, you can refer to our Airtable Integration Guide.If you tell us a bit more about the api, that would help a bunch 🙂