HONK(3) Library Functions Manual HONK(3)

honkAPI access

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.

action
The desired action. See below.
token
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.

username
User name.
password
Pass phrase.
gettoken
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”. The following values are recognized:

noise
The contents of the honk in markdown format.
donk
A file to attach.
donkdesc
A description for the attached file.
placename
The name of an associated location.
placeurl
The url of an associated location.
placelat
The latitude of an associated location.
placelong
The longitude of an associated location.
timestart
The start time of an event.
rid
The ActivityPub ID that this honk is in reply to.

Upon success, the honk action will return the URL for the created honk.

The “gethonks” action can be used to query for honks. The following parameters are used.

page
Should be one of “home” or “atme”.
after
Only return honks after the specified ID.
wait
If there are no results, wait this many seconds for something to appear.

The result will be returned as json.

Send anything. No limits, no error checking.

rcpt
An actor to deliver the message to to. May be specified more than once. An inbox may be specified directly by prefixing with %.
msg
The message. It should be a valid json activity, but yolo.
public
Set to 1 to use shared inboxes for delivery.

Refer to the sample code in the toys directory.

vim(3)

December 25, 2019 OpenBSD 6.6