Custom Sources for Answers via Zapier

This guide shows you how to set up a Custom Source in Guru and load records via Zapier.

Create the Custom Source

To create a custom Source in Guru, you will need to make the following API call:

POST https://api.getguru.com/api/v1/sources

Request Body:

{
  "type": "CUSTOM",
  "config":
    {
        "name": "Source_Name_Goes_Here",
      	"type": "CUSTOM"
    }
}

You will be given a response that looks like the example below. The id from the response is the ID of the Custom Source - you will need this field later in this process.

{
    "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "type": "CUSTOM",
    "config": {
        "name": "Source_Name"
    },
    "createdBy": {
        "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "status": "ACTIVE",
        "email": "[email protected]",
        "lastName": "Duffy Demo",
        "firstName": "Joe"
    }
}

Records

Now that you've created the source, you'll need to load records to the source. These are the records that are used to formulate an AI-generated answer when a user asks a question in Guru.

There are a couple of options when it comes to loading records to sources:

  1. Directly via the API
  2. Through an iPaaS solution, such as Zapier. You'll still need to be familiar with the API if you plan to load records using an iPaaS solution.

Load Records Directly via the API

Loading records to a custom source through the API is fairly straightforward. You'll want to get the Source ID from the API call you made above to create the source - that will be used in the API URL for this next call. There are a few key elements that you need for each record you load to a Source:

  1. externalId: this is the ID of the record you're loading to the source. It is used to check our system to see if that record already exists. If it does exist, we will update the record. If it does not exist, we will create a new record.
  2. title: this is the title of the record you're loading to the source. It will be used as a display in the Guru UI when Answers is citing the source/record it used to formulate an answer.
  3. url: this is the title of the record you're loading to the source. It will be used as a hyperlink for users to click on when they want to look at the source of the answer Guru has provided in the UI. This needs to be a valid URL.
  4. content: this is the actual content of the record you're loading to the source. It needs to be sent in plain text format, which means removing HTML tags, emojis, etc.
PUT https://api.getguru.com/api/v1/sources/{sourceId}/records/{externalId}

Request Body:

{
  "externalId": "airtable_rec3lbPRG4aVqkeOQ",
  "title": "Record Title",
  "url": "https://airtable.com/app4UojDvMJ841ltD/tbleUfsyAmXerB7hv/rec3lbPRG4aVqkeOQ",
  "content": "Here is some record content in plain text."
}

Load Records via Zapier

As with any Zapier automation, you'll need to start with a trigger. This could be something like "new or updated record in Airtable" or "row is updated in a Google Sheet". Although the possibilities are endless, for this example we'll add/update a record to our newly created Guru Source anytime a record is added to or updated on an Airtable table.

Here are the two steps you'll need to use to get this working:

Configure your trigger in step 1 to fit your specific needs. Choose the appropriate base, table and the timestamp field the automation should key off of.

In step 2, you'll need to make the API call outlined above to load the Airtable record into your Source. Below is a screenshot of the configuration.

Note: in the "Basic Auth" field, you'll need to include your Guru email address, a pipe delimiter, then your Guru API token. (ex. [email protected]|xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

🚧

Read me!

The data passed in the "content" field needs to be in plain text. Depending on the type of data you are trying to pass into your Guru Source, you may need to do some sort of data transformation prior to making the PUT call. You can do this by injecting a "Formatter by Zapier" action into the automation. This can take care of things like HTML tags, quotes, carriage returns, tabs, emojis, etc.

❗️

Known Issues

We have a couple of known issues with Custom Sources right now:

  1. The name of the Custom Source does not display in the Guru UI
  2. The Custom Source logo does not display when an answer is generated using the Custom Source. Instead, the Guru logo appears.