Users

This chapter focuses on services for the users.

Get a user

A GET to /users/{id} returns the user with the given id.

Path parameters

Table 1. /api/rest/latest/users/{id}
Parameter Description

id

the id of the user

HTTP request

GET /api/rest/latest/users/486 HTTP/1.1
Accept: application/json
Host: localhost:8080

Request parameters

Parameter Description

fields

which fields of the elements should be returned (optional)

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 505

{
  "_type" : "user",
  "id" : 486,
  "first_name" : "Charles",
  "last_name" : "Dupond",
  "login" : "User-1",
  "email" : "charlesdupond@aaaa.aa",
  "active" : true,
  "group" : "User",
  "teams" : [ ],
  "last_connected_on" : "2018-02-11T11:00:00Z",
  "created_by" : "admin",
  "created_on" : "2017-07-04T10:00:00Z",
  "last_modified_by" : "admin",
  "last_modified_on" : "2017-07-05T10:00:00Z",
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/users/486"
    }
  }
}

Response fields

Path Type Description

_type

String

the type of the entity

id

Number

the id of the user

first_name

String

the first name of the user

last_name

String

the last name of the user

login

String

the login of the user

email

String

the email address of the user

active

Boolean

whether the user is activate or not

group

String

the group of the user belong (admin or user)

teams

Array

the team of the user participate

last_connected_on

String

the date of this user was last connected

created_by

String

the user who created this user account

created_on

String

the date of this user account was created

last_modified_by

String

the user who last modified this user account

last_modified_on

String

the date of this user account was last modified

_links

Object

related links

Relation Description

self

link to this user

Create a new user

A POST to /users creates a new user.

HTTP request

POST /api/rest/latest/users HTTP/1.1
Accept: application/json
Content-Type: application/json
Host: localhost:8080
Content-Length: 180

{
  "_type" : "user",
  "first_name" : "Charles",
  "last_name" : "Dupond",
  "login" : "User-1",
  "password" : "123456",
  "email" : "charlesdupond@aaaa@aa",
  "group" : "User"
}

Request fields

Path Type Description

_type

String

the type of the entity

first_name

String

the first name of the user

last_name

String

the last name of the user

login

String

the login of the user

password

String

the password of the user

email

String

the email address of the user

group

String

the group of the user belong (admin or user)

Request parameters

Parameter Description

fields

which fields of the elements should be returned (optional)

HTTP response

HTTP/1.1 201 Created
Content-Type: application/json;charset=UTF-8
Content-Length: 505

{
  "_type" : "user",
  "id" : 987,
  "first_name" : "Charles",
  "last_name" : "Dupond",
  "login" : "User-1",
  "email" : "charlesdupond@aaaa.aa",
  "active" : true,
  "group" : "User",
  "teams" : [ ],
  "last_connected_on" : "2018-03-05T11:00:00Z",
  "created_by" : "admin",
  "created_on" : "2017-07-04T10:00:00Z",
  "last_modified_by" : "admin",
  "last_modified_on" : "2017-07-05T10:00:00Z",
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/users/987"
    }
  }
}

Response fields

Path Type Description

id

Number

the id of the user

active

Boolean

whether the user is activate or not

teams

Array

the team of the user participate

last_connected_on

String

the date of this user was last connected

created_by

String

the user who created this user account

created_on

String

the date of this user account was created

last_modified_by

String

the user who last modified this user account

last_modified_on

String

the date of this user account was last modified

_links

Object

related links

Relation Description

self

link to this user

Delete a user

A DELETE to /users/{ids} deletes a or several user(s) with the given id(s).

Path parameters

Table 1. /api/rest/latest/users/{ids}
Parameter Description

ids

the list of ids of the users

HTTP request

DELETE /api/rest/latest/users/169 HTTP/1.1
Accept: application/json
Content-Type: application/json
Host: localhost:8080