groupme-js / GroupMeCommunityDocs

21 stars 8 forks source link

Quick dump of some bits of API stuff I found that isnt documented #16

Open AlureonTheVirus opened 11 months ago

AlureonTheVirus commented 11 months ago

A GET request to /groups/:group_id/subgroups returns an array of all of the subtopics/subgroups associated with a group.

When creating a group via a POST to /groups, adding the parameter "type" : "announcement" will create a read-only group that the owner and group admins post in exclusively.

I don't have much time at the moment so I'll post more later.

AlureonTheVirus commented 11 months ago

GET api.groupme.com/v4/relationships returns an array of all of your contacts, though the /v4 api path is not documented and may lead to breaking changes.

You can POST to /groups/:group_id/subgroups to create a new subtopic by including the parameters "topic" and "description" respectively, Or at least those are the only parameters that are sent by the web client when creating a topic, to change the like icon, avatar url or the aforementioned topic and description fields you can follow the initial POST /groups/:group_id/subgroups with a PUT request to /groups/:group_id/subgroups/:subgroup_id with the parameters "topic", "description", "like_icon", and "avatar_url" respectively.

AlureonTheVirus commented 11 months ago

GET /conversations/:conversation_id/gallery returns a "messages" object which contains an array of every message containing an image in the group.

When joining a private group the currently documented way (POST /groups/:id/join/:share_token), there is no way to join a "type": "private" group (one that requires a join request and sometimes a question field). However, including the parameter: "answer" : {"response" : <JOIN_RESPONSE>} will add a custom response to the join question, allowing you to request to join private groups.

GET /groups/pending_memberships returns two arrays, "requests_received" and "requests_sent". Each entry in "requests_sent" corresponds to the public group information on any outstanding/pending join requests you have sent to private groups. Similarly, each entry in "requests_received" contains the info of any group you manage pending membership requests.

To get all of the current pending membership requests for a group that you manage, you can GET /groups/:group_id/pending_memberships. This will return a response containing an array of all pending join requests, including but not limited to the user's ID, the group's join question that they responded to at the time that they sent the request, their response to the question, and finally the timestamp that the request was sent. Interestingly enough, the response also includes an "id" parameter which contains the member_id of the user even though they are not a member of the group.

Accepting join requests is done via a POST to /groups/:group_id/members/:member_id/approval with the parameter "approval" : "true" (Where member_id is the curious "id" parameter's value from the previously explained request in the above paragraph.)

AlureonTheVirus commented 11 months ago

you can change your accounts password with a POST to /users/password along with parameters "password" and "password_current"

Access tokens appear to be changed independently from your password, when changing your password via the web client the client also sends a request to POST v2.groupme.com/access_tokens with parameters: "app_id" : "groupme-web", "device_id" : ":YOUR_DEVICE_ID", "grant_type" : "password", and "password", and "username" which contain your password and username. This request returns a response containing the new access token and some account information.

AlureonTheVirus commented 11 months ago

you can get a list of public groups with a GET to api.groupme.com/v1/search/popular this returns an object with the key "popular" which contains an array of public groups listed in descending order by # of members. interestingly enough, groups with "type" : "closed" are actually open, while "private" and "announcement" are what they say they are. (may be a bug)

proatgram commented 11 months ago

This is becoming a big help with a library I am developing, I am thankful :D

AlureonTheVirus commented 11 months ago

This is becoming a big help with a library I am developing, I am thankful :D

For sure! Glad I could help. If there's anything in specific you're hunting for don't be afraid to ask. I'd be happy to look for it.

ajdiv commented 11 months ago

@AlureonTheVirus Hey! Not the guy you were talking to BUT do you know if there's an API call made when someone likes/unlikes a message?

AlureonTheVirus commented 11 months ago

@AlureonTheVirus Hey! Not the guy you were talking to BUT do you know if there's an API call made when someone likes/unlikes a message?

Not quite sure what you mean... How to fetch likes from the API manually or how to get notified by the API on a like event?

for catching like events I know that you can get a lot of real time information through groupme's push API with websockets. There is very little documentation on how that works though so you will have to build your own implementation from scratch or check out the example websocket bot in the community docs repo.

I believe manually polling for likes in a group or a specific message is already a documented feature of the REST API. (I may be wrong. I'll edit this response after I read the docs again lol)

EDIT: fetching stuff regarding likes from the REST API is documented here: https://github.com/groupme-js/GroupMeCommunityDocs/blob/master/likes.md

It looks like you have to poll the specific group you want to know about for likes. it's easier to see your own likes via polling with the "my hits" call, but any useful stuff will probably need to be done via the real time websocket interface instead of the REST API. I'll have to work on writing a decent standalone WS wrapper for groupme and some documentation to really make this an easy solution but it's totally possible if you're willing to look at examples and comb through the push documentation on dev.groupme.com

jsantos904 commented 7 months ago

You can POST to /groups/:group_id/subgroups to create a new subtopic by including the parameters "topic" and "description" respectively, Or at least those are the only parameters that are sent by the web client when creating a topic, to change the like icon, avatar url or the aforementioned topic and description fields you can follow the initial POST /groups/:group_id/subgroups with a PUT request to /groups/:group_id/subgroups/:subgroup_id with the parameters "topic", "description", "like_icon", and "avatar_url" respectively.

To delete a topic, use DELETE to /groups/:parent_id/subgroups/:subgroup_id This is different from deleting a normal room that uses POST with the groups/:group_id/destroy endpoint.