Skip to content
This repository has been archived by the owner on Jan 22, 2021. It is now read-only.

REST API :: Prefs

George Czabania edited this page Feb 19, 2014 · 5 revisions

Prefs

Show all prefs

GET /api/prefs

Parameters:

No parameters

Example Request:

curl -X GET \
  -H "Authorization: bearer <token>" \
  https://nitro-server.herokuapp.com/api/prefs

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "sort": 1,
  "night": 0,
  "language": "en-us",
  "weekStart": 1,
  "dateFormat": "dd/mm/yy",
  "moveCompleted": 0,
  "confirmDelete": 1
}

Show a pref

GET /api/prefs/:key

Parameters:

  • key: a string. Can be any of sort, night, language, weekStart, dateFormat, moveCompleted, confirmDelete.

Example Request:

curl -X GET \
  -H "Authorization: bearer <token>" \
  https://nitro-server.herokuapp.com/api/prefs/language

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "language": "en-us"
}

Update a pref

PUT /api/prefs

Example Request:

curl -X PUT \
  -H "Authorization: bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"confirmDelete":0,"dateFormat":"mm/dd/yy"}' \
  https://nitro-server.herokuapp.com/api/prefs

Example Response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "sort": 1,
  "night": 0,
  "language": "en-us",
  "weekStart": 1,
  "dateFormat": "mm/dd/yy",
  "moveCompleted": 0,
  "confirmDelete": 0
}
Clone this wiki locally