powered by Jive Software

Web API remove users from room, need help!


#1

Hello,

I have an issue and I was wondering if anyone could help me. We have an Openfire server set up. We are dynamically creating chat rooms on the fly for customer server chats with an agent. So we create a room dynamically for each conversation. We have an automated process that cleans up those rooms after they are empty. What we need now is the ability to sometimes clean a room on demand if one person never closes their browser and leaves the room open for a long time. So our end goal is to have the ability to empty a room of users so our clean up process will find the room and execute (that process does other logging events that we need, so just deleting the room is not optimal, it would be best if we can empty it and let the normal process clean it up).

We would like to have the ability to remove users from the room, I am trying to make the WebAPI call to the delete user from a chatroom api but it doesn’t seem to be working. The call requires a “role” in the path, ours users have a current role of “participant” but that is not a valid option for this API. When we call it with “members” it does not find our users, I am guessing some here but it seems like our users are not members, but visitors? Is there a way to remove them from the room if they are not members? Or are all users in a room members and am I making some other mistake? Can we make them members?

This is not our first API call, we can call others with no issues, in fact prior to removing the members we are calling get users to find all the users in the room. Our end goal really is an empty room.

Any help would be appreciated.


#2

Why not just kick the user?

If you kick/close all the sessions of the user after the defined time, the room will be also automatically removed (like you mentioned)

REST API to close alle open sessions: REST API Plugin Readme


#3

We are actually in a call center, so 1 side of the conversation is a customer, the other people in the room are customer service agents. We want to clear the room. But as far as I know the only kick method, kicks the user from ALL the rooms they are in. Our agents may be in more than one room at a time helping multiple customers, so we can’t kick them.

Unless I am mistaken and there is a kick method that is limited to one room/user. Did I miss that somewhere?


#4

Its not possible yet to kick a user from a specific room. My use case was more for the “customer” which forgot to close the window.


#5

Hi you can use Rstapi plugin in openfire

using this url
DELETE http://example.org:9090/plugins/restapi/v1/chatrooms/global/members/testUser