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 11.16
GET http://host:port/app/api/rest/whoami
since 11.12
GET http://host:port/app/api/json/whoami
Legacy endpoint:
http//host:port/app/_plugins/WXM_RESTAPI/page/whoami.jspz
Available method: GET
One to handle preferences
RESTful URIs since 11.14
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}
URI with parameters
GET http://host:port/app/api/json/userpref
Legacy endpoint:
http//host:port/app/_plugins/WXM_RESTAPI/page/userpref.jspz
Available methods:
-
GET
-
POST, PUT, PATCH
-
DELETE
Getting user information
Parameters
none
Response format
{
"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
}
Security
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
{
"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:
-
surfer: surfer
-
method: type of access (READ, WRITE or DELETE)
-
namespace: namespace
-
key: preference key
-
name: preference storage object name (could be null)