diff options
Diffstat (limited to 'src/mod_http_api.erl')
-rw-r--r-- | src/mod_http_api.erl | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/mod_http_api.erl b/src/mod_http_api.erl index 34e118cc..3a1b2203 100644 --- a/src/mod_http_api.erl +++ b/src/mod_http_api.erl @@ -5,7 +5,7 @@ %%% Created : 15 Sep 2014 by Christophe Romain <christophe.romain@process-one.net> %%% %%% -%%% ejabberd, Copyright (C) 2002-2019 ProcessOne +%%% ejabberd, Copyright (C) 2002-2020 ProcessOne %%% %%% This program is free software; you can redistribute it and/or %%% modify it under the terms of the GNU General Public License as @@ -30,12 +30,13 @@ -behaviour(gen_mod). -export([start/2, stop/1, reload/3, process/2, depends/2, - mod_options/1]). + mod_options/1, mod_doc/0]). -include("xmpp.hrl"). -include("logger.hrl"). -include("ejabberd_http.hrl"). -include("ejabberd_stacktrace.hrl"). +-include("translate.hrl"). -define(DEFAULT_API_VERSION, 0). @@ -520,3 +521,16 @@ hide_sensitive_args(NonListArgs) -> mod_options(_) -> []. + +mod_doc() -> + #{desc => + [?T("This module provides a ReST API to call ejabberd commands " + "using JSON data."), "", + ?T("To use this module, in addition to adding it to the 'modules' " + "section, you must also add it to 'request_handlers' of some " + "listener."), "", + ?T("To use a specific API version N, when defining the URL path " + "in the request_handlers, add a 'vN'. " + "For example: '/api/v2: mod_http_api'"), "", + ?T("To run a command, send a POST request to the corresponding " + "URL: 'http://localhost:5280/api/<command_name>'")]}. |