3.6 Working With User's Data

3.6.1 About User's Data

Users’ data – data that is stored for a specific event for a user. After logon, you can get access to the user’s data. Users’ data is a JSON-object with a custom structure and parameter names. Each event has different users’ data, check event’s description for more information.

Appliance supports this list of users’ data storage.

Table 3-27 The list of users’ data storage

Data storage identifier

Description

OSLogon

The data storage for operation systems logon processes and information

PasswordStore

The data storage for user’s passwords

3.6.2 Read User's Data

For reading user’s data use resource with URI

/users/{user_id}/data/{data_id}/{data_parameter}?login_session_id={login_session_id}

Resource provided by HTTP GET and has these parameters.

Table 3-28 URI parameters for reading user’s data.

URI parameter name

Description

user_id

User identifier, identifier of user, which wants to get assigned application data.

data_id

The data storage identifier, identifier of the storage which data will be read.

data_parameter

User’s data parameter, optional parameter. If you use this parameter, resource return only this parameter from user’s data.

login_session_id

Login session identifier, identifier of user login session. Check the Provide Authentication chapter for more information.

Resource return user’s data as JSON-object, each event has different data format, check description for more information.

Table 3-29 JSON-object for user’s data.

Parameter name

Description

data

Container for application data JSON-object, if method uses application data parameter, then this container will contain only application data parameter.

Example

On the following examples, user with identifier “6f4db9228c2711e4bb4100155d62a8b3” with login session identifier “cHIIvvAS4KteAG6MnVzJXx1I7TjVtnxP” gets data for storage “OSLogon” and then get only “test1” parameter from application data.

HTTP GET
https://authserver.example.com/api/v1/users/6f4db9228c2711e4bb4100155d62a8b3/data/OSLogon?login_session_id=cHIIvvAS4KteAG6MnVzJXx1I7TjVtnxP
Response
{
"data":
{
"test1":"value 1",
"test3": "value 3",
"test2": "value 2"
}
}
HTTP GET
https://authserver.example.com/api/v1/users/6f4db9228c2711e4bb4100155d62a8b3/data/OSLogon/test1?login_session_id=cHIIvvAS4KteAG6MnVzJXx1I7TjVtnxP
Response
{
"data":
{
"test1":"value 1"
}
}

3.6.3 Modifying User's Data

For modifying user’s data use resource with URI.

/users/{user_id}/data/{data_id}

Resource provided by HTTP PATCH and has these parameters.

Table 3-30 URI parameters for modifying user’s data.

URI parameter name

Description

user_id

User identifier, method will add application data to this user.

data_id

The data storage identifier, resource will add data for this storage, user should be logged on to this event.

Resource accept JSON-object with user’s data.

Table 3-31 Parameters for modifying user’s data.

Parameter name

Description

data

User’s data container, this parameter contains all user’s data, each event has different data format, check description for more information.

login_session_id

Login session identifier, identifier of user login session.

Resource does not returns any data, if the method is successful then it will return HTTP 200 status.

This resource has a flexible behavior, resource can update or modify data, for example, if user has no data, then resource add data for user for this event, if user has some data, then resource update parameters represented in request, add new parameters, if these parameters are not represented into current user’s data, and delete parameters, which set to null into request.

Example

On the following example, user with identifier “6f4db9228c2711e4bb4100155d62a8b3” and login session with identifier “BFldNh3rLx39gjmun65gwJpLETjGF5fO” add user’s data to storage “OSLogon”.

HTTP PATCH
https://authserver.example.com/api/v1/users/6f4db9228c2711e4bb4100155d62a8b3/data/OSLogon
Request
{
"data":
{
"test1":"value 1",
"test2":"value 2",
"test3":"value 3"
},
"login_session_id":"BFldNh3rLx39gjmun65gwJpLETjGF5fO"
}
Response
HTTP 200

3.6.4 Delete User's Data

For deleting user’s data use resource with URI

/users/{user_id}/data/{data_id}/{data_parameter}?login_session_id={login_session_id}

Resource provided by HTTP DELETE and has these parameters.

Table 3-32 URI parameters for deleting user’s data.

URI parameter name

Description

user_id

User identifier, identifier of user, which wants to delete application data.

data_id

The data storage identifier, identifier of storage where data will be deleted.

data_parameter

User’s data parameter, optional parameter. If you use this parameter, resource deletes only this parameter from user’s data. If you do not use this parameter, resource deletes all application data.

login_session_id

Login session identifier, identifier of user login session.

Resource does not return data, if method was success, then return HTTP 200 status.

Example

On the following example, user with identifier “6f4db9228c2711e4bb4100155d62a8b3” with login session identifier “H0u1NPOpPs6foZonfAxoRRDxgTsSYuVM” deletes data parameter “test1” for storage “OSLogon” and then deletes all data for “OSLogon”.

HTTP 
DELETE
https://authserver.example.com/api/v1/users/6f4db9228c2711e4bb4100155d62a8b3/data/OSLogon/test1?login_session_id=H0u1NPOpPs6foZonfAxoRRDxgTsSYuVM
Response
HTTP 200
HTTP DELETE
https://authserver.example.com/api/v1/users/6f4db9228c2711e4bb4100155d62a8b3/data/OSLogon?login_session_id=H0u1NPOpPs6foZonfAxoRRDxgTsSYuVM
Response
HTTP 200