PUT organization/…/staff

PUT Adds a user as a staff user of an organization.

Resource URL

https://www.drillster.com/api/2/organization/{organization_id}/staff/{user_id}

or

https://www.drillster.com/api/2/organization/{organization_id}/staff/{email_address}

Parameters

Field Type Description
organization_id
required
String

The unique ID of the own organization, or self.

user_id
either user_id or email_address is required
String

The user ID of the account which is to be made a staff account for the given organization.

The user may not already be affiliated with another organization.

Example value: g_ZakhOqTCWl8uZ-x0abGw

email_address
either user_id or email_address is required
String

In lieu of a user ID, an email address may also be provided. If no user with the given email address is found, an account is created.

name
required if no user ID provided
String

The name of the user.

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

A 2.0 User object reflecting the organization that the user become a staff user of.

Error responses

The following error situations are possible:

ID Response code Description
missing_user_id_or_email 400 (Bad request) No user ID or email was supplied.
not_permitted 403 (Forbidden) Caller is not part of the organization or does not have the permission to create staff users.
missing_name 400 (Bad request) The staff user account does not exist yet and needs to be created, but no name was given.
invalid_email_address 400 (Bad request) The given email address is not valid.
already_staff_user 400 (Bad request) The given user is already a staff user of this organization.
linked_to_other_organization 400 (Bad request) The given user is already a staff user of another organization. Users cannot be a staff user of more than one organization.
staff_user_not_created 500 (Internal error) The staff user could not be created for unknown reasons. Please see the error description for details.