Skip to content

User Information

Andy Johns edited this page Feb 19, 2016 · 1 revision

####Description: User Information Service

Allows storage and retrieval of user information.

Method: GET

URL: http://pmapi/user

Output: Standard HTTP status codes, and response data JSON dictionary of stored information from the current user. If no user data is currently stored, this will return a 200 status code with an empty dictionary.


Method: GET

URL: _http://pmapi/user/_**data-element**

Output: Standard HTTP status codes, and response data corresponding to data-element of stored information from the current user.

If data-element is a complex object (array or dictionary) then response data will be JSON dictionary of the complex object. If data-element is a simple value-type object, then response data will be the value as a string.

If data-element is not found in the user data dictionary then the response will be a 404 status code.

Examples:

Given a user object: { "user" : "Joe Smith", "isauthenticated" : true, "userRoles" : [100, 200, 300, 500] }

Request-> http://pmapi/user/name
Response-> 200 status code, and http body containing string "Joe Smith"

Method: POST

URL: http://pmapi/user

Input: JSON dictionary of name/value pairs associated with User data

Output: standard HTTP status codes

Example:

Request-> http://pmapi/user
  POST data: { "user" : "Joe Smith", "isauthenticated" : true, "userRoles" : [100, 200, 300, 500] }

The JSON object would be deserialized as stored as a dictionary for future retrieval. Any existing dictionary currently stored is replaced.


Method: DELETE

URL: http://pmapi/user

Output: standard HTTP status codes

The current user dictionary is cleared. Future GET requests return no data.