/api/users/:id

Modifies the user specified by ID.

Resource Information


Request Parameters

Parameter

Detail

Example

idID of the user to update.123
data

Form contents to submit in following JSON format:

Name

Description

usernameUsername
emailUser email address
firstNameUser first name
middleName
User middlename
lastNameUser last name
infoUser last name
timeZone(Optional) User time zone
locale(Optional) User locale - code of supported language
roles

(Optional) Array containing all user roles where each role has following structure:

NameDescription
roleRole name - please see list of supported values

Existing user roles are replaced (user will have only roles send via API).

To remove all user roles send empty 'roles' array.

groups

(Optional) Array containing all user groups where user belongs. Each group has following structure:

NameDescription
idUser group identifier
nameUser group name


{
  "username": "myusername",
  "email": "myusername@example.com",
  "firstName": "John",
  "middleName": "Middle", 
  "lastName": "Doe",
  "info": "I'm pretty cool",
  "timeZone": "Europe/Prague",
  "locale": "cs",
  "roles": [
    {
      "role": "DATA_ADMIN"
    },
    {
      "role": "SCHEMA_ADMIN"
    }
  ],
  "groups": [
    {
      "id": "56",
      "name": "My User Group nr.1"
    }
  ]
}

Sample Request / Response

Using curl:

curl -H "Authorization: OAuth realm=\"https://service.belladati.com/\", oauth_consumer_key=\"myConsumer\", oauth_token=\"mh7an9dkrg59\", oauth_timestamp=\"135131231\", oauth_nonce=\"randomString\"" -d "data={\"username\":\"myusername\",\"email\":\"myusername@example.com\",\"firstName\":\"John\",\"lastName\":\"Doe\"}" https://service.belladati.com/api/users/123

When the form has been submitted successfully, the server replies with an HTTP status code of 200 and an empty body. 


  • No labels