Hubspot Integration - Service History August 07, 2023 16:54 Updated Table of Contents: How the Service History works Prerequisites Configuring your bot to register the service history Configuring the Human Service block Configuring the Exit conditions tab Content tab Actions tab Headings, Method, and URL Body Reply variables How the Service History works This integration registers the interactions in your service tool, Blip Desk. When a service ticket is closed, the chat history with the agent is registered in the contact’s activity in HubSpot. It is worth mentioning that, in cases of service transfer to another agent, only the last closed ticket is registered. Obs.: If you are using the router resource, you will need to add another heading. This heading’s configuration process is described below, and be aware that the key employed must be the human service sub-bot’s. Prerequisites 1 - Before you try to register a lead in HubSpot, HubSpot’s plug-in must be already installed in your bot. If it is not, find out How to integrate the Smart Contact to the workflows in HubSpot. 2 - The entire registration flow must be duly configured and functional, so the lead must be registered before you try to transcribe its ticket. 3 - The human service must have already taken place and must have been completed properly, in such a way that, during the interaction, messages were exchanged between the agent and the client. 4 - The email is essential for this ticket’s registration, that is, if the same user informs another email, another contact will be registered in HubSpot with the ticket registration, which may result in strange behaviors in the integration. 5 - HubSpot should have been previously integrated in the router (if this resource is being used) or in its monolithic bot. 6 - Basic flow creation knowledge in Blip. Configuring your bot to register the service history Differently from Lead registration, the service history registration does not require any special information to make it possible. Important! It is necessary to set the user’s email in the contact because the integration will use this piece of information to identify to which user transcribe the human service. Configuring the Human Service block Firstly, you need to do the initial configurations in the human service block if you have not done so. The documentation for this procedure is available here. To show you how to do this configuration, we assume your conversational flow was already created, is using a router or creating a single bot, and that, at some level, the human service bot is very similar to the hypothetical flow below, where, above all, the lead was already created and the human service block was duly configured. In this scenario, regardless of to which block the human service flow is directed, after its execution (in the example above, it is a block called “Conclusion”), we will be changing this behavior and the flow to a new block, which is renamed as Human Service Transcription, which will be responsible for redirecting to Conclusion. Configuring the Exit conditions tab Obs.: Before further explanation about this tab’s settings, we stress we do not recommend the creation of other settings in addition to those mentioned in this document in the Human Service Transcription to avoid polluting the variable input.content. Once you created and renamed the New block to Human Service Transcription, select the Human Service block and access the Exit conditions tab. Change the value of all Go to fields in which Conclusion is found to point to the new block you created and which, if created according to the instructions of the previous paragraph, should be called Human Service Transcription. Then, the result must be similar to the picture below. After this procedure, you need to assign to the block Human Service Transcription the responsibility of redirecting to Conclusion. To do it, select the block Human Service Transcription, select the Exit conditions tab, and simply change the values contained in this block in the sections EXIT CONDITIONS and DEFAULT EXIT according to the following instructions. EXIT CONDITIONS - If User’s Reply -> Existing Condition -> Go To Conclusion (in the case of your conversational flow, it is going to the block to which the Human Service was previously redirecting). DEFAULT EXIT - In Go to, use the same value employed in the tab Go to of the previous step (EXIT CONDITIONS). The result of these settings is displayed in the picture below: Observation: The steps below must be configured ONLY in the block Human Service Transcription. Content tab Select the block Human Service Transcription to gain access to the block’s settings menu, at the right side of the screen. In the content tab, move the mouse cursor over the “User’s entry” area and delete the selected content by clicking on the orange “trash bin” icon. Actions tab Once you are done configuring the Content tab, select the Actions tab to configure the service history registration request. To do it, click on add an entry action and then select the HTTP Request, as shown below: Headings, Method, and URL On the “Method” menu, select POST In URL, paste: https://hubspot.cs.blip.ai/api/HubSpot/v2/chat/history Expand the Headings tab: Add two headings by clicking on the button + add heading. In the first one, in Key, write BotId, and in Value, inform the ID of the bot used to create the integration. This piece of information can be found in the bot’s home page, in which the integration was created, as shown in the picture below. ID image of the bot. This page can be accessed by clicking on your bot’s picture, highlighted on the top left corner with the text “principal97.” Observation: The ID to be informed in the tab Value where Key is BotId should be the ID of the bot in which the HubSpot was integrated. Preferably, the integrating bot should always be the router if this resource is being used. Ergo, in this scenario, you should always use the router bot’s ID in Value. In the second one, in Key, write TicketId, and in Value, paste the value highlighted in bold in front of it {{input.content@id}}. Observation: Have in mind that the key employed must be the human service sub-bot’s. If you are using the router resource, you will need to add another heading. This heading’s configuration process is detailed below. In the third one (only for routers), to each one of your bots linked to your router that perform human service, follow the steps below. Select your bot’s settings in the main menu, as shown in the picture below: In the settings menu, select the connection information, as highlighted in the following picture: Scroll down until you find the item “Endpoints HTTP” and paste your bot’s “Authorization Key”’s value by clicking on the double-square icon, as shown in the picture below: Return to the builder and select again the block you created, according to the block “Human Service Transcription”, presented herein, and then select the “Actions” tab. This step is displayed in the picture below: Select the HTTP request previously created and access the request headings, adding the value “Authorization” in the field highlighted as “Key” and the value copied from the “Authorization Key” obtained in the previous steps in the field “Value,” as shown in the pictures below: Publish your bot’s flow and remember to do this procedure in all bots that render “Human Service.” Body Body: When you click on the body option, delete all content in the tab builder.json and write the value below in it, also illustrated in the next picture: { "contact" : {{contact.serialized}}, "integrations" : [ ]} In the square brackets, you will list for which integrations with HubSpot you wish to transcribe the human service. If left empty, as in the picture above, the service will be transcribed by default for ALL accounts informed to your bot in the integrated request’s heading. To inform the specific integrations for which you wish the transcription occurs, you need to consult our plug-in’s home screen and check how you named your integrations. These steps are illustrated in the pictures below: Now you know your integration’s name, you can copy and paste its name in the area marked by the square brackets of the request you saw previously. To do it, return to your HTTP request, select the body again, and, in the double quotes and square brackets, paste your integration’s name, as illustrated below: Observation: You must use your integration’s name and not the name used in this document’s example. To simulate a scenario in which you would have multiple integrations, imagine that in your plug-in’s integration screen, in addition to the integration Demonstration Documentation, there were other three integrations called N2, N3, and N4, for example, but you do not want to transcribe the human service for N2. In this case, you need to simply add a comma, separating the previous integration from the later, and the last listed integration will appear with no commas, listing the integrations N3 and N4, as shown in the next picture: Notice that the integration N4, which is the last one listed in the picture, does not have any comma, and that the integration N2 was not listed. This means the human service transcription will happen in all integrations, except for N2. By doing this, you can control which integrations will get the human service operations via Blip. Once you complete the configuration process of the integrations that will take place on the body screen, use the keyboard shortcut CTRL + S to save your changes and publish your bot’s flow. You will see that the operations were saved when the gray circle next to the text builder.json disappears, being replaced by the X icon seen below: Reply variables Firstly, we do not recommend the use of the variables set in this step to set any of your chatbot’s flow logics. We also inform that you do not even have to write anything in these fields. They can be left empty. Nevertheless, if you wish to fill these fields, please learn how to give meaningful names to these variables, such as attendanceTranscriptionStatus and attendanceTranscriptionResponse. Variable for the reply status: In this field, simply set a variable to store your API’s reply value. This is optional, but recommended for cases in which you wish to evaluate the API behavior. By default, the API reply should be 204 No Content. The user is responsible for bot flow logics in scenarios in which the API replies differently, in addition to which actions the bot will take in face of these adverse scenarios. For more information about the HTTP reply status, we recommend studying the REST protocol. Variable for the reply body: Optional variable. In successful cases, no value will be assigned to this variable because it points to No Content (we recommend studying the REST 204 reply for those who do not have any knowledge about this HTTP communication protocol). In cases of failure, a descriptive failure message should be filled in this field. For more information about the HTTP Request action, click on this link: Final ConsiderationsTherefore, to enable your bot to register the service history, it is necessary/advisable: Configure the lead registration and duly register the Lead in HubSpot with the email field informed. Configure the human service, selecting the desired channel, activating it, preparing its service lines, defining rules, and assigning agents. Create a block on Blip, which will be responsible for actions related to the human service transcription. Set an HTTP Request action that will send the contact’s information to our integration API with HubSpot, which, in turn, will transcribe the service in HubSpot. Service History Registration in HubSpot Validating registration Once all configurations described above are properly done, when the users interact with the bot, the service history registration should be successfully created in HubSpot, in the user event timeline, as seen below: To access this screen, browse through HubSpot accessing Contacts -> Contacts -> and select for which contact the human service was transcribed. If it is not displayed, make sure to select our integration with HubSpot in the activity filters, as seen below: For more information, access the discussion about this topic in our community or watch our channel’s videos. 😃 Related articles How to Install the HubSpot Integration App How to trigger notifications through integration with HubSpot How to register leads in HubSpot Hubspot Extension (Lanum) How to save human service history via Blip Integration with Google Drive