Direct Messages¶
Unless otherwise stated, endpoints are relative to https://api.groupme.com/v3/ and must include the token of the user making the call - so, for example, if an endpoint is GET /groups
, the request you make should be using the URL https://api.groupme.com/v3/groups?token=aSDFghJkl
, where aSDFghJkl
is replaced with the user's token.
URLs which include a variable, such as GET /groups/:id
, have their variables marked with a colon. So a request to that endpoint would look like https://api.groupme.com/v3/groups/1234567?token=aSDFghJkl
, where 1234567
is replaced with the group's ID, and aSDFghJkl
is replaced with the user's token.
Finally, all responses are wrapped in a response envelope of the following form:
If the request succeeds, meta.errors
will be null, and if the request fails, response
will be null.
List Existing DM Channels¶
Returns a paginated list of direct message chats, or conversations, sorted by updated_at descending.
HTTP Request | |
---|---|
Parameters
-
page
integer - Page number (Starts at 1, Defaults to 1)
-
per_page
integer — Number of chats per page (Defaults to 20)
Show Specific DM Channel¶
Directly fetch details about a specific DM channel using its compound chat_id
.
HTTP Request | |
---|---|
Parameters
-
chat_id
string - this is the compound ID of the chat, consisting of two seperate user IDs. It should look something like
93645911+118825642
.
Index Messages¶
Fetch direct messages between two users.
DMs are returned in groups of 20, ordered by created_at descending.
If no messages are found (e.g. when filtering with since_id) we return code 304.
Note that for historical reasons, likes are returned as an array of user ids in the favorited_by key.
HTTP Request | |
---|---|
Parameters
-
other_user_id (required)
string — The other participant in the conversation.
-
before_id
string — Returns messages created before the given message ID
-
since_id
string — Returns messages created after the given message ID
-
after_id
string - Returns messages created immediately after the given message ID
-
limit
integer - Number of messages returned. Default is 20. Max is 100.
Note
If the server has no read_receipt
parameter to share, it will be completely absent from the response.
Send DM¶
Send a DM to another user
If you want to attach an image, you must first process it through the image service (More on that in the attachments documentation).
Attachments of type emoji rely on data from emoji PowerUps.
Clients use a placeholder character in the message text and specify a replacement charmap to substitute emoji characters
The character map is an array of arrays containing rune data ([[{pack_id,offset}],...]).
The placeholder should be a high-point/invisible UTF-8 character.
string - Client-side IDs for messages. This can be used by clients to set their own identifiers on messages, but the server also scans these for de-duplication. That is, if two messages are sent with the same source_guid within one minute of each other, the second message will fail with a 409 Conflict response. So it's important to set this to a unique value for each message.
-
recipient_id (required)
string - the GroupMe user ID of the recipient of this message.
-
text (required)
string - This can be omitted if at least one attachment is present. The maximum length is 1,000 characters.
-
attachments
array - A polymorphic list of attachments (locations, images, etc). You may have more than one of any type of attachment, provided clients can display it.
For more information on types of attachments and how to send them, check out the attachments documentation
Delete a message¶
HTTP Request | |
---|---|
HTTP Response | |
---|---|
Send a Read Receipt¶
You can only mark new messages as read, attempting to read a message sent before one you have already read will update the timestamp on the latest read message.
Important
This request is relative to https://v2.groupme.com/
, not https://api.groupme.com/v3/
.
HTTP Request | |
---|---|
Parameters
-
message_id
String - The ID of the message you'd like to mark read.
-
chat_id
String - The ID of the direct message channel the message can be found in.