List the messages with a user
GET /account/messages/{peer_ref}
Returns the direct messages between you and the account peer_ref,
in both directions, newest first, one page at a time.
You need to be signed in; no capability is needed. Without a session
cookie or bearer token that identifies you, the answer is 401,
whether or not public mode is on. A peer_ref or limit that isn’t
a whole number gets a plain-text 400 before sign-in is checked. A
peer_ref with no account gets 404, even if messages with it are
still stored. For your own peer_ref the answer is 200 with items
set to null; a valid limit doesn’t change it and cursor is
ignored. You can only read conversations you are part of, and blocks
and account status don’t stop you.
Pages hold at most limit messages, 50 unless you ask for another
number; values below 1 count as 1 and above 200 as 200. When older
messages remain, next_cursor is set: send it back as cursor to
get the messages before the last one on the page. A cursor that
can’t be read gets 401. Messages saved at the same moment come in a
fixed order by id. Each page is read separately, so a message sent
or marked read between two requests can make them disagree, and a
message can appear later with an earlier time than ones already
shown.
Reading messages doesn’t mark them read;
markDirectMessageThreadRead does. Each message’s read_at is when
its recipient marked the conversation read, and both of you can see
it. Server errors get a plain-text 500.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The other person’s account ref.
Query Parameters
Section titled “Query Parameters ”How many messages per page, 50 if left out; values below 1 count as 1 and above 200 as 200.
The next_cursor from the previous page, to get older messages. Left out or empty, the page starts from the newest; one that can’t be read gets 401.
Responses
Section titled “ Responses ”A page of messages, newest first.
object
Up to limit messages, newest first; empty when there are none, and null for your own peer_ref.
A direct message between two accounts.
object
The message’s id.
The account that sent it.
The account it was sent to.
The text as saved, with surrounding white space removed.
When the server saved it.
When the recipient marked the conversation read, which both people can see. Left out while unread.
Send this back as cursor for the older messages. Left out when there are no more.
Authentication required, missing, or invalid
object
Human-readable error summary
Example
the request could not be completedExample
{ "error": "authentication required: sign in and retry with a valid session or API token"}Resource not found
object
Human-readable error summary
Example
the request could not be completed