docs/honk.3 (view raw)
1.\"
2.\" Copyright (c) 2019 Ted Unangst
3.\"
4.\" Permission to use, copy, modify, and distribute this software for any
5.\" purpose with or without fee is hereby granted, provided that the above
6.\" copyright notice and this permission notice appear in all copies.
7.\"
8.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15.\"
16.Dd $Mdocdate$
17.Dt HONK 3
18.Os
19.Sh NAME
20.Nm honk
21.Nd API access
22.Sh DESCRIPTION
23In addition to the standard web interface, some functionality is
24available via the
25.Nm
26HTTP API.
27.Pp
28With the exception of login, all requests should contain
29the following form values.
30.Bl -tag -width action
31.It Fa action
32The desired action.
33See below.
34.It Fa token
35An authorization token.
36.El
37.Ss login
38Send a POST request to
39.Pa /login
40with the following form values.
41.Bl -tag -width username
42.It Fa username
43User name.
44.It Fa password
45Pass phrase.
46.It Fa gettoken
47Must be
48.Dq 1 .
49.El
50.Pp
51This will return a token to be used for future requests.
52The token is valid for one year.
53You can stop using the API at any time, but you can never logout.
54.Ss honk
55The
56.Fa action
57value should be
58.Dq honk .
59The following values are recognized:
60.Bl -tag -width placename
61.It Fa noise
62The contents of the honk in markdown format.
63.It Fa donk
64A file to attach.
65.It Fa donkdesc
66A description for the attached file.
67.It Fa placename
68The name of an associated location.
69.It Fa placeurl
70The url of an associated location.
71.It Fa placelat
72The latitude of an associated location.
73.It Fa placelong
74The longitude of an associated location.
75.It Fa timestart
76The start time of an event.
77.It Fa rid
78The ActivityPub ID that this honk is in reply to.
79.El
80.Pp
81Upon success, the honk action will return the URL for the created honk.
82.Sh EXAMPLES
83Refer to the sample code in the
84.Pa toys
85directory.
86.Sh SEE ALSO
87.Xr vim 3