mirror of https://github.com/zulip/zulip.git
Document humbug-send and humbugrc in README for API users
(imported from commit 9ca282d4d768f2d2a474da1209621f03147954fe)
This commit is contained in:
parent
2da0a2275c
commit
f76ea63b77
19
api/README
19
api/README
|
@ -15,9 +15,14 @@ as we make any changes to them.
|
|||
The easiest way to use these API bindings is to base your tools off
|
||||
of the example tools under api/examples in this distribution.
|
||||
|
||||
If you place your API key in ~/.humbug-api-key the Python API
|
||||
bindings will automatically read it in. You can obtain your Humbug
|
||||
API key from the Humbug settings page.
|
||||
If you place your API key in `~/.humbugrc` the Python API bindings will
|
||||
automatically read it in. The format of the config file is as follows:
|
||||
|
||||
[api]
|
||||
key=<api key from the web interface>
|
||||
email=<your email address>
|
||||
|
||||
You can obtain your Humbug API key from the Humbug settings page.
|
||||
|
||||
A typical simple bot sending API messages will look as follows:
|
||||
|
||||
|
@ -48,3 +53,11 @@ send_message() returns a dict guaranteed to contain the following
|
|||
keys: msg, result. For successful calls, result will be "success" and
|
||||
msg will be the empty string. On error, result will be "error" and
|
||||
msg will describe what went wrong.
|
||||
|
||||
#### Sending messages
|
||||
|
||||
You can use the included `api/bin/humbug-send` script to send messages via the
|
||||
API directly from existing scripts.
|
||||
|
||||
humbug-send hamlet@example.com cordelia@example.com -m \
|
||||
"Conscience doth make cowards of us all."
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
; put this file in ~/.humbugrc
|
||||
[api]
|
||||
key=<api key from the web interface>
|
||||
email=<your email address>
|
Loading…
Reference in New Issue