Pocket Database Rest API supports all the features available, from creating a database to deleting a record.
https://pocketdatabase.vercel.app/v1/api/<ENDPOINT>?token=<TOKEN?>&record=<RECORD>
| Method | Endpoint |
|---|---|
POST |
/write |
This endpoint writes a record to a new database or to an existing database. If the token is not provided, a new database will be created.
POST https://pocketdatabase.vercel.app/v1/api/write?token=<TOKEN>&record=<RECORD>🚀 Request Object
The parameter record is required, and the request body must be a JSON.
☄️ Response Object
{
"success": Boolean,
"result": {
// List of records
"list": Array<String>,
"token": String
}
}| Method | Endpoint |
|---|---|
GET |
/read |
This endpoint reads a record from an existing database.
GET https://pocketdatabase.vercel.app/v1/api/read?token=<TOKEN>&record=<RECORD>🚀 Request Object
The parameter record and token are required.
☄️ Response Object
{
"success": Boolean,
"result": {
// List of records
"list": Array<String>,
"token": String,
// Data of the record
"data": Any
}
}| Method | Endpoint |
|---|---|
GET |
/has |
This endpoint checks if a record exists from an existing database.
I suggest you to check on the list instead for optimization and less performance cost.
GET https://pocketdatabase.vercel.app/v1/api/has?token=<TOKEN>&record=<RECORD>🚀 Request Object
The parameter record and token are required.
☄️ Response Object
{
"success": Boolean,
"result": {
// List of records
"list": Array<String>,
"token": String,
// Result of the checking
"exists": Boolean
}
}| Method | Endpoint |
|---|---|
GET |
/delete |
This endpoint deletes a record from an existing database. Please take note that this will only override the data into a nil. Thus, the record will still exist but its data aren't.
GET https://pocketdatabase.vercel.app/v1/api/delete?token=<TOKEN>&record=<RECORD>🚀 Request Object
The parameter record and token are required.
☄️ Response Object
{
"success": Boolean,
"result": {
// List of records
"list": Array<String>,
"token": String
}
}