-
Notifications
You must be signed in to change notification settings - Fork 13.5k
REST nor Real-time API returning visitor "department" #13766
Copy link
Copy link
Closed
Labels
Description
Description:
After installing liveChat code on website, I am defining an specific department visitors will go to with:
RocketChat(function() {
this.setDepartment('FILL HERE DEPARTMENT NAME - case sensitive');
});
I want to listen and treat visitors differently depending on which department they were assigned to. However, there is no API call that returns information on which department visitor was assigned at.
Steps to reproduce:
I have tried:
curl http://localhost:4000/api/v1/livechat/room?token=< tokenFromVisitor>
>>> No department information
curl http://localhost:4000/api/v1/livechat/visitor/<tokenFromVisitor>
>>> No Room nor department information
Expected behavior:
Have an API call returning:
{
"visitor": {
"_id": "dEhskC9xL5HtZDpiR",
"username": "guest-4",
"name": "Guest-Chrome",
"token": "BBRFBCPffLk7siZxs",
status: 'online'
},
"rid": "ROOM_ID",
"department": "DEPARTMENT_ID",
"success": true
Server Setup Information:
- Version of Rocket.Chat Server: latest
- Deployment Method: docker
- Number of Running Instances:
- NodeJS Version: 8
- MongoDB Version: 3.6
Additional context
Could that be solved by a DDP subscribe? How and which collection could be used?
Reactions are currently unavailable