APIs & Integrations

BMUribe
Participant

How can I get "senderActorId" to reply to an existing thread

I'm using the Conversations API to allow users to see the full conversation thread directly from my app. I want the users to be able to reply to a message as well. 

I tried using the endpoint https://api.hubapi.com/conversations/v3/conversations/threads/{threadId}/messages

I can get most of the requested parameters such as channelId, channelAccountId, from the other messages in the thread, but if the user has never responded there is not way for me to see their "senderActorId" .

The only way I'm able to get their Id is if the user has replied externally (by email). 

I've attempted constructing the actor id like "A-{contactId}", but 
this is the response I get back from the API

```


{
"status": "error",
"message": "Invalid actorId type",
"correlationId": "9f2e1e1d-7641-4a17-a17a-b55b932d6da4",
"context": {
"parameter": [
"actorId"
]
},
"category": "VALIDATION_ERROR",
"subCategory": "ConversationsApiError.INVALID_ARGUMENT_TYPE"
}

```
Where, or how can I get the actor Id from an existing contact?

0 Upvotes
2 Replies 2
NOlah
HubSpot Moderator
HubSpot Moderator

How can I get "senderActorId" to reply to an existing thread

HI @BMUribe,
Thanks for reaching out to the Community! I understand you'd like to know how to get the actorID of contact when using the Conversations API (BETA) mentioned here


In our documentation, it's noted here that to get the Actor ID, you must make a request to get a message or thread and it will be provided in the response.

Please let me know if there are any additional questions or mark this as an accepted solution if it has resolved your query!

Best,

Noemi

0 Upvotes
BMUribe
Participant

How can I get "senderActorId" to reply to an existing thread

Hi, 
Let's explore a typical scenario. 
1. User submits a ticket

2. Customer service agent contacts user by email to get additional information.
3. The user replies to the agent using the conversation API.

 

Step 3 is the problematic one since, by calling 

 

`GET /conversations/v3/conversations/threads/{threadId}/messages`

 

I'm not able to get the actor Id of the user because, the user has not responded yet.

 

 

 

0 Upvotes