PUT user/…/email-address/…

Adds an email address to the collection of email addresses of a user account.

An email address may be added by the account holder, or by an administrator (staff user) with MANAGE_USERS permissions in the case the account is managed by the same organization.

Resource URL

https://www.drillster.com/api/2.1.1/user/{user_id}/email-address/{email}

Parameters

Field Description
user_id
required
The user ID of the user to retrieve details for. To retrieve the details of the own user account, the value self may be used as well.

Example value: 7OuHq-RcQO_snGWR58TnBw
email
required
The email address to be added.

Example value: john%40example.com

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

An HTTP 200 (OK) response containing a 2.1.1 UserEmailAddress object with the details of the requested email address stored for the requested user account.

Example request

PUT https://www.drillster.com/api/2.1/user/self/email-address/thomas%40example.com

Response

{
  "emailAddress": {
    "address": "thomas@example.com",
    "verified": false
  },
  "primary": false
}

Error responses

The following error situations are possible:

ID Response code Description
not_authenticated 401 (Unauthorized) User was not authenticated
invalid_user_id 400 (Bad request) Given user ID is not valid
nonexistent_user 404 (Not found) Requested user not found
no_access 403 (Forbidden) Caller does not have access to requested user
missing_input 400 (Bad request) Email address is required
email_not_added 400 (Bad request) Given email address could not be added to the account
invalid_email_address 400 (Bad request) The given email address is not valid
email_address_in_use 409 (Conflict) The given email address is already in use by another account