Live Chat API

Hi,

I understand from other posts that there is no API for Live Chat, beyond manipulation of the chat widget, which I find very strange.

https://community.hubspot.com/t5/APIs-Integrations/API-to-query-conversations-Live-Chat/td-p/344825

https://community.hubspot.com/t5/APIs-Integrations/Live-Chat-contact-availability-control-through-API/m-p/269194#M24298

So I have resorted to using a chatbot webhook in a chatflow to retrieve the ‘lastInteractionAt’ date from the JSON payload. I also need the chat agent (hubspot user), but can’t see it in the payload?

Please advise.

Hey @KirstyC,

Currently, the chatbot webhook payload doesn’t contain the chat agent information. Here’s an example of the request payload:

{
 "userMessage": {
 // Details for the last message sent to your bot
 "message": "100-500",
 // The last message received by your bot, sent by the visitor
 "quickReply": {
 // If the visitor selected any quick reply options, this will be a list of the selected options.
 // Will be 'null' if no options were selected.
 "quickReplies":[
 // A list of quick reply options selected by the visitor
 {
 "value":"100-500",
 "label":"100-500"
 }
 ],
 },
 "session": {
 "vid": 12345,
 // The contact VID of the visitor, if known.
 "properties": {
 // A list of properties collected by the bot in the current session.
 "CONTACT": {
 "firstname": {
 "value": "John",
 "syncedAt": 1534362540592
 },
 "email": {
 "value": "testing@domain.com",
 "syncedAt": 1534362541764
 },
 "lastname": {
 "value": "Smith",
 "syncedAt": 1534362540592
 }
 }
 }
 }
}

Moving forward, I can honestly see a use case for this request and if you haven’t already, I’d recommend jumping over to the HubSpot Ideas Forum and posting this idea there so that it’s visible to the HubSpot product team and other HubSpot customers and developers. Hopefully this will gather more interest.

Thanks for your reply @WendyGoh

Webhook aside, please would you confirm there is no API for Live Chat, beyond manipulation of the chat widget?

Hey @KirstyC,

That is right. For now, we only support the Conversations | Chat Widget SDK.

I have a question regarding the identification API. On one of the sites we have, the identificationToken shows the correct user information in the chat. However, on another site, it shows the incorrect user. We tried to copy and paste theidentificationToken from the correct one to the incorrect one and it’s still doesn’t work.

Any thoughts?