Greetings, I’m trying to develop a customer portal where you can see the tickets linked to the logged user, I’m using the tickets API and the conversations API to send messages into the ticket thread, but the problem I’m finding is that it only lets me send messages with an Agent type Actor Id, I need to be able to send new messages using an actor id linked to the current logged user which is not an Agent in the HubSpot portal, I need to dynamically set the actor id based on the logged on user email.
Hi, @AbenCermeno7
Thanks for sharing your challenge. Let’s see if we can get the conversation started. Hey, @himanshurauthan @klloyd__1, have you tinkered around with this functionality before?
Thanks for looking! — Jaycee
Thanks for the tag, @Jaycee_Lewis!
@AbenCermeno7, have you looked into HubSpot’s Customer portal feature? It is a prebuilt way to accomplish what you’re looking for, no coding required. While admittedly slightly limited in how you can customize the appearance and some features, it will save you a lot of time to set up and start servicing your customers. So definitely give that a look if you haven’t already.
Continuing down the custom route, you need to use the new Visitor Identification API to determine who the logged-in user is. You should note that this requires a Professional Hub subscription of some level, so if you already have Service Hub Professional, you may as well use the Customer Portal feature. I believe the Actor ID refers specifically to which HubSpot user you’re sending the message to the customer on behalf of. I think this is a requirement because the outgoing message needs to be linked to a specific HubSpot user. This way, when your customer receives the message, it appears to be coming from one of your actual team members. A workaround could be creating a HubSpot user, ‘My Company Support,’ if you want to maintain a more generic messaging.
Thanks for your reply @klloyd__1 , i actually thought the same workaround and created an generic HubSpot user called ticket customer, the thing with the Visitor identification API is that it works with the live chat right? not with sending messages via the conversations API?
@AbenCermeno7 ah yes, that would require the conversation to be an initiated chat. Another way to identify which existing HubSpot user you’re interacting with is through the Tracking Code API. Slightly different to the identify visitors API, this utilizes the cookie in their browser. A potential issue here is if they’re on a brand new device on a page through which they have not converted. But, if the page they’re on in your case is gated behind a login, that info should have provided their actual email, match to the cookie, and still allow you to identify. Give that Tracking Code API a try and let us know how it works!
@AbenCermeno7 also, do you mind describing the actual messaging that’s going on? Is this a live chat, bot chat, email conversation back and forth with your customer?
Hello @AbenCermeno7,
Take a look at the Visitor Identification API, this allows you to identify visitors to your site that were authenticated using your own external authentication system, but this API requires either Marketing Hub, Sales Hub, Service Hub, or CMS Hub.
Now coming to your question about Actor ID, I think it’s the Id of the Hubspot User you are trying to send the message from. But currently, the Conversations API does not allow any sort of request through which we can detect the Actor ID of the HubSpot User.
Regards,
Thanks for your reply @himanshurauthan but then i cant use the visitor identification API to get an actor id right? the thing is that the conversations API only permits sending messages with Agent type Actor Ids
No, you won’t be able to get the actor id using the visitor identification API but using the Visitor Identification API. You can pass logged-in user information directly to the chat, which identifies them in the Conversations inbox.
- Firstly, from your backend, you need to create a token using the Visitor identification API ( conversations/v3/visitor-identification/tokens/create ), by passing in the logged-in user email.
- Now, using the token created you can set the properties in hsConversationsSettings window object:
window.hsConversationsSettings = {identificationEmail: "visitor-email@example.com",identificationToken: "<TOKEN FROM STEP 1>"};