PUT user

PUT Updates specific user details. Users can only update their own user account, not the account of others.

Resource URL

https://www.drillster.com/api/2/user

Parameters

Field Type Description
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.

Currently supported language codes by Drillster are:

  • en
  • es
  • fr
  • de
  • nl
  • pt
  • br
  • zh

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:

  • America/Los_Angeles
  • Europe/Amsterdam
  • Asia/Jakarta

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.

gender
optional
String constant

The user's gender. Accepted values are FEMALE and MALE.

domicile
optional
String

The user's country of residence. Please provide a valid two-letter ISO 3166 country code.

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 changes made.

Example request

PUT https://www.drillster.com/api/2/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":"root@drillster.com",
  "locale":"es",
  "description":"",
  "timeZone":"Europe/Amsterdam"
}

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.
corrupt_user Requested user record is incomplete.
invalid_time_zone Given time zone is not valid.
corrupt_user Requested user record is incomplete.