Conversations API Beta

Jupita_team
Contributor

Identifying users in email conversation payload

We are trying to fetch email conversations through the web hook using https://api.hubapi.com/conversations/v3/conversations/ api.

 

The issue is, we are unable to identify either user - how can we identify if the sender/receiver is either the Hubspot agent (user) or the customer?

 

We tried utilising  https://api.hubapi.com/contacts/v1/contact/email/USERS_EMAIL_ADDRESS/profile however we could not discover the parameter which could enable us to differentiate between the HubSpot agent or the customer...

 

Please advise how this can be acheived, thank you!

0 Upvotes
12 Replies 12
Jupita_team
Contributor

Identifying users in email conversation payload

This API is not working for "E-" actor email types... 

 

We pass this -


https://api.hubapi.com/conversations/v3/conversations/actors/E-support@21582528.hs-inbox.com

 

We get this - 

 

{ "status": "error", "message": "ActorType `EMAIL` is not supported for `getting`.", "correlationId": "f919661b-5c54-4999-a193-4d22279f4be2", "context": { "actorType": [ "EMAIL" ], "operation": [ "getting" ] }, "category": "VALIDATION_ERROR", "subCategory": "ConversationsApiError.UNSUPPORTED_ACTOR_TYPE" }

0 Upvotes
pleninger
HubSpot Product Team
HubSpot Product Team

Identifying users in email conversation payload

Good afternoon,

Thanks for letting us know about this. This should be fixed now. Please let me know if you run into any more issues.

 

- Paul

Jupita_team
Contributor

Identifying users in email conversation payload

Hi Paul,

 

https://api.hubapi.com/conversations/v3/conversations/actors/E-support@21582528.hs-inbox.com

 

This API is now working, however, in response we are only receiving;

{

"id": "mailto:e-support@21582528.hs-inbox.com",

"email": "mailto:support@21582528.hs-inbox.com",

"type": "EMAIL"

}

 

From this response we are still unsure whether this Actor type is the Hubspot User Agent or the customer, also it does not return the name of the user associated with this email id.

 

We would like to be able to identify which user type has sent the email message (HubSpot User Agent or customer), as well as the names of the users involved.

 

These identifiers are currently able to be returned for the LIVE_CHAT, FB_MESSENGER, WHATSAPP & CUSTOMER_PORTAL_THREAD_VIEW channels if I'm not mistaken.

0 Upvotes
jhartz
HubSpot Product Team
HubSpot Product Team

Identifying users in email conversation payload

Hi,

 

Another field you can look at on messages is the direction field:

  • "INCOMING": the message was received as an incoming message from a contact
  • "OUTGOING": the message was sent as an outgoing message by a HubSpot user

 

For incoming messages, the sender's actor ID should be a contact (a "V-..." actor ID).

For outgoing messages, the sender's actor ID should be a HubSpot user (a "A-..." actor ID).

 

We don't currently compute specific actor IDs for recipients of email messages (which is why those just use "E-..." actor IDs with only email addresses). Out of curiosity, would it be useful for you to have more specific actor IDs (i.e. not "E-..." ones) for recipients of outgoing emails?

0 Upvotes
Jupita_team
Contributor

Identifying users in email conversation payload

Thanks Jake, we'll take a look at the direction field & report back, that sounds like it might work. 

 

We provide conversational analytics, we're able to allow HubSpot users to easily integrate with our platform by providing a read-only permission for all their HubSpot powered communications. All we require is to know who is speaking, across any channel - web chat, email etc. Without this it's not possible to provide HubSpot users analytics on their agents, customers & conversations as there are no identifiers. 

 

For eg, Jane Smith is a HubSpot agent, Jane jumps on a live chat with John Jones (customer), we're able to receive the identifiers for those users from other channels such as LIVE_CHAT, etc. However, if Jane Smith then emails John Jones after their chat... there is no way to thread the conversations together and the ability for analytics to continue falls down.

 

This functionality seems to be lacking for the email channel only, unless I'm missing something? 

0 Upvotes
pleninger
HubSpot Product Team
HubSpot Product Team

Identifying users in email conversation payload

Good morning,

 

Thanks for elaborating. Messages sent by an agent from HubSpot (Email, Live Chat or otherwise) should have an Agent actor id type that is consistent across channels, so you should be able to identify any messages sent by Jane across any channel.

 

There are two cases where we use the Email actor type:

- Recipient of incoming emails: when a message is sent to a shared inbox, it is not possible to resolve this to an Agent, since the Agent actor type represents an individual human.

- Recipient of outgoing email: when a message is sent from HubSpot to a customer (John, in your example), the recipient of the message is assigned an Email actor type, even though we might be able to resolve to a Visitor

 

It sounds like the latter is currently the pain point. 

 

In the absence of more specific actor types, you should still be able to accomplish what you are looking for by using the Contacts API. You can use the recipient email to look up the contact of the user, and use that ID to match with the Actor ID of the chatter.

0 Upvotes
Jupita_team
Contributor

Identifying users in email conversation payload

Hi all, just wanted to report back that everything appears to have gone smooth with development, direction field + contacts API worked a charm, as did the HTML parser to disregard email signatures. Initial testing looks good. 

 

Really appreciate the help with this one, cheers guys! 

 

Thanks,

Alexander. 

Jupita_team
Contributor

Identifying users in email conversation payload

That sounds great thank you! I think the direction field + the contacts API is going to allow omnichannel identification of users 🙌!!

 

We'll proceed accordingly, if any issues will let you know, otherwise will keep you updated on the development. Thanks again! 

0 Upvotes
Jupita_team
Contributor

Identifying users in email conversation payload

Just to clarify further, if we're marking live chat messages by Jane as 'Jane Smith' we need the same ID for the email messages, we can't join 'Jane Smith' and 'jsmith@abc.com' together... the identifiers have to be the same for the same users. 

0 Upvotes
Jupita_team
Contributor

Identifying users in email conversation payload

Thanks Dennis! Will check this out asap & report back!

Glad I found this group! We'll be using the conversations API to provide real-time conversational analytics for HubSpot users. Will provide feedback ongoing to help boost the overall value of this API.

 

Also any idea how we disregard email signatures in the payload? Like just the message body only, without the HubSpot signature? 

 

Vijay, FYI there is some bug in your welcome post, can't reply to it, see this screenshot (https://ibb.co/JBBrcqC), it's asking me to sign in or verify my email address to reply, other posts in this group not having same issue...

0 Upvotes
pleninger
HubSpot Product Team
HubSpot Product Team

Identifying users in email conversation payload

Welcome! We're very excited to see what you build with our APIs. Your feedback will be very helpful! To answer your question:

 


@Jupita_team wrote:

Also any idea how we disregard email signatures in the payload? Like just the message body only, without the HubSpot signature? 


This is not something that we support - the signature is stored as part of the message body. If you're using an HTML parser, you can identify HubSpot signature div elements as such:

<div class=hs_signature>

 

- Paul

dennisedson
HubSpot Product Team
HubSpot Product Team

Identifying users in email conversation payload

@Jupita_team !

I believe the new Conversations beta is going to help you out here.  Specifically, the identify actors component