Calling APIs and Webhooks

Call any API or Webhook from Ask Steve

Why Call an API or Webhook?

  • This gives you the ability to call your own APIs that can do pre- and post-processing.
  • As an example, you could configure your own internal API that Steve calls with an account number that he pulls from a page. Your API can use that account number to pull relevant data about that account from internal systems, directly make an LLM call with the new augmented data, and then pass the result back to Steve.
  • Or you could send the input to an LLM for processing, and then write it out to a Google Sheet or to Salesforce.
  • Or you could proxy all requests so that you can log them, or filter any sensitive information out.
  • You can do this with your own code running on a server somewhere, or with any visual workflow builder like n8n, Gumloop, Activepieces, Make, Zapier etc. that supports Webhooks.
  • This enables you to do a lot more than just call an LLM! See the videos below for a few examples.

How to Call an API or Webhook

Ask Steve can interface with any API or Webhook on the back-end.

  • To point a Skill to an API/Webhook instead of an LLM, follow the instructions here when setting up your Skill.
  • API/Webhook Skills behave as follows:
  1. All requests are made via POST
  2. In the Skill configuration, the default header is to set the Content-Type to "application/json", but you can add anything else to the header that you need, including an API key or Authentication key.
  3. The body of the POST request contains a property for every Page Variable and User Variable. All other text in the "Instructions for Steve" area are ignored.
  4. A "_url" property is automatically added that has the URL of the current page.
  5. Your API/Webhook should return an object with a "message" property (string) if it was successful, and an "error" property (string) if it was not. This is what will be shown to the user.
  6. You can include simple HTML formatting in the return values. URLs will be hyperlinked automatically, and text can be hyperlinked by using Markdown formatting.

Example Instructions: This Skill captures [[leads]] and sends them to a Webhook

The POST body will have two properties, "leads" with the selected text or current page, and "_url" with the url of the current page. All other text is ignored and not sent to the API/Webhook.

Example Instructions: This Skill captures a [[headline]], [[author]] and [[article]] then asks the user for {{what do you want to do with this}} and then sends them to a Webhook

The POST body will have five properties, "headline", "author", "article", "what do you want to do with this", and "_url". All other text is ignored and not sent to the API/Webhook.