PUT group-invitation/…

Accepts or declines an invitation for a group.

Resource URL

https://www.drillster.com/api/2/group-invitation/{token}

The token is the unique code representing the group invitation.

Parameters

Field Type Description
action
required
String The action to apply to the invitation.

  • ACCEPT
  • DECLINE

If a PUT request has no body (i.e. the body is empty), it is still mandatory to include a Content-Length header (i.e. Content-Length: 0). Not all HTTP clients do this automatically. For more information, please see RFC 2616.

Response

The accepted or declined 2.0 GroupInvitation object.

Example request

POST https://www.drillster.com/api/2/group-invitation/eFqr79Q4R3KiMs2a7vSNqQ
action=ACCEPT

Response

{
  "status": "ACCEPTED",
  "user": {
    "id": "x1MZEtQoRb19bU6v0bunOw",
    "emailAddress": "jane.doe@example.com"
  },
  "group": {
    "id": "bWBNGxnkf9dx2K4BGc2mndIEw0urEGKNs-9Zme3PgOM",
    "name": "European geography",
    "description": "Learn the countries and capitals of Europe",
    "counts": {
      "drillables": 20,
      "tests": 6
    }
  }
}

Error responses

The following error situations are possible:

ID Description
missing_token Group invitation token is missing
missing_action The action must be either ACCEPT or DECLINE
invalid_action The action must be either ACCEPT or DECLINE
unknown_group_invitation The group invitation not found
no_user_account No user account has been set up yet for the invitee – set up a user account first
internal_error An internal error occurred
accept_failed message Accepting the group invitation failed
decline_failed Declining the group invitation failed