Group 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.
Index¶
Retrieve messages for a group.
By default, messages are returned in groups of 20, ordered by created_at descending. This can be raised or lowered by passing a limit parameter, up to a maximum of 100 messages.
Messages can be scanned by providing a message ID as either the before_id, since_id, or after_id parameter. If before_id is provided, then messages immediately preceding the given message will be returned, in descending order. This can be used to continually page back through a group's messages.
The after_id parameter will return messages that immediately follow a given message, this time in ascending order (which makes it easy to pick off the last result for continued pagination).
Finally, the since_id parameter also returns messages created after the given message, but it retrieves the most recent messages. For example, if more than twenty messages are created after the since_id message, using this parameter will omit the messages that immediately follow the given message. This is a bit counterintuitive, so take care.
If no messages are found (e.g. when filtering with before_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
-
before_id
string - Returns messages created before the given message ID
-
since_id
string - Returns most recent 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.
-
acceptFiles
boolean - A flag to tell the image service your client is capable of receiving non-image files. Setting this value to
0
or omitting it entirely will NOT omit messages with file attachments in the response; these messages will still be included, but the text property will be overwritten withPlease upgrade to download this file.
The file attachment will still be fully intact, however. In practice this means that if you care about the text in the message with an attachment, you should setacceptFiles=1
.
Show a Specific Message¶
Fetches an individual message object by its ID
Important
This request is relative to https://api.groupme.com/v4/
, not https://api.groupme.com/v3/
.
HTTP Request | |
---|---|
Parameters
-
message_id
string - The ID of the message you'd like to fetch
Send Message¶
Send a message to a group
If you want to attach an image, you must first process it through GroupMe's image service (More on that in the attachments documentation)
Attachments of type emoji rely on data from GroupMe 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.
Parameters * source_guid (required)
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.
-
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, replies, 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
Edit Message¶
Edit a message you've already sent
If you want to attach an image, you must first process it through GroupMe's image service (More on that in the attachments documentation)
Attachments of type emoji rely on data from GroupMe Emoji powerups.
Important
This request is relative to https://api.groupme.com/v4/
, not https://api.groupme.com/v3/
.
HTTP Request | |
---|---|
Parameters * 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, replies, 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 | |
---|---|