all repos — honk @ f5d94aab46f43ac911e506d0dcf1bea8bd711cff

my fork of honk

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.Pp
38The API URL for all actions other than login is
39.Pa /api .
40.Ss login
41Send a POST request to
42.Pa /login
43with the following form values.
44.Bl -tag -width username
45.It Fa username
46User name.
47.It Fa password
48Pass phrase.
49.It Fa gettoken
50Must be
51.Dq 1 .
52.El
53.Pp
54This will return a token to be used for future requests.
55The token is valid for one year.
56You can stop using the API at any time, but you can never logout.
57.Ss honk
58The
59.Fa action
60value should be
61.Dq honk .
62The following values are recognized:
63.Bl -tag -width placename
64.It Fa noise
65The contents of the honk in markdown format.
66.It Fa donk
67A file to attach.
68.It Fa donkdesc
69A description for the attached file.
70.It Fa placename
71The name of an associated location.
72.It Fa placeurl
73The url of an associated location.
74.It Fa placelat
75The latitude of an associated location.
76.It Fa placelong
77The longitude of an associated location.
78.It Fa timestart
79The start time of an event.
80.It Fa rid
81The ActivityPub ID that this honk is in reply to.
82.El
83.Pp
84Upon success, the honk action will return the URL for the created honk.
85.Sh EXAMPLES
86Refer to the sample code in the
87.Pa toys
88directory.
89.Sh SEE ALSO
90.Xr vim 3