github.com/processone/ejabberd-api
Package ejabberd exposes ejabberd API in Go programming language. Both the library and the command-line tool can be installed from source with go get tool. If you have go installed in your environment you can install ejabberd command-line tool with: Before being able to interact with ejabberd API, you need to configure ejabberd with OAuth support enabled. This is is documented in ejabberd OAuth support documentation: https://docs.ejabberd.im/developer/ejabberd-api/oauth/ Here are example entries to check / change in your ejabberd configuration file: 1. Add a listener for OAuth and ReST API: 2. You can then configure the OAuth commands you want to expose. Check `commands_admin_access` to make sure ACL for passing commands as admins are set properly: 3. Finally, make sure the modules, you need to use the command from are enabled, for example: To use ejabberd Go client API, you need to have a token. If you do not have one, you can get one programatically using 'Client.GetToken' function. From there, you can use any ejabberd client function to call any ejabberd available command. Check 'ejabberd.Client' documentation for details on the currently available commands. As a default, the token is stored in a file called './.ejabberd-oauth.json' when using the command 'token' and read from the same file when you use any other commands. Option '-f file' will let you point to another file. The file contains a JSON structure with the following fields: For example:
proxy.golang.org
v0.0.0-20230612213402-2ec73ea51eaa
over 2 years ago
2
Links
| Registry | proxy.golang.org |
| Source | Repository |
| Docs | Documentation |
| JSON API | View JSON |
| CodeMeta | codemeta.json |
Package Details
| PURL |
pkg:golang/github.com/processone/ejabberd-api
spec |
| License | GPL-2.0 |
| Namespace | github.com/processone |
| First Release | over 4 years ago |
| Last Synced | 26 days ago |
Repository
| Stars | 18 on GitHub |
| Forks | 10 on GitHub |