Introduction
The endpoint of this service allows to get the user information. since 11.13 A new endpoint allows to handle user preferences.
EndPoints
There are two endpoints:
One to get user information
since
Status | ||
---|---|---|
|
Code Block |
---|
GET http://host:port/app/api/rest/whoami |
Status |
---|
|
Code Block |
---|
GET http://host:port/app/api/json/whoami |
...
Code Block |
---|
http//host:port/app/_plugins/WXM_RESTAPI/page/whoami.jspz |
Available method: GET
One to handle preferences
RESTful URIs since
Status | ||
---|---|---|
|
Code Block |
---|
GET http://host:port/app/api/json/userpref{/name}/{namespace}/{key} PUT http://host:port/app/api/json/userpref{/name}/{namespace}/{key} PATCH http://host:port/app/api/json/userpref{/name}/{namespace}/{key} DELETE http://host:port/app/api/json/userpref{/name}/{namespace}/{key} |
...
GET
POST, PUT, PATCH
DELETE
Getting user information
Parameters
none
Response format
Code Block |
---|
{ "response": { "data": { "id": "user id", "login": "identifier login", "name": "user name", "roleId": "user role id", "role": "user role name", "locale": "user local", "login_hints": { "id": "oauth2 authentication server id", "login_hint": "login hint" }, "queryLocale": "the request current local" } }, "links": { "href": "http://host:port/app/_plugins/WXM_RESTAPI/page/whoami.jspz" }, "status": 200, "time": 439 } |
...
The whoami action of RESTAPI domain allows the management of the endpoint call authorization. The uniq parameter is:
surfer: surfer
Errors codes
HTTP code | API code | Definition |
---|---|---|
403 | 403/1000 | Forbidden action |
Handle user preferences
Parameters
Common to all methods
namespace: (mandatory) the namespace of preference store to get
key: (mandatory) key identifier of the preference value
name: (optional) identifier of an object that stores the preference if it is not the default storage object. The object must have the tag REST_API_PREF (except default storage object)
Only for POST, PUT and PATCH methods
value: value to set to preference
type: type of the value in the preference store (if it is not mentionned, the value can be evaluated automatically).
Response format
Code Block |
---|
{ "request": { "version": "1.2", "parameters": { "namespace": "bov3", "key": "color" } }, "response": { "data": { "type": "string", "value": "#FF0000" } }, "links": { "href": "host:port/app/api/json/userpref?namespace=bov3&key=color" }, "status": 200, "time": 121 } |
Security
The userpref action of RESTAPI domain allows the management of the endpoint call authorization. There are the following parameters:
...