The ApplicationPreference API is intended to support the COmanage Registry user interface, and does not follow many of the usual patterns of the REST API. This API is considered experimental, and may change across minor releases without notice.

The ApplicationPreference API uses the web browser's session for authentication and to determine the subject CO Person for each request. It is not possible to store or retrieve preferences for other CO People via this API.

Retrieve

Retrieve an Application Preference.

Request Format

Method

GET

URL

/application_preferences/<tag>

Request Body


Response Format

HTTP Status

Response Body

Description

200 OK

A JSON document with three members:

  • co_person_id: The subject's CO Person id
  • tag: The requested tag
  • value: The tag's current value

ApplicationPreference obtained for the current user and tag

400 No Tag Specified


A tag was not provided in the request

401 Unauthorized


Authentication required


Store

Store an Application Preference.

Request Format

Method

PUT

URL

/application_preferences/<tag>

Request Body

A JSON document with one member:

  • value: The tag's new value

Response Format

HTTP Status

Response Body

Description

200 OK


Application Preference stored

400 No Tag Specified


A tag was not provided in the request

401 Unauthorized


Authentication required

500 Server Error


Unknown error

The tag's value may be a JSON null, to indicate the value should be unset. There is no separate delete request.



Notes

  • The tag's value may be a JSON null if the tag has no value or if the tag has not previously defined. In other words, there is no functional difference between an empty tag and an undefined tag.
  • (warning) A tag with a dot (.) in it (eg: User.setting) may be misparsed by the framework into a file extension (of type .setting). To avoid this, simply append an extra slash (/) to the request URL. eg: /application_preferences/User.setting/

See Also

  • No labels