Skip to content

REST nor Real-time API returning visitor "department" #13766

@juliomac

Description

@juliomac

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions