From a485df830dfd9e372f6927fa0de1ac9485027fd9 Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Fri, 23 Aug 2024 12:12:13 +0200 Subject: [PATCH] webapi: minor tweaks in docs --- webapi/doc.go | 8 ++++---- webapi/gendoc.sh | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/webapi/doc.go b/webapi/doc.go index d7df748..0b9019f 100644 --- a/webapi/doc.go +++ b/webapi/doc.go @@ -23,7 +23,7 @@ The webapi has a base URL at /webapi/v0/ by default, but configurable, which serves an introduction that points to this documentation and lists the API methods available. -An HTTP POST to /webapi/v0/ calls a method.The form can be either +An HTTP POST to /webapi/v0/ calls a method. The form can be either "application/x-www-form-urlencoded" or "multipart/form-data". Form field "request" must contain the request parameters, encoded as JSON. @@ -42,7 +42,7 @@ errors). Most successful calls return a JSON object, but some return data (e.g. a raw message or an attachment of a message). See [Methods] for the methods and and [Client] for their documentation. The first element of their return values indicate their JSON object type or io.ReadCloser for non-JSON -data. The request and response types are converted from/to JSON. optional and +data. The request and response types are converted from/to JSON. Optional and missing/empty fields/values are converted into Go zero values: zero for numbers, empty strings, empty lists and empty objects. New fields may be added in response objects in future versions, parsers should ignore unrecognized @@ -90,7 +90,7 @@ that spammy behaviour and blocklist your mail server. Automatic suppression list management already prevents most repeated sending attempts. The webhooks make it easy to receive failure notifications. -To keep spam complaints about your messages a minimum, include links to +To keep spam complaints about your messages to a minimum, include links to unsubscribe from future messages without requiring further actions from the user, such as logins. Include an unsubscribe link in the footer, and include List-* message headers, such as List-Id, List-Unsubscribe and @@ -262,7 +262,7 @@ Get a raw, unparsed message, as bytes: $ curl --user mox@localhost:moxmoxmox --data request='{"MsgID": 123}' http://localhost:1080/webapi/v0/MessageRawGet [message as bytes in raw form] -Mark a message as read: +Mark a message as read and set flag "custom": $ curl --user mox@localhost:moxmoxmox --data request='{"MsgID": 424, "Flags": ["\\Seen", "custom"]}' http://localhost:1080/webapi/v0/MessageFlagsAdd {} diff --git a/webapi/gendoc.sh b/webapi/gendoc.sh index 60dfa97..e9003cf 100755 --- a/webapi/gendoc.sh +++ b/webapi/gendoc.sh @@ -33,7 +33,7 @@ The webapi has a base URL at /webapi/v0/ by default, but configurable, which serves an introduction that points to this documentation and lists the API methods available. -An HTTP POST to /webapi/v0/ calls a method.The form can be either +An HTTP POST to /webapi/v0/ calls a method. The form can be either "application/x-www-form-urlencoded" or "multipart/form-data". Form field "request" must contain the request parameters, encoded as JSON. @@ -52,7 +52,7 @@ errors). Most successful calls return a JSON object, but some return data (e.g. a raw message or an attachment of a message). See [Methods] for the methods and and [Client] for their documentation. The first element of their return values indicate their JSON object type or io.ReadCloser for non-JSON -data. The request and response types are converted from/to JSON. optional and +data. The request and response types are converted from/to JSON. Optional and missing/empty fields/values are converted into Go zero values: zero for numbers, empty strings, empty lists and empty objects. New fields may be added in response objects in future versions, parsers should ignore unrecognized @@ -100,7 +100,7 @@ that spammy behaviour and blocklist your mail server. Automatic suppression list management already prevents most repeated sending attempts. The webhooks make it easy to receive failure notifications. -To keep spam complaints about your messages a minimum, include links to +To keep spam complaints about your messages to a minimum, include links to unsubscribe from future messages without requiring further actions from the user, such as logins. Include an unsubscribe link in the footer, and include List-* message headers, such as List-Id, List-Unsubscribe and @@ -273,7 +273,7 @@ Get a raw, unparsed message, as bytes: \$ curl --user mox@localhost:moxmoxmox --data request='{"MsgID": 123}' http://localhost:1080/webapi/v0/MessageRawGet [message as bytes in raw form] -Mark a message as read: +Mark a message as read and set flag "custom": \$ curl --user mox@localhost:moxmoxmox --data request='{"MsgID": 424, "Flags": ["\\\\Seen", "custom"]}' http://localhost:1080/webapi/v0/MessageFlagsAdd {}