All Collections
Integrations
Integrated Workflows
Export Speech-to-Text to HubSpot
Export Speech-to-Text to HubSpot

Export your call transcriptions into HubSpot as notes

S
Written by Shelby Glynn
Updated over a week ago

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.

  1. Scroll down and select +Add Workflow.

  2. Name your workflow.

  3. For a trigger Object, select Transcription. Action: Created.

  4. Optional: Add conditions if you want transcriptions to export to HubSpot only in cases where these conditions are met.

  5. As an Action type, select API request.

    1. Endpoint: https://api.hubapi.com/engagements/v1/engagements

    2. Method: POST

  6. In the Values section (the request body), include the following key-value pairs:

    1. Key engagement.active has the Value True

    2. engagement.ownerId is 1

    3. for Key associations.contactIds.0 paste the following Value:

      1. {%- for url in event.properties.call.contacts[0].external_urls -%} {%- if url.integration_name == "hubspot" -%} {{ url.external_url | split("/") | last}} {%- endif -%} {%- endfor -%}

    4. for Key metadata.body paste the following Value:

      1. <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 %}

    5. engagement.type is NOTE

  7. 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!

Did this answer your question?