# retoor <retoor@molodetz.nl>
from .._shared import endpoint, field
GROUP = {
"slug": "messaging",
"title": "Messaging",
"intro": """
# Messaging
Direct messages between users. The inbox renders HTML; sending uses form fields. Look up
recipients with [Search & Lookups](/docs/lookups.html) and attach files via [Uploads](/docs/uploads.html).
Every endpoint follows the shared [Conventions & Errors](/docs/conventions.html) (auth, content
negotiation, pagination, status codes); see [Authentication](/docs/authentication.html) for the
four ways to sign requests.
""",
"endpoints": [
endpoint(
id="messages-inbox",
method="GET",
path="/messages",
title="Open the inbox",
summary="Render conversations. Returns an HTML page.",
auth="user",
interactive=True,
params=[
field(
"with_uid",
"query",
"string",
False,
"",
"Open a specific conversation by user UID.",
),
field(
"search",
"query",
"string",
False,
"",
"Jump to a conversation by username.",
),
],
),
endpoint(
id="messages-send",
method="POST",
path="/messages/send",
title="Send a message",
summary="Send a direct message to a user.",
auth="user",
encoding="form",
destructive=True,
params=[
field(
"content",
"form",
"textarea",
True,
"Hello there.",
"Body, 1-2000 characters.",
),
field(
"receiver_uid",
"form",
"string",
True,
"RECEIVER_UID",
"Recipient user UID.",
),
],
),
],
}