> For the complete documentation index, see [llms.txt](https://help.sipgate.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.sipgate.de/cloud-telefonanlage/en/connections-and-integrations/integrationen-fur-die-sipgate-app/wie-nutze-ich-den-sipgate-ai-assist-in-verbindung-mit-hubspot-slack-google-sheet.md).

# How do I use sipgate AI Assist together with HubSpot, Slack & Google Sheets?

Instructions for using sipgate AI Assist with HubSpot, Slack, and Google Sheets via Zapier webhooks.

This article shows a practical application of the [AI Assist webhook](/cloud-telefonanlage/en/using-sipgate/die-sipgate-app/wie-richte-ich-den-sipgate-ai-assist-webhook-ein.md) with Zapier. For the basics of setting up the webhook itself, see the linked article.

#### Prerequisites

AI Assist is available exclusively in the sipgate app, which is used in conjunction with the sipgate cloud phone system.

{% hint style="info" %}
The AI Assist webhook is configured directly in the sipgate **desktop app** and is distinct from [CI webhooks](broken://pages/73d6495c7db63f1fa4e6613c2f0ccf6aa501aab5) which are configured in the web app and transmit CI content.
{% endhint %}

The webhook can only be configured by administrators of the sipgate account and applies only to channels. Therefore, a channel with a phone number is required in sipgate.

A Zapier plan that includes webhooks is required, and the API must be available in HubSpot.

{% hint style="info" %}
Note: This feature is currently in beta in the app and can be found under "Labs" in the settings if you are a beta tester. After release, the feature will be listed under AI features.
{% endhint %}

#### **Step 1: Create a webhook in Zapier**

After signing in to Zapier, create a new Zap using "+ Create" in the top left:

![01-ZapierCreate.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-8814796ecbdd5f7c7cd154f78f65c7cb52c67d0f%2F01-ZapierCreate.png?alt=media\&token=190eb6bb-9c59-4d23-b122-4cf1df040f70)

#### **Step 2: Set up the trigger**

Select the first trigger in the new Zap:

![02-ErsterTrigger.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-90bb3da208246b400ccbaf34d607a17b18880bf7%2F02-ErsterTrigger.png?alt=media\&token=4712608a-5fd9-4779-90df-b7c6afa8b7c5)

Select Webhooks for this trigger:

![03-ErsterTriggerWebhooks.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-ab109ab564b829d204580a02a7e5517d1989934f%2F03-ErsterTriggerWebhooks.png?alt=media\&token=d4b1dc5e-6b12-406a-8e8a-8df8c77cf674)

Set the trigger event to "Catch Raw Hook":

![04-CatchRawHook.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-b0c8bf0086f83d63e19e9f95542de107fd7df5a2%2F04-CatchRawHook.png?alt=media\&token=f64b2b03-b38b-490a-b3b2-e7a6e77ee90f)

Click "Continue" to access the webhook, then click "Copy" to copy it to the clipboard:

![05-CopyHook.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-63d8a2efd7a628a6fc88a7364130c2fba8a66d78%2F05-CopyHook.png?alt=media\&token=60f97e01-4718-4f80-831b-54206d8daf01)

#### **Step 3: Add the webhook to AI Assist**

Enter the webhook in the sipgate app under "AI Assist Webhook" and select the "VCON" format:

![06-AIassistHook1.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-b28e046682d11dd5e9b5eabf429a61c774e5ef9d%2F06-AIassistHook1.png?alt=media\&token=4d70f603-0051-40ed-9681-9be9f5ab8542)

![07-AIassistHook2.png.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-813d8f9fe6172ed3f2e2c9e28ac91e0adb2c5b3a%2F07-AIassistHook2.png.png?alt=media\&token=7751310a-1099-4678-a46e-ebda8908995e)

Don't forget to save.

#### **Step 4: Test the trigger**

First, make a call using a channel in your account and wait for the call summary to appear in the sipgate app.

![08-sipgateAppZusammenfassung.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-373e431bd245c94707b561140eae83fbf63f63ad%2F08-sipgateAppZusammenfassung.png?alt=media\&token=8ac97fdc-3780-46e7-8f93-c44abbf2f6d6)

Back in Zapier, click "Test trigger" to test the trigger. The calls are then listed as "records", with the first call, for example, listed as "request A". Select a record and click "Continue with selected record" to proceed.

![09-WeiterMitRecord.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-2de6aecdd891c96cee993680dabd3e3c05eef35c%2F09-WeiterMitRecord.png?alt=media\&token=c23a56e7-6775-4ae3-a53b-d090fe5dccef)

#### **Step 5: Extract data fields**

The transmitted data is in a raw format and can be converted into data fields in the next step using "low code":

![10-CodeAuswaehlen.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-4122680d2ba356d48545bf027ac5fbbe9f0ecf87%2F10-CodeAuswaehlen.png?alt=media\&token=648e86b6-4e36-4116-997e-9eaa96f7930e)

This example uses Python, but you can also choose JavaScript.

![11-CodeDefinieren.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-e06a59fd950a72604b27ec417367b8ee28b4e3f7%2F11-CodeDefinieren.png?alt=media\&token=85cac800-cdc9-4989-b091-f7c6784559fc)

To inspect the data structure, switch to "Test" and copy the data to the clipboard:

![13-RohdatenZwischenspeichern.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-0a7f759eb3f3a5e8b1393ac42823e84b74cb2dda%2F13-RohdatenZwischenspeichern.png?alt=media\&token=ebe4187e-79d6-472e-a8b4-f3d2cf7194e5)

To make the data easier to read, paste it from the clipboard into an editor and format it hierarchically. An editor that understands JSON is helpful for syntax highlighting.

![14-FelderVorbereiten.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-349cdf7bbbfc0b333e63e3a4fd55a153b423d940%2F14-FelderVorbereiten.png?alt=media\&token=6a83504b-101a-4c3e-8734-db2182206c3d)

Once you have identified the desired fields, you can populate them in the code:

![15-BeispielCodePython.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-6405fd7538cce8eea805b0c9284171fcd5c87e15%2F15-BeispielCodePython.png?alt=media\&token=a4450ae7-6899-420b-a1be-967823c7e515)

In this Python example, that is:

```python
# Let python understand JSON
import json
Parse the raw_body string into a dictionary
raw_body_dict = json.loads(input_data['raw_body'])
Now you can access the fields in Zapier
return {'uuid': raw_body_dict['uuid'],
'created_at': raw_body_dict['created_at'],
'updated_at': raw_body_dict['updated_at'],
'subject': raw_body_dict['subject'],
'agent': raw_body_dict['parties'][0]['tel'],
'customer': raw_body_dict['parties'][1]['tel'],
'start': raw_body_dict['dialog'][0]['start'],
'duration': raw_body_dict['dialog'][0]['duration'],
'analysis': raw_body_dict['analysis'][0]['body'],
'channel': raw_body_dict['tags']['channel_name'],
'direction': raw_body_dict['tags']['direction']
}
```

Click "Continue" and "Test step" on the following page to see the populated fields:

![16-FelderMitDaten.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-bc2c22ed6f8c143b75cb07a7745b4e5694f91314%2F16-FelderMitDaten.png?alt=media\&token=a4a488c4-6d12-4920-ae28-fe9be5da0002)

Publish the step, then move on to the next item.

#### **Step 6: Log the call in HubSpot**

**Step 6.1: Find the contact**

Since the goal is to log a call, first find the contact in HubSpot. You can do this using a ready-made template.

So add another step:

![17-AddStep.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-2e05c670eb0529855a6f2664e05184d9c8d9ff72%2F17-AddStep.png?alt=media\&token=91ba8041-b273-4747-97d8-e4b1ceb1a95c)

Select HubSpot:

In the next step, set the "Action Item" to "Find Contact", then click "Continue".

![19-ActionEventFindContact.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-a2aed60a9154ca8845656511400123b0afc3612e%2F19-ActionEventFindContact.png?alt=media\&token=e139c1d0-13bf-4cd2-8bee-535943449d83)

The call metadata contains the contact's phone number, which can be used as the search criterion. In this example, select the "Property" "Contact information : Phone Number" and "Contact information : Calculated Phone Number in International Format". A "+" is prefixed to the values in the fields.

![20-FindContactProps.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-7dda77df42209968afdae41c6ae1d3401ef5709c%2F20-FindContactProps.png?alt=media\&token=4b1b92a1-8c39-4315-a966-5603eeb22e2b)

Click "Continue" to run "Test step". If the contact is found, it looks like this:

![21-KontaktGefunden.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-874215a4c288a255671b48a822d774d030f9ddb1%2F21-KontaktGefunden.png?alt=media\&token=1a86d67d-9911-44fa-8eb2-860133122887)

**Step 6.2: Log the call**

Next, create the log. To do this, add another step:

![22-4terKnoten.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-865356ed9e8dd9852926241868aba75fecc9d56f%2F22-4terKnoten.png?alt=media\&token=b027d695-72e8-4f28-ba96-62ef4228f708)

The required "Action event" in the HubSpot template is "Create Engagement":

![23-CreateEngagement.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-572bc64b627de1f3d6c059e14c21548d3ac93d25%2F23-CreateEngagement.png?alt=media\&token=cc24180a-9023-4b7e-8e8a-b76ece2bb4c7)

Now specify the details

![241-EngagementDetails.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-97639475c7167c5c11a243aea1d3a160a36657db%2F241-EngagementDetails.png?alt=media\&token=d3f7b2f6-8205-479f-bd87-89cb12eff3f3)

Finding the contact ID is somewhat hidden:

![242-EngagementDetails.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-ff26cf4917a6f83e5ed9dc16668fa920ca7e07d0%2F242-EngagementDetails.png?alt=media\&token=629908ea-40df-45af-97ea-ce1cdfe63f49)

![243-EngagementDetails.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-c16e68e49e4d3eb9213e746dbc286824059013a1%2F243-EngagementDetails.png?alt=media\&token=88b1269f-bf86-4f1c-b9d5-eb6954a08902)

Clicking "Continue" and "Test step" produces the following:

![25-EngagementTest.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-ee45f76436b3187be54d304fa2525a55496fbe16%2F25-EngagementTest.png?alt=media\&token=8e3c906a-bddf-4a9a-b9ff-75eb72fc1454)

Finally, confirm by clicking the "Publish" button. This is how it then appears in HubSpot:

![26-Hubspot Kopie.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-96c4cabf30cec661ead8e6567581243079584d00%2F26-Hubspot%20Kopie.png?alt=media\&token=40e540da-4d47-46d0-8cbb-8875d9c12ee1)

#### **Step 7: Update the Google Sheet**

Next, add the call to a spreadsheet for later analysis.

So add another step:

![27-5terKnoten.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-5419a2b1ab35b5700c1c083feddf24920a016175%2F27-5terKnoten.png?alt=media\&token=2a289d4e-50c7-40ca-8800-5ca05fe4276b)

Google Sheets is used as the template here:

![28-TemplateGoogleSheet.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-81470969d6f464dffeda28bc94168aa59e401cb6%2F28-TemplateGoogleSheet.png?alt=media\&token=a76e95ee-44f8-40b5-8968-08f2d75c1b2d)

The selected "Action event" is "Create Spreadsheet Row at Top". It inserts a blank row below the header row and then fills it with the data.

![29-ChooseEvent.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-8c27215779ff682b47f3deec373ac409e02fdd21%2F29-ChooseEvent.png?alt=media\&token=6dca024d-aef3-4b45-987b-4175790c015f)

In the next step, select the location, file, and sheet, then map the fields to the columns:

![30-gSheetMapping.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-8e296e759dca5cc96af743778498f2ef1c2757a3%2F30-gSheetMapping.png?alt=media\&token=60ba276d-6bca-4c93-84d5-baa0ab88454a)

Then click "Continue" and "Test step" again:

![31-gSheetTest.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-db5324e0aa34bf141c94a2556476ae6bd72e7251%2F31-gSheetTest.png?alt=media\&token=c51bff4e-3db2-4ce3-9746-a6b817eb4e33)

Click the "Publish" button to publish the template

And this is what it looks like in the sheet:

![32-gSheet.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-89a1bf94f555cc2b29fbf829c0a818c75928866b%2F32-gSheet.png?alt=media\&token=ab78da48-138e-46de-984f-57bedb804a15)

#### **Step 8: Post a message in Slack**

As a final step, you can send a message in Slack, for example, to inform your colleagues about the conversation. The caller may already have been in contact with someone.

Start with another node:

![33-6terKnoten.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-476552d1642c76ff102aa2275015ee8deed41e36%2F33-6terKnoten.png?alt=media\&token=7dc401f6-f44e-48e6-9b99-fa393a7b0b9f)

Select the Slack template:

![34-TemplateSlack.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-cf9100cbd5e138f6a1f984405d748078d467692b%2F34-TemplateSlack.png?alt=media\&token=d87409c6-27aa-4e4a-b3b0-489fb4513567)

Then select "Send Channel Message" as the event and configure the Slack account:

![35-SlackChannelKto.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-0372c533cccfd63f1e671f84caf1707ed5ee331a%2F35-SlackChannelKto.png?alt=media\&token=2fe4a339-d4ac-401b-aa5d-87b9707baa49)

Now select the channel and compose the "Message":

![36-SlackDetails.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-3d296a2b9ead7a42f9a50c3f4bd3f18ea87dfbe3%2F36-SlackDetails.png?alt=media\&token=d8056d78-b866-4197-ab05-550046ab9991)

Then click "Continue" and "Test step" as usual:

![37-SlackTest.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-352214a2bf6842b8402b346204314dba7a4925cf%2F37-SlackTest.png?alt=media\&token=58a176a1-a55e-44d6-bd00-299d356b3070)

And here's the result in Slack:

![38-Slack.png](https://4045603198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg0qj71PeONPljdPedXLf%2Fuploads%2Fgit-blob-1d2c83181f29a7ceedf9568513f9c5c2b891826c%2F38-Slack.png?alt=media\&token=0f098ddc-4db5-488d-9343-52eeb74a0698)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.sipgate.de/cloud-telefonanlage/en/connections-and-integrations/integrationen-fur-die-sipgate-app/wie-nutze-ich-den-sipgate-ai-assist-in-verbindung-mit-hubspot-slack-google-sheet.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
