groupme-js / GroupMeCommunityDocs

21 stars 8 forks source link

Add users/features/share endpoint to Account page #11

Open not-so-smart opened 2 years ago

not-so-smart commented 2 years ago

This endpoint can be used to update the share_url and share_qr_code_url properties on your account. Changes will be reflected in v3/users/me and are also returned in the json response.

Enable

To enable profile sharing:

POST /v3/users/features/share
Host: api.groupme.com:443
X-Access-Token: {{TOKEN}}
{
    "status": "enable"
}

Response:

{
    "share_url": "https://groupme.com/contact/74938777/OtzZPXiX",
    "share_qr_code_url": "https://image.groupme.com/qr/contact/74938777/OtzZPXiX/preview"
}

Calling this endpoint while sharing is already enabled will generate a new share token (OtzZPXiX in this case) hereby invalidating the previous link/qr code.

Disable

To disable profile sharing:

POST /v3/users/features/share
Host: api.groupme.com:443
X-Access-Token: {{TOKEN}}
{
    "status": "disable"
}

Response:

{
    "share_url": null,
    "share_qr_code_url": null
}

Calling this endpoint while sharing is already disabled will do nothing, returning the exact same response again with both fields set to null.

not-so-smart commented 2 years ago

note that this endpoint returns 302 if not called over HTTPS