UserResource Resource

Resource to get Users. The list of users returned will always be filtered by user permission: A user may only see users that are members of the same groups or subgroups of the groups, the user is member of

GET /user

List users.
The result can be filtered by

  • id
  • login
  • firstName
  • lastName
  • email
and sorted by
  • id
  • login
  • firstName
  • lastName
  • email

Request Parameters
name type description default constraints
page query Returned page, if paging is used. Paging starts with 1 1 int
pageSize query Page size for paging. If this is set to -1 no paging is used (all matching items are returned). Setting this to 0 will return no items. -1 int
perms query Flag to add permission information for the returned items. false boolean
q query Query string for filtering    
sort query Comma separated list of sorted attributes. Each attribute name may be prefixed with + for sorting in ascending order or - for sorting in descending order name  
Response Codes
code condition
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json UserList (JSON) user list

Example

Request
GET /user
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "items" : [ { }, { } ],
  "hasMoreItems" : true,
  "numItems" : 12345,
  "perms" : {
    "property1" : [ "inheritance", "createitems" ],
    "property2" : [ "publishform", "delete" ]
  },
  "stagingStatus" : {
    "property1" : {
      "packageName" : "...",
      "included" : true
    },
    "property2" : {
      "packageName" : "...",
      "included" : true
    }
  },
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

GET /user/list

Get a list of users, optionally filtered, sorted and paged

Request Parameters
name type description default constraints multivalued
email query email string(s) for filtering     yes
firstname query firstname string(s) for filtering     yes
group query group id(s) for filtering   int yes
groups query true to add groups to the users, false (default) otherwise false boolean no
id query id(s) for filtering   int yes
lastname query lastname string(s) for filtering     yes
login query login string(s) for filtering     yes
maxItems query maximum number of elements returned (paging) -1 int no
search query additionally search in users logins, firstNames, lastNames and emails     no
skipCount query number of elements to be skipped (paging) 0 int no
sortby query name of an attribute to sort   "email" or "firstname" or "id" or "lastname" or "login" no
sortorder query sort order asc "ASC" or "DESC" or "NONE" or "asc" or "desc" or "none" no
Response Codes
code condition
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json UserListResponse (JSON) list of users

Example

Request
GET /user/list
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "users" : [ {
    "id" : 12345,
    "firstName" : "...",
    "lastName" : "...",
    "description" : "...",
    "email" : "...",
    "groups" : [ {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    }, {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    } ],
    "login" : "...",
    "password" : "..."
  }, {
    "id" : 12345,
    "firstName" : "...",
    "lastName" : "...",
    "description" : "...",
    "email" : "...",
    "groups" : [ {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    }, {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    } ],
    "login" : "...",
    "password" : "..."
  } ],
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

GET /user/me

Get the current user (me) By default, the user's groups are not returned.

Request Parameters
name type description default constraints
groups query Whether to list the user's groups false boolean
Response Codes
code condition
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json UserLoadResponse (JSON) current user

Example

Request
GET /user/me
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "user" : {
    "id" : 12345,
    "firstName" : "...",
    "lastName" : "...",
    "description" : "...",
    "email" : "...",
    "groups" : [ {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    }, {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    } ],
    "login" : "...",
    "password" : "..."
  },
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

DELETE /user/{id}

Deactivate the user with given ID

Request Parameters
name type description
id path local user ID
Response Codes
code condition
204 User {id} was deactivated.
404 User {id} does not exist.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json object (JSON) empty response

Example

Request
DELETE /user/{id}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
...
                
              

GET /user/{id}

Load user with given ID

Request Parameters
name type description
id path local user ID
Response Codes
code condition
200 User {id} exists.
404 User {id} does not exist.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json UserLoadResponse (JSON) user response

Example

Request
GET /user/{id}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "user" : {
    "id" : 12345,
    "firstName" : "...",
    "lastName" : "...",
    "description" : "...",
    "email" : "...",
    "groups" : [ {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    }, {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    } ],
    "login" : "...",
    "password" : "..."
  },
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

PUT /user/{id}

Update user with given ID

Request Parameters
name type description
id path local user ID
Request Body
media type data type description
application/json User (JSON) new user data
Response Codes
code condition
200 User {id} was updated.
404 User {id} does not exist.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json UserLoadResponse (JSON) updated user

Example

Request
PUT /user/{id}
Content-Type: application/json
Accept: application/json

                
{
  "id" : 12345,
  "firstName" : "...",
  "lastName" : "...",
  "description" : "...",
  "email" : "...",
  "groups" : [ {
    "id" : 12345,
    "name" : "...",
    "description" : "...",
    "children" : [ { }, { } ]
  }, {
    "id" : 12345,
    "name" : "...",
    "description" : "...",
    "children" : [ { }, { } ]
  } ],
  "login" : "...",
  "password" : "..."
}
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "user" : {
    "id" : 12345,
    "firstName" : "...",
    "lastName" : "...",
    "description" : "...",
    "email" : "...",
    "groups" : [ {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    }, {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    } ],
    "login" : "...",
    "password" : "..."
  },
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

GET /user/me/data

Get complete user data

Response Codes
code condition
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json UserDataResponse (JSON) Response containing the complete user data

Example

Request
GET /user/me/data
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "data" : { },
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

POST /user/save/{id}

This method has been deprecated. Use PUT /rest/user/{id} instead

