For the complete documentation index, see llms.txt. This page is also available as Markdown.

Integration example

There is multiple ways of integrating with Shomi Custom in order to send data from Shomi to external systems. One way is writing the integration logic in bubblescript in the process_transcript task in the custom file as explained in How to extend.

Another way is to create a note in the Shomi Custom and simply use the standard integration methods the DialoX platform have to offer because Notes can be retrieved using the API using the notes endpoint.

Notes can also be pushed automatically at creation to an extenal system using the Notes webhook.

This page describes what to do to do both types of integration on Notes.

Shomi script

So in the Shomi Custom bot you need to open the main script and replace the task custom_transcript with the following code.

task custom_transcript do
    
  # to make sure the transcript ends up in the API calls or webhook push
  remember transcript
  
  # create a note with the summary
  __ = Notes.save(title: transcript.topic, note: transcript.extended_summary)
  
  # adding a notification to the chat client
  transcript.notifications = (transcript.notifications || []) ++ ["A note is created for this summary in Shomi Custom."]
  
end

How to find Notes in the DialoX UI

Now for every incoming transcription a note will be created. These notes are then visible in the DialoX Studio UI within the Notes page:

Or In the Inbox app under the Notes page:

Integration

Enabling the API

You can find your bearer token and bot ID in the Channels section of the DialoX platform under the Web API page.

Retrieving using the Notes endpoint

Now you created a note for every transcript that Shomi produces you can retrieve them from any other system using the Notes API endpoint.

Note that using the API end-point you need to poll at intervals which adds latency. Also you need to make sure to query the newest Notes at any given time and make sure to keep track of which Notes you already fetched.

The following example shows how to retrieve Notes using the API and how the response looks using the command line cUrl statement, but you can use any tool like PostMan to perform the same API call to test responses:

A typical response looks like this:

Webhook

The best solution though is to use the WebHook. This way, your system will automatically be called when ever DialoX creates a new Note after receiving a new Transcript. This way you don't need to poll or keep track of which transcripts you already processed or not.

The Webhook can be configured in the Web API section of the platform. Click on the Add webhook button to register a new webhook. Then choose "Notes" as Event Type and fill in your webhook URL and optionally a bearer token.

For this example I used webhook.site to capture the output to see which fields can be mapped.

The following snippet shows a full example of the output:

Last updated

Was this helpful?