Create a Microsoft Flow with a Versium API Custom Connector

 In Blog

Versium allows you to make the best use of your data. In addition to our self-serve platform and custom services with a dedicated rep, the Versium APIs also give you real-time access to Versium’s LifeData. With the APIs, you can fix and enrich your customer data to improve efficiencies and customize your apps.

In this post, we’ll show you how to create a custom connector using the Versium APIs and Microsoft Flow. This scenario shows how to take incoming emails to a sales email address, enrich it with contact data from LifeData with the Versium Email Reverse Lookup API, and create a contact in Microsoft Dynamics CRM.

Business meeting with colorful flow diagram

Before you get started

To create a custom connector with this tutorial, you first need to:

  • Create a Versium API account and get an API Key.
  • Log in to your Microsoft Dynamics CRM account
  • Install Microsoft Flow on your Dynamics account.

Create a Versium API Account and get an API Key

  1. Go to https://app.versium.com/, and sign in or create a free account. For documentation on the Versium APIs, go here: https://developers.versium.com/
  2. Once you’ve verified your account, select Manage API Key and copy your API Key.

Once you have the prerequisites and your Versium API key, you can create a Custom Connector for a Versium API.

Flow Walkthrough — Create a Contact Record from Emails sent to a Sales Address

We’re about to share a bit of magic with you. What if you could get full information —  full name, address, phone number — for almost every person that sent an email to your Sales@ email address?  You can do just that, and all automatically, using the Versium APIs and Microsoft Flow connected to Microsoft Dynamics CRM.

Here’s how you do it:

  1. Create a custom connector for the Versium Email Reverse Lookup API
  2. Test the connector
  3. Create a Flow with your custom connector to send the email and rich information found with the Versium API into a new contact in your CRM.
  4. Test your flow.

Once you’ve completed one flow, feel free to experiment with different Versium APIs and Flows to get just the results you want.

Step 1 — Create a Custom Connector for the Versium Email Reverse Lookup API

The first step is to use Microsoft Flow to create a custom connector for the API, using the Versium API key that you created. Here’s how you do it:

  1. Open Microsoft Flow, and in the upper right corner, open the Settings menu
  2. Select Custom Connectors, select Create a custom connector then select Create from blank.
  3. Give your custom connector a name.
  4. On the General information page, fill in as follows:
    • Scheme — select HTTPS
    • Host — api.versium.com
    • Base URL — /
  5. Select Security to move to the next page. For Authentication type, select API Key.
  6. On the API Key page, enter:
    • Parameter label type — key
    • Parameter name type —key
    • Parameter location — Header
  7. Select Definition to move to the next page.
  8. In the Actions section on the left, select New Action.
  9. Select Create connector at top right (or Update Connector if the connector was already created).
  10. Wait for up to 45 min after the Validation on the page says Validation succeeded for the Connector to be ready before attempting to test your connector.

Step 2 — Test Your Versium API Custom Connector

  1. Select Test to move to the Test page.
  2. Under Connections, select New Connection.
  3. In the Key box, paste your Versium API Key and select Create Connection.
  4. Select the connection you just created. If you don’t see it right away, update the page.
  5. In the Operations section, enter any active email address then select Test operation.
    Note — If you get a 404 error, wait 30-60 minutes and try again.
  6. Once you have successfully tested your connector with an email that returns results, copy the Body section, or use the default response below.
  7. Go back to the Definition section, scroll down to Responses, and select Add default response.
  8. Paste the Body copied from the test, or the results below, into the body here and select Import.
    {
    "versium": {
    "version": "1.0",
    "results": [
    {
    "match_score": "100",
    "timestamp": "20100620",
    "first": "VERONICA",
    "last": "QUEK",
    "phone": "2065551212",
    "address": "123 9TH AVE",
    "city": "SPOKANE",
    "state": "WA",
    "zip": "99206",
    "country": "US"
    }
    ],
    "num_results": "1",
    "query_id": "922c26c772cc301dadd532a6841b7248",
    "query_time": "0.162",
    "input_query": {
    "country": "US",
    "max_recs": "10",
    "min_match_score": "0",
    "output": "json",
    "campaign": "basic",
    "email": "vquek@contoso.com"
    }
    }
    }
  9. Select Update Connector.

Step 3 — Create a Flow with your Custom Connector

  1. In Flow, select My flows.
  2. Select New, Create from blank, and then select Create from Blank.
  3. Under Select from these popular triggers, select the When a New Email arrives trigger.
    Notes —

    • You can select any of the When a New Email Arrives triggers, including the ones provided for Outlook, Gmail, and other email programs. Scroll through the triggers list to find the one you need.
    • If you get an error about your account from Flow, try selecting the ellipses (…) in the upper right of the box, and selecting a valid email address.
  4. Select Next Step.
  5. Select Actions, then Custom, and then select your Connector.
  6. Open your Connector, select the email box, and then in the Dynamic Content box that pops up, select From. This will send the ”From” email address into the Connector.
  7. Select New Step +.
  8. Under Actions, select the action you want to take with the results from the connector. For example, select Create a new record.
  9. For Organization Name, choose your CRM organization.
  10. For Entity Name, choose what kind of record you want to create in the CRM. In this case, we’re choosing Contacts.
  11. Fill in the rest of the fields using the Dynamic Content box to add the API results that you want to create the contact with. Your form might look like something like this:Microsoft Flow Add to CRM dialog box showing insertion of API results into CRM fields
  12. Select Save.

Step 4 — Test Your Flow

Once you’ve saved your Flow, you can test it by performing the trigger action. In this case, send an email to the email address specified in the When a New Email Arrives trigger.

Play with Different Versium APIs and Flows

Now that you know the basics of creating custom connectors and flows, you can create a connector to access any of the information available from the Versium APIs.  Check out the Versium API Documentation for what’s available.

Your free Versium Developer Portal account has a limited number of results available per month; however, if you find the connector is useful, you can upgrade to a plan that gives you the results you need. Check out our webinar and learn more about the Versium APIs.

We’d love to hear from you with questions, tips, or just to show off the Flow you’ve made using Versium APIs and custom connectors!  You can reach us at sales@versium.com.

Recent Posts

VER-P-1