Simple API for storing and retrieving labeled data.
Parameter | Description |
---|---|
tag (required) |
Choose a tag name which can be used for filtering. This is like a category for a group of similar data |
key (required) |
The key for labeling the data. This will be used for accessing it later |
value (required) |
The data to store at the specified key |
/insert?tag=timers&key=123&value=1610278082
Key | Value |
---|---|
responseType |
"success" |
data |
The data in JSON format |
{
"responseType": "success",
"data": {
"timers": {
"123": "1610278082",
"1234": "1610278082"
}
}
}
Key | Value |
---|---|
responseType |
"error" |
message |
A description of the error |
data |
The data in JSON format (only if the error involves a data value) |
{
"responseType": "error",
"message": "key '123' already exists in tag 'timers'",
"data": {
"timers": {
"123": "1610278082",
"1234": "1610278082"
}
}
}
Parameter | Description |
---|---|
tag (optional) |
The tag name to filter by |
key (optional) |
A specific key you want the value for |
/get
/get?tag=timers
/get?tag=timers&key=123
Key | Value |
---|---|
responseType |
"success" |
data |
The data in JSON format |
{
"responseType": "success",
"data": {
"timers": {
"123": "1610278082",
"1234": "1610278082"
}
}
}
Key | Value |
---|---|
responseType |
"success" |
data |
The data in JSON format for the requested tag |
{
"responseType": "success",
"data": {
"123": "1610278082",
"1234": "1610278082"
}
}
Key | Value |
---|---|
responseType |
"success" |
data |
The data in JSON format for the requested key |
{
"responseType": "success",
"data": {
"123": "1610278082",
}
}
Key | Value |
---|---|
responseType |
"error" |
message |
A description of the error |
data |
The data in JSON format (only if the error involves a data value) |
{
"responseType": "error",
"message": "key '12345' does not exist in tag 'timers'",
"data": {
"123": "1610278082",
"1234": "1610278082"
}
}
Parameter | Description |
---|---|
tag (required) |
Specify the tag where the data should be updated |
key (required) |
Specify which key within that tag should be updated |
value (required) |
The data to store at the specified key |
/update?tag=timers&key=123&value=0
Key | Value |
---|---|
responseType |
"success" |
data |
The data in JSON format |
{
"responseType": "success",
"data": {
"timers": {
"123": "1610278082",
"1234": "1610278082"
}
}
}
Key | Value |
---|---|
responseType |
"error" |
message |
A description of the error |
data |
The data in JSON format (only if the error involves a data value) |
{
"responseType": "error",
"message": "key '12345' does not exist in tag 'timers'",
"data": {
"timers": {
"123": "1610278082",
"1234": "1610278082"
}
}
}
Parameter | Description |
---|---|
tag (required) |
Specify the tag where the data should be deleted |
key (required) |
Specify which key within that tag should be deleted |
/delete?tag=timers&key=123
Key | Value |
---|---|
responseType |
"success" |
data |
The data in JSON format |
{
"responseType": "success",
"data": {
"timers": {
"1234": "1610278082"
}
}
}
Key | Value |
---|---|
responseType |
"error" |
message |
A description of the error |
data |
The data in JSON format (only if the error involves a data value) |
{
"responseType": "error",
"message": "key '12345' does not exist in tag 'timers'",
"data": {
"timers": {
"123": "1610278082",
"1234": "1610278082"
}
}
}
Option | Description |
---|---|
secret (string) |
Secret key for preventing others from modifying your data (leave blank for no secret) |
private (boolean) |
Whether or not the secret key is required for reading the data |
json_path (string) |
Path for storing the data file |
In config.php
, you can set a secret which will be a required parameter passed in the URL for insertion, updates, and deletion (eg. ...&secret=example
).
To require the secret parameter to be passed even when reading data, set private to true.