This article provides the export steps of a speech-to-text transcription (STT), where the transcription is exported to your HubSpot workspace.
User Level:
Admin
HubSpot Export
Requirements
existing workflow with a Recording Uploaded trigger for transcription creation
HubSpot admin role with access to private apps
HubSpot authorization logic has changed as of March 2023. Requests made to HubSpot's API are now authenticated using the OAuth authorization saved within your first integration instance with HubSpot.
For newly created workflow automations, this means you don't need to format any additional keys or authentication headers into your endpoint url or setup.
The limitation is that you can no longer have multiple HubSpot integration instances with workflow automations—only automations from the most recently configured integration instance will run.
Setup
From the legacy dashboard, navigate to Account > Workflow Automations.
Scroll down and select
+Add Workflow
.Name your workflow.
For a trigger Object, select
Transcription
. Action:Created
.Optional: Add conditions if you want transcriptions to export to HubSpot only in cases where these conditions are met.
As an Action type, select
API request
.In the Values section (the request body), include the following key-value pairs:
Key
engagement.active
has the ValueTrue
engagement.ownerId
is1
for Key
associations.contactIds.0
paste the following Value:{%- for url in event.properties.call.contacts[0].external_urls -%} {%- if url.integration_name == "hubspot" -%} {{ url.external_url | split("/") | last}} {%- endif -%} {%- endfor -%}
for Key
metadata.body
paste the following Value:<span><strong>Transcription of call between Cloudtalk and {{ event.properties.call.contacts[0].name }} </strong></span><br><br>
{% set items = event.properties.transcription.json %} {% for item in items %} <span> {% if item.out | length > 0 %}<strong> Contact:</strong>"{{item.out}}" {% endif %} {% if item.in | length >0 %} <strong>Agent:</strong> "{{item.in}}" {% endif %}</span><br> {% endfor %}
engagement.type
isNOTE
When done, select
Save and activate
.
Reference for Key-Values in Request Body
engagement.active
accesses the activity of the HubSpot (HS) engagement.engagement.ownerId
accesses the HS owner.
The code pasted for
associations.contactIds.0
extracts the desired contact ID from the external URL.The code pasted for
metadata.body
contains dynamic references (in Nunjuks) to the CSV transcription. This builds an output for the body of the note.engagement.type
references the type of engagement to output.
Have more questions? Don't hesitate to contact our Support team. We're always here to help you!