restbox-apiboxboxapiv2

Removing a user from a specific user group


I need to make a call on the BOX API to remove a user from a group. I looked at the BOX API documentation - https://developer.box.com/v2.0/reference#delete-a-group-membership. The RESTful call is:

DELETE https://api.box.com/2.0/group_memberships/group_membership_id

However, it does not tell me how to remove a user from a specific group. Is this possible? If yes, what is the API call?


Solution

  • I think that by deleting membership, you're deleting the user form the group.

    This is an example of how a group membership looks like:

    [
            {
                "type": "group_membership",
                "id": "1560354",
                "user": {
                    "type": "user",
                    "id": "13130406",
                    "name": "Alison Wonderland",
                    "login": "alice@gmail.com"
                },
                "group": {
                    "type": "group",
                    "id": "119720",
                    "name": "family"
                },
                "role": "member"
            }
        ]
    

    So, by calling https://api.box.com/2.0/group_memberships/1560354 you would remove user Alison Wonderland form the group family