Use Waveline in Zapier

Waveline
4 min readAug 17, 2023

--

In this guide, we show how you can use the Waveline API in your Zapier zaps.

What is Waveline

Waveline is an API that lets you extract data from unstructured documents. For example, if you just want the sender and the total of an invoice PDF, you can call Waveline to get that information. Just provide a “Shape” in which you describe what you would like to retrieve and send the document to Waveline. With the help of AI and Large Language Models, they then return your desired information in the format you provided with your Shape.

What is Zapier

Zapier is a web-based automation tool that connects various apps and services, enabling them to work together. Users can create “Zaps” which are automated workflows that trigger based on specific events in one app and result in actions in another. This allows for seamless data transfer and automation of repetitive tasks without the need for coding. Popular use cases include syncing contacts, automating social media posts, and connecting CRM systems to email platforms.

Example

We now show you how you can use Waveline within your zap. For this, we create a small Zap (see template here) that does the following every time we get a new email in our inbox:

  1. Zap gets triggered when a new email comes in.
  2. We create a Waveline Extract job that extracts the first and last name of the person who sent the email based on the content of the email.
  3. Wait 10min in order to give Waveline some time to process the job.
  4. Get the result from Waveline.
  5. Save it into a new row in our Google Sheets spreadsheet.

There aren't too many Pitfalls, and everything should be more or less straightforward. We briefly explain the steps where you would use Waveline.

Waveline — Authenticate

When using an Action/Trigger of the Waveline plugin, you will be prompted to authenticate or sign in:

When clicking on “Sign in” you will be prompted with the following pop-up:

Here you should paste your Waveline API Key, which you can find in your Dashboard.

Waveline — Extract Document

In order to create a job for Waveline to extract information from your document, you select this “Create Job — Extract Document in Waveline Extract” Action.

File Name: The file name helps you to recognize your requests a little better, and the file extension is used by our algorithm, but you can also just put something generic like document.pdf. In our case, we choose email.txt
Content Type: If your input is anything other than plain text, you should choose application/pdf. In our case, we just have plain text and therefore choose text/plain.
Shape: The shape describes what you want to extract. Detailed information can be found here. For our purpose of extracting the first and last name, we have the following shape:

[
{
"name": "first_name",
"type": "string",
"description": "The first name of the sender of the email",
"isArray": false
},
{
"name": "last_name",
"type": "string",
"description": "The last name of the sender of the email",
"isArray": false
}
]

Make sure that the Shape is valid JSON. You can verify this in online tools like jsonlint.
[ { “name”: “first_name”, “type”: “string”, “description”: “The first name of the sender of the email”, “isArray”: false }, { “name”: “last_name”, “type”: “string”, “description”: “The last name of the sender of the email”, “isArray”: false }
Text Content: Either Text Content or Content Url can be used to pass down the content from which Waveline can extract the data. We use Text Content if we have plain text and use Content Url if we have an URL to our data. In our case, we just have an email (aka plain text), so we use Text Content.
ContentUrl: Since we already use Text Content we can leave this empty.

After everything, it should look like this:

Waveline — Get Job

After adding the delay (e.g., 10min) to give Waveline time to process your request (Webhooks are coming soon), we can query for the result. The only thing we need for this is to call the get URL we got back when we created the job. We just select it within Zapier, and we are good to go. This looks like this:

Conclusion

Using Waveline within Zapier is quite straightforward. Since Webhooks (coming soon) aren’t ready yet, we just add a delay between submitting the job and getting back the result. After this, you are now able to effortlessly extract data within your Zapier Zaps. If anything fails, don’t hesitate to notify us on team@waveline.ai

Happy Extracting :)

--

--

Waveline
Waveline

Written by Waveline

Extracting data from documents was never easier. waveline.ai

No responses yet