PUT user/…
Updates specific user details. This is allowed if:
- you are updating your own account, or
- you are are an administrator of an organization, you have the
MANAGE_USERS
permission, and you are updating an account that is managed by your organization.
Resource URL
https://www.drillster.com/api/2.1.1/user
to update your own account, or
https://www.drillster.com/api/2.1.1/user/{user_id}
Parameters
Field | Type | Description |
---|---|---|
user_id optional |
String | The user ID of the user. The following types can be used:
|
name optional |
String | The full name of the user. Example value: Alice Smith |
locale optional |
String | The preferred language of the user. If supported by Drillster, this language will be used if the user logs in to the web interface. If not provided, the calling user's locale will be used. The value must be a 🔗 ISO 639-1 language code. Alternatively, a locale code may be specified consisting of a two-letter language code (ISO 639-1), and two-letter country code (ISO 3166-1 alpha-2) separated by an underscore character. Example value: fr |
timeZone optional |
String | The time zone that the user resides in. Values are as defined by the 🔗 IANA Time Zone Database. This document provides a full list of time zone IDs. Example values:
|
description optional |
String | A brief biography or description of the user. Example value: I use Drillster to brush up on my language skills |
yearOfBirth optional |
Integer | The user's year of birth. |
domicile optional |
String | The user's country of residence. Please provide a valid two-letter ISO 3166 country code. |
status optional |
String | The status of the account. Supported values:
|
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.1.1 User object reflecting the changes made.
Example request
PUT https://www.drillster.com/api/2.1.1/user
timeZone=America/Los_Angeles
Response
{
"id": "hs64JqogSRiKSC18ivnOmw",
"type": "USER",
"name": "Jane Doe",
"avatar": {
"type": "image/jpeg",
"url": "https://www.drillster.com/bin/avatar/4e81a717261692f59f4bbe411e312cd04cef6df5"
},
"emailAddress": "jane@example.com",
"locale": "es",
"description": "",
"timeZone": "America/Los_Angeles"
}
Error responses
The following error situations are possible:
ID | Description |
---|---|
missing_parameters |
No input parameters specified. |
no_such_user |
User account could not be loaded. |
invalid_real_name |
Given real name is invalid. |
invalid_locale |
Given locale is not valid. |
invalid_time_zone |
Given time zone is not valid. |
no_access |
The caller is not authorized to modify the account details |
Last updated on