Collecting Real World Data with Bland

Introduction

One of the most powerful use cases for AI phone calling is data collection at scale. Via Bland’s API, developers can interact with the real world to answer questions like ‘How much do all the different plumbers in Seattle charge?” and “Which restaurants in Birmingham are pet friendly?”.

Private Equity companies can identify target small businesses for rollups. Real estate analytics companies can figure out which companies own which properties, anywhere in the world. Datasets that were previously infeasible become accessible.

In this article, we’ll describe how to create an automated workflow that calls local businesses and collects owners’ contact information. Then we’ll create another automation that analyzes each phone call and updates a spreadsheet.

Let’s get started!

Sending the phone call

First, copy this Zapier template. Within the editor, select the first block and provide whatever inputs you prefer.

For this example, we’re just using the Zapier scheduler as a generic trigger. You can customize the trigger to pull information from a spreadsheet, connect to your database, etc.

Make sure to press ‘test’ before moving on.

Next, select the Bland AI phone call block. Sign into your account using your API key (found on the developer portal) and select the “Send Phone Call” event.

After, input your phone number and the following prompt:

“You are Blandy, an AI assistant. When the person answers, ask them who the owner of the business is. Explain you want to make a purchase and ask for the contact information of the owner.”

At this point, you should test the entire zap, and confirm the phone call works.

Analyzing the phone call

Analyzing the phone call requires a second Zapier workflow. The workflow will feature a webhook that triggers after the initial phone call workflow completes. To start, copy this template.

Getting the transcript

Select the webhook block and set the event to “Catch Hook”. Then copy the webhook URL.

Return to the first Zapier workflow and edit the phone call block. Under the “webhook” field enter the webhook URL.

Send a test phone call then return to the analysis zap and confirm the catch webhook received the call. If it did, your two zaps are now connected. Congratulations!

Now, in the analysis zap, select the Bland block and set the event to “Get Transcript”. Input the Call ID from the webhook into the “Call Identifier” field.

Hit “Test”. If the automation is set up correctly, a phone call transcript should appear.

Parsing the Business Owner’s Name and Contact Details

Select the OpenAI block. If you don’t already have a developer account, sign up. Then create an API key and connect your account to Zapier.

Next, pick the “Send Prompt” event and enter the following prompt:“Get the business owner's name from this transcript:”

Append the “Transcripts Text” attribute from the Bland AI get transcript block to the prompt.

After, hit “Test”. Make sure that OpenAI returns only the name of the business owner.

Move on to the second OpenAI block. Use the same account, and once again select the “Send Prompt” event.

For the prompt, provide the following:

“Get the business owner's contact information from the transcript. Only return a phone number and or phone number, separated by a comma if both are present:”

Once again, append the Transcripts Text attribute from the Bland AI get transcripts block. Test and confirm OpenAI returns the contact information of the business owner.

Pick the spreadsheet block and authenticate into your Google Drive account. Create a new spreadsheet and hook it up to Zapier. Make sure to include two headers: “Business Owner Name” and “Contact Information”.

Within Zapier, select the spreadsheet and the two headers. For the “Business Owner Name” input, provide the first OpenAI block. For the “Contact Information” input, insert the second OpenAI block.

Finally, select "Test". If successful, the Google sheet will update.

Conclusion

AI phone calls are an incredibly powerful tool for getting data from the real world. With Bland’s Zapier integration, you can easily dispatch phone calls, analyze transcripts, and then update a spreadsheet with information.

Thanks for reading!