Saves the user into GCN.

Request Parameters
name type description constraints
id path Id of the user to save. int
Request Body
media type data type description
application/json UserSaveRequest (JSON) user save request
Response Codes
code condition
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json GenericResponse (JSON) GenericResponse

Example

Request
POST /user/save/{id}
Content-Type: application/json
Accept: application/json

                
{
  "user" : {
    "id" : 12345,
    "firstName" : "...",
    "lastName" : "...",
    "description" : "...",
    "email" : "...",
    "groups" : [ {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    }, {
      "id" : 12345,
      "name" : "...",
      "description" : "...",
      "children" : [ { }, { } ]
    } ],
    "login" : "...",
    "password" : "..."
  }
}
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

GET /user/{id}/groups

List groups of given user.
The result can be filtered by

  • id
  • name
and sorted by
  • id
  • name

Request Parameters
name type description default constraints
id path local user ID    
page query Returned page, if paging is used. Paging starts with 1 1 int
pageSize query Page size for paging. If this is set to -1 no paging is used (all matching items are returned). Setting this to 0 will return no items. -1 int
perms query Flag to add permission information for the returned items. false boolean
q query Query string for filtering    
sort query Comma separated list of sorted attributes. Each attribute name may be prefixed with + for sorting in ascending order or - for sorting in descending order name  
Response Codes
code condition
200 User {id} exists.
404 User {id} does not exist.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json GroupList (JSON) list of groups

Example

Request
GET /user/{id}/groups
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "items" : [ { }, { } ],
  "hasMoreItems" : true,
  "numItems" : 12345,
  "perms" : {
    "property1" : [ "deleteform", "linkoverview" ],
    "property2" : [ "updateform", "importitems" ]
  },
  "stagingStatus" : {
    "property1" : {
      "packageName" : "...",
      "included" : true
    },
    "property2" : {
      "packageName" : "...",
      "included" : true
    }
  },
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

DELETE /user/me/data/{key}

Delete the user data for the given key

Request Parameters
name type description
key path key of the user data
Response Codes
code condition
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json GenericResponse (JSON) Generic response

Example

Request
DELETE /user/me/data/{key}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

GET /user/me/data/{key}

Get user data for the given key

Request Parameters
name type description
key path key of the user data
Response Codes
code condition
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json UserDataResponse (JSON) Response containing the value

Example

Request
GET /user/me/data/{key}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "data" : { },
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

POST /user/me/data/{key}

Save user data for the given key

Request Parameters
name type description
key path key of the user data to save
Request Body
media type data type description
application/json object (JSON) user data in JSON format
Response Codes
code condition
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json GenericResponse (JSON) Generic response

Example

Request
POST /user/me/data/{key}
Content-Type: application/json
Accept: application/json

                
...
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

DELETE /user/{id}/groups/{groupId}

Remove user from the group

Request Parameters
name type description
groupId path local group ID
id path local user ID
Response Codes
code condition
204 User was removed.
404 User {id} or group {groupId} does not exist.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json object (JSON) empty response

Example

Request
DELETE /user/{id}/groups/{groupId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
...
                
              

PUT /user/{id}/groups/{groupId}

Add user to the group

Request Parameters
name type description
groupId path local group ID
id path local user ID
Response Codes
code condition
200 User was added.
404 User {id} or group {groupId} does not exist.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json GroupLoadResponse (JSON) group

Example

Request
PUT /user/{id}/groups/{groupId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "group" : {
    "id" : 12345,
    "name" : "...",
    "description" : "...",
    "children" : [ { }, { } ]
  },
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

GET /user/{id}/groups/{groupId}/nodes

Get node restrictions for the assignment of the user to the group

Request Parameters
name type description
groupId path group ID
id path user ID
Response Codes
code condition
200 Node restriction is returned.
404 User {id} or group {groupId} does not exist, or the user is not assigned to the group.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json NodeRestrictionResponse (JSON) response containing the node restrictions

Example

Request
GET /user/{id}/groups/{groupId}/nodes
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "nodeIds" : [ 12345, 12345 ],
  "hidden" : 12345,
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

DELETE /user/{id}/groups/{groupId}/nodes/{nodeId}

Remove node restriction from the assignment of the user to the group

Request Parameters
name type description
groupId path group ID
id path user ID
nodeId path node ID
Response Codes
code condition
200 Node restriction was removed.
404 User {id} or group {groupId} or node {nodeId} does not exist, or the user is not assigned to the group.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json NodeRestrictionResponse (JSON) response containing the (possible updated) node restrictions

Example

Request
DELETE /user/{id}/groups/{groupId}/nodes/{nodeId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "nodeIds" : [ 12345, 12345 ],
  "hidden" : 12345,
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

PUT /user/{id}/groups/{groupId}/nodes/{nodeId}

Add node restriction to the assignment of the user to the group

Request Parameters
name type description
groupId path group ID
id path user ID
nodeId path node ID
Response Codes
code condition
200 Node restriction was added.
404 User {id} or group {groupId} or node {nodeId} does not exist, or the user is not assigned to the group.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json NodeRestrictionResponse (JSON) response containing the (possibly updated) node restrictions

Example

Request
PUT /user/{id}/groups/{groupId}/nodes/{nodeId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "nodeIds" : [ 12345, 12345 ],
  "hidden" : 12345,
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}