In addition to the standard web interface, some functionality is
available via the
honk HTTP API.
With the exception of login, all requests should contain the following form values.
- The desired action. See below.
- An authorization token. Alternatively, may be passed in the “Authorization” HTTP header.
The API URL for all actions other than login and logout is /api.
Send a POST request to /dologin with the following form values.
- User name.
- Pass phrase.
- Must be “1”.
This will return a token to be used for future requests. The token is valid for one year.
Send a request to /logout with the token to be expired.
The action value should be “honk”. Content type should be multipart/form-data if an attachment is included. The following values are recognized:
- The contents of the honk.
- The format of noise. Defaults to markdown. May also be html.
- A file to attach.
- A description for the attached file.
- The XID of a previously uploaded attachment.
- The name of an associated location.
- The url of an associated location.
- The latitude of an associated location.
- The longitude of an associated location.
- The start time of an event.
- The ActivityPub ID that this honk is in reply to.
Upon success, the honk action will return the URL for the created honk.
Upload just an attachment using donk and donkdesc. Content type must be multipart/form-data. Will return the XID.
The “gethonks” action can be used to query for honks. The following parameters are used.
- Should be one of “home” or “atme”.
- Only return honks after the specified ID.
- If there are no results, wait this many seconds for something to appear.
The result will be returned as json.
The “zonkit” action began life as a delete function, but has since evolved some other powers as specified by the wherefore parameter. The target of the action is specified by the what parameter and is generally the XID of a honk.
Wherefore must be one of the following.
- Share honk with others.
- Undo share.
- Mark honk as saved.
- Unmark honk as saved.
- Post an emoji reaction. A custom reaction may be specified with reaction.
- Mark honk as read.
- Unmark honk as read.
- Delete this honk.
- Mute this thread. What should identify a convoy.
Returns a list of current honkers in json format.
Save a new honker, or update an existing one. The following fields are used.
- The numeric ID of an existing honker to update.
- The preferred short name.
- The ActivityPub actor url.
- Space separated list of combos.
- Some notes.
The honker numeric ID will be returned for success. To delete, unsub, or sub, include a form value with name and value equal. As in, a form value named delete with the value delete, or unsub=unsub, etc.
Send anything. No limits, no error checking.
- An actor to deliver the message to to. May be specified more than once. An inbox may be specified directly by prefixing with %.
- The message. It should be a valid json activity, but yolo.
- Set to 1 to use shared inboxes for delivery.
Refer to the sample code in the toys directory.