1

I was going through https://docs.ejabberd.im/developer/extending-ejabberd/architecture/, which talks about roster management via REST API. Trying to find which module to use and what kind of API contract that REST API should implement. Can you please point me to some blog/tutorial which talks about how to achieve this?

Thanks & Regards Rama

user846895
  • 171
  • 1
  • 1
  • 5
  • Hi. Where exactly in that page did you find the mention about roster management via REST API? It would be nice to include a link in that paragraph to the proper explanations, once they are found too. – Badlop Apr 29 '20 at 16:59
  • The last sentence in (first paragraph of Overview) and also first picture has it under data modules block. "ejabberd is a configurable system where modules can be enabled or disabled based on customer requirements. Users can connect not only from a regular PC but also from mobile devices and from the web. User data can be stored internally in Mnesia or in one of the support SQL or NoSQL backend. Users can be totally managed by your own backend through a ReST interface." – user846895 Apr 29 '20 at 17:05

1 Answers1

0

and what kind of API contract that REST API should implement. Can you please point me to some blog/tutorial which talks about how to achieve this?

There are several commands related to roster:

$ ejabberdctl help --tags roster
Available commands with tag roster:

   add_rosteritem localuser localhost user host nick group subs 
         Add an item to a user's roster (supports ODBC)

   delete_rosteritem localuser localhost user host 
         Delete an item from a user's roster (supports ODBC)

   get_roster user host 
         Get roster of a local user

   process_rosteritems action subs asks users contacts 
         List/delete rosteritems that match filter

   push_alltoall host group 
         Add all the users to all the users of Host in Group

   push_roster file user host 
         Push template roster from file to a user

   push_roster_all file 
         Push template roster from file to all those users

You can find more details about those commands in:

https://docs.ejabberd.im/developer/ejabberd-api/admin-api/

Trying to find which module to use

All those commands are implemented in mod_admin_extra. So, you can simply enable this module in ejabberd.yml and the commands will be available for execution.

Badlop
  • 3,840
  • 1
  • 8
  • 9