-
Notifications
You must be signed in to change notification settings - Fork 17
RESTful API config
Guido Krömer edited this page Jan 25, 2014
·
1 revision
The config API resource is a simple key value store for storing frontend and backend configuration values.
Unlike the other API resources the config API returns an array as a result on each GET request, this is conditional, by the way keys working. Several keys can be grouped by using the same prefix and can fetched together by using the prefix only as key.
Get all config values.
Example response
{
"status": 200,
"response": [
{
"id": 1,
"key": "database-version",
"value": 1
},
{
"id": 2,
"key": "update-interval-min",
"value": 600
},
{
"id": 3,
"key": "update-interval-max",
"value": 604800
},
]
}
Create a new config value
Example request
{
"key": "example",
"value": 1337
}
Example response
{
"status": 201,
"response": 4 /*Id of newly added config value*/
}
Get a set config value by its key
Example request api/1/config/database-version
Example response
{
"status": 200,
"response": [
{
"id": 1,
"key": "database-version",
"value": 1
}
]
}
Edit a config value specified by its key
Example request api/1/config/update-interval-max
{
"value": "3600"
}
Example response
{
"status": 200,
"response": 3
}
Delete a config value specified by key
Example request api/1/config/example
Example response
{
"status": 200,
"response": 4
}