How to use AVflow with Zapier

AVflow and Zapier flow together nicely. :) And together they create a really powerful combo!

Imagine you have a workflow where you captured data in the frontend with Zapier which then triggers AVflow and uses part of that captured data in the Flow.  

Here is how you can use a Zap in Zapier to trigger a Flow in AVflow.io

In this example we will guide you to create a sample Zap that can receive JSON data from a POST request; then Zapier will trigger AVflow's Flow.

1. Create a Zap that can accept POST request and JSON data

Create a Zap.

Select Webhooks By Zapier

Select Catch Raw Hook as Trigger Event

Copy the Webhook URL and save it somewhere to yse for later. Select Continue

2. Test the Zap with sample data (Using POSTMAN)

Create POST request to Zapier flow: Use POST method with the Webhook URL that we copied before in Zapier Trigger setup

Config the Body to send to Zapier endpoint:

- Set data payload type to raw and JSON format

Paste the payload to body

Below is the sample pay payload:

{
"log": {
"version": "1.2",
"creator": {
"name": "Webhook.site",
"version": "1.0"
},
"entries": [
{
"startedDateTime": "2021-03-16 16:25:49",
"request": {
"method": "POST",
"url": "https://webhook.site/17715443-7389-4b96-91f8-87848ee9fffc",
"headers": [
{
"name": "connection",
"value": "close"
},
{
"name": "x-datadog-origin",
"value": "rum"
},
{
"name": "x-datadog-sampling-priority",
"value": "1"
},
{
"name": "x-datadog-parent-id",
"value": "12547910889996034312"
},
{
"name": "x-datadog-trace-id",
"value": "3851318133242938409"
},
{
"name": "content-length",
"value": "105"
},
{
"name": "content-type",
"value": "application/x-www-form-urlencoded"
},
{
"name": "apikey",
"value": "zL8fTLbU29RPqsYMONhJxG8GQ8U="
},
{
"name": "accept",
"value": "*/*"
},
{
"name": "accept-encoding",
"value": "gzip, deflate"
},
{
"name": "user-agent",
"value": "Zapier"
},
{
"name": "sentry-trace",
"value": "c1bf5e6e3cde48da9b632311c016cae9-a0095c43266b7bfe-0"
},
{
"name": "host",
"value": "webhook.site"
}
],
"bodySize": 105,
"postData": {
"mimeType": "application/json",
"text": "video=http%3A%2F%2Fcommondatastorage.googleapis.com%2Fgtv-videos-bucket%2Fsample%2FForBiggerMeltdowns.mp4"
}
},
"response": {
"status": 200,
"httpVersion": "HTTP/1.1",
"headers": [
{
"name": "Content-Type",
"value": "text/plain"
}
],
"content": {
"size": 0,
"text": "",
"mimeType": "text/plain"
}
}
}
]
}
}

Now go back to Zapier and Select Test trigger

Now we can see that the Zap received the  request from POSTMAN with data:

3. Setup AVflow flow that can be triggered via POST request (using webhook trigger)

Create a Flow (in this example it is named "avflowEndpoint") in an AVflow.io workspace

Drag the Webhook Trigger to the Flow. This trigger will allow Zap trigger this flow via HTTP request

Set Action to HTTP POST to enable triggering the flow via HTTP POST request.

Specify the Webhook output data.

which mean the incoming data will have structure as below:

{
"log": {
....
}
}

Copy the Webhook Endpoint and keep it somewhere else for later use. We will need this endpoint to setup the Zapier webhook.

Go to TABLE, select the default table / or create a new table

Add a Log column to store data to be received from the webhook trigger:

Go back to the Flow and add the Table step and setup configuration to store the data from webhook to just the table column you just created.

Set Action to Insert, which means this step will insert row to a table

Select Setup Table Options

Setup Table Option, specify which table and column the data to be saved to.

Enable Flow:

4. Add the Zapier webhook to the Zap to trigger AVflow's Flow

Click on the box to add more actions to the existing Zap

Search and select Webhook By Zapier. We will use this action to trigger the AVflow

Set Action Event to Custom Request then select Continue

Set Method to POST

Set URL to the AVflow Webhook Trigger's endpoint that we saved before

Set Payload Type to Raw Body

Set Wrap Request In Array to No, Leave File blank. That means we reserve the structure of JSON and don't send any file to AVflow

Set Data Pass-Through? to False, which means we will forward the data from previous action to the target endpoint

Set Unflattern to No

Leave Basic Auth blank, because AVflow use "apiKey" key value to do authentication as below

Include AVflow apiKey in request header

--> To find the the AVflow apiKey, go to AVflow and load your profile page by clicking on your name at the bottom left. See here for more info.

Select Test & Continue to test the Zap with the new action

Zapier will show the result as below:

4. Turn on both Zap and AVflow flow then use POSTMAN to send the test request again

Check the Zapier log as below to see the result.