- You will save all the data in the store.
- On creating the store, you will get a store key.
- This will prevent other users to get access to your store.
- Save the key securely as it will be the first and last time you can see the key
- The key will be required to perform operations on the store (like adding the data to it, updating it and so on...)
- To save the data you will require the store id and store key.
- The data to be saved should be a String.
Endpoint: /api/store
Request Type: POST
Body:
{
"name": "Store name"
}
Success Response:
{
"message": "Store created!",
"success": true,
"storeKey": "uuid v4 key",
"storeId": "store id"
}
Errors:
- Store already exists
Try using a different name
Endpoint: /api/data
Request Type: POST
Body:
{
"storeId": "store id",
"storeKey": "uuid v4 key",
"value": "string value"
}
Success Response:
{
"message": "Data created successfully",
"success": true,
"data": {
"id": "data id",
"value": "string value",
"storeId": "store id"
},
"store": {
"id": "store id",
"name": "store name"
}
}
Errors:
- Store not found
- Invalid store key
Endpoint: /api/data/{{ dataId }}
Request Type: PUT
Body:
{
"storeKey": "uuid v4 key",
"value": "string value"
}
Success Response:
{
"message": "Data updated successfully",
"success": true,
"data": {
"id": "data id",
"value": "string value"
},
"store": {
"name": "store name",
"id": "store id"
}
}
Errors:
- Data not found
- Data is same
- Invalid store key
Endpoint: /api/data/{{ dataId }}
Request Type: POST
Body:
{
"storeKey": "uuid v4 store key"
}
Success Response:
{
"message": "Data fetched successfully",
"success": true,
"data": {
"id": "data id",
"value": "string value"
},
"store": {
"name": "store name",
"id": "store id"
}
}
Errors:
- Data not found
- Invalid store key
Endpoint: /api/data/{{ dataId }}?delete=true
Request Type: POST
Body:
{
"storeKey": "uuid v4 store key"
}
Success Response:
{
"message": "Data deleted successfully",
"success": true
}
Errors:
- Data not found
- Invalid store key
Endpoint: /api/store/{{ storeId }}
Request Type: POST
Body:
{
"storeKey": "uuid v4 store key"
}
Success Response:
{
"message": "Store found!",
"success": true,
"store": {
"id": "store id",
"name": "store name",
"data": []
}
}
Errors:
- Store not found
- Invalid store key
Endpoint: /api/store/{{ storeId }}?delete=true
Request Type: POST
Body:
{
"storeKey": "uuid v4 store key"
}
Success Response:
{
"message": "Store deleted!",
"success": true
}
Errors:
- Store not found
- Invalid store key