How to get the user's id of the current Freshchat conversation in Freshbot

Hi there! I’ve to create a brief integration via API (the API library of the Freshbot) between Freshbot and Freshchat.

The Freshbot is already implemented in Freshchat, but what I’ve to do is create a API (in the bot) that will make a request to the user API in Freshchat, updating the custom properties of that user with some info of the same. Like so:

image

The problem is that I can’t get the user’s id in a dynamic way. Thought I could use the “Customer’s Id” parameter in freshbot as shown above (I don’t know if that is a native parameter), but it doesn’t work. I also send that parameter to a webhook *(webhook.site)*and it’s data was empty.

image
This is the parameter.

How can I get the current user’s id automatically? Is it possible to do that in Freshbot?

Thanks!

1 Like

@Matheus_Souza_Silva,
Good Day!
I will check with the product team regarding this query and get back to you at the earliest

Thanks

2 Likes

@Matheus_Souza_Silva ,

You can hit the conversations API and get the user ID,
Once you get the user_id you can use it in the user API

please refer this API for more reference

Hope it helps

Thanks

To set custom user properties from bot to chat, you can do to this:

For freshbots accounts that is not embedded into freshchat:
In the integration configuration: Settings > Freshchat > select Freshchat Widget + Live Agent Assist > then edit the integration configuration for your bot > field “Customer meta”: you can set the payload to return:

[
	{
		"name": "property1",
		"value": "${{custom::1053141}}"
	},
		{
		"name": "property2",
		"value": "${{custom::1053456}}"
	},
	...	
]

PS: in this case you can pick up the nodes id in the classic interface.

For new accounts where bots is embedded into chat:
Just set it using the action “Set property”:
image

1 Like

Hi Samuel. The Freshbot that I’m working on isn’t embedded into Freshchat.

So, I didn’t understand what I need to do in the Customer meta, I fill that filed with a json, but how that will be registered in Freshchat on the user object?

Thanks!

The properties you set in customer meta will be set in custom user properties in freshchat when you assign the conversation to freshchat, using actions “assign to group” or “resolve” from freshbots.

2 Likes

I tried doing as you told, but it didn’t work :confused:

Can we make a call to resolve this issue?

@Matheus_Souza_Silva While we are checking with the Freshchat internal team and passing on the suggested solution, could you try connecting with Freshbots support at Support : Freddy?

Hi @Matheus_Souza_Silva

We tried connecting with the Freshchat team to help you out on this. Unfortunately, we haven’t received any response from the team. I recommend you raise a ticket with support@freshchat.com including the link to this topic for additional context.