Search code examples
ejabberd

Is it possible to update room title (and other options) using ejabberd REST API?


I am looking at Ejabberd's Admin API - https://docs.ejabberd.im/developer/ejabberd-api/admin-api/, there are APIs to

  • create room
  • create_room_with_opts
  • destroy_room
  • set_room_affiliations
  • get_room_* (few get room APIs)

but there is no option to update room options. Is there any way to update room title and other options of an existing room?


Solution

  • It was right there :)

    https://docs.ejabberd.im/developer/ejabberd-api/admin-api/#change-room-option

    Example usage:

    $ ejabberdctl get_room_options room1 conference.localhost
    title
    public  true
    moderated       true
    ...
    
    $ ejabberdctl change_room_option room1 conference.localhost title ABCD
    $ ejabberdctl change_room_option room1 conference.localhost moderated false
    $ ejabberdctl change_room_option room1 conference.localhost public false
    
    $ ejabberdctl get_room_options room1 conference.localhost
    title   ABCD
    public  false
    moderated       false
    ...