Methods

This page contains all methods of AsteroidDB.

There is a list below which you can find all methods of AsteroidDB. All results (errors, replies etc.) are in JSON response. So you need to use a JSON component in your programming language to parse the AsteroidDB's results.

Check Response tab to see available action response codes.

post
Store

https://yourasteroiddb.herokuapp.com/store
Store a value along with tag, or changes the value of tag to database if you are using an existing tag. added on v1.0
Request
Response
Request
Form Data Parameters
tag
required
string
A unique key which used for managing the value.
value
required
string
Value to store.
pass
optional
string
The current database password, you can leave this empty if your database is not protected with password.
Response
200: OK
Action is executed successfully. tag parameter gives tag of the stored record. value parameter gives value of the stored record.
{
"action": "STORED",
"tag": "...",
"value": "..."
}
400: Bad Request
Action is not executed successfully.
{
"action": "ERROR",
"result": "(Error message)"
}

post
Get Value

https://yourasteroiddb.herokuapp.com/get
Get the value from database with using tag. added on v1.0
Request
Response
Request
Form Data Parameters
tag
required
string
A unique key which used for managing the value.
pass
optional
string
The current database password, you can leave this empty if your database is not protected with password.
Response
200: OK
Action is executed successfully. tag parameter gives the tag of the record. value parameter gives the value of the record.
{
"action": "GOT",
"tag": "...",
"value": "..."
}
400: Bad Request
Action is not executed successfully.
{
"action": "ERROR",
"result": "(Error message)"
}

post
Get All Tags

https://yourasteroiddb.herokuapp.com/getall
Get all tags from database. Tags are returned in JSON array. added on v1.0
Request
Response
Request
Form Data Parameters
pass
optional
string
The current database password, you can leave this empty if your database is not protected with password.
Response
200: OK
Action is executed successfully. tag parameter gives the all tag names as a array. Password record is excluded.
{
"action": "TAGS",
"tag": ["...", "..."]
}
400: Bad Request
Action is not executed successfully.
{
"action": "ERROR",
"result": "(Error message)"
}

post
Delete

https://yourasteroiddb.herokuapp.com/delete
Delete a record using tag. added on v1.0
Request
Response
Request
Form Data Parameters
tag
required
string
A unique key which used for managing the value.
pass
optional
string
The current database password, you can leave this empty if your database is not protected with password.
Response
200: OK
Action is executed successfully. tag parameter gives the tag of the deleted record.
{
"action": "DELETED",
"tag": "..."
}
400: Bad Request
Action is not executed successfully.
{
"action": "ERROR",
"result": "(Error message)"
}

post
Format

https://yourasteroiddb.herokuapp.com/format
Deletes every record from database, including password protection! There is no way to recover them again! added on v1.0
Request
Response
Request
Form Data Parameters
pass
optional
string
The current database password, you can leave this empty if your database is not protected with password.
Response
200: OK
Action is executed successfully. count parameter gives the record count of how many records are deleted.
{
"action": "FORMATTED",
"count": 6
}
400: Bad Request
Action is not executed successfully.
{
"action": "ERROR",
"result": "(Error message)"
}

post
Set / Change Password

https://yourasteroiddb.herokuapp.com/auth/password
Change or set a password for database. Setting a password will require a password in all other operations. added on v1.0
Request
Response
Request
Form Data Parameters
newpass
required
string
Password which will replace the old one.
oldpass
optional
string
The current database password, you can leave this empty if your database is not protected with password.
Response
200: OK
Action is executed successfully. action parameter can have two values in this method. If password is changed, action will be CHANGED PASSWORD, but if password is set for the first time, it will be SET PASSWORD. newpass parameter returns the new password.
{
"action": "CHANGED PASSWORD",
"newpass": "******"
}
400: Bad Request
Action is not executed successfully.
{
"action": "ERROR",
"result": "(Error message)"
}

post
Unlock

https://yourasteroiddb.herokuapp.com/auth/unlock
Removes password protection by deleting password record. Deleting the password will not require a password in all other operations anymore. Password protection needs to be enabled to use this method. So this method won't work with no-password databases. added on v1.0
Request
Response
Request
Form Data Parameters
pass
required
string
The current database password.
Response
200: OK
Action is executed successfully. pass parameter returns the password which same as in the input.
{
"action": "DELETED PASSWORD",
"pass": "******"
}
400: Bad Request
Action is not executed successfully.
{
"action": "ERROR",
"result": "(Error message)"
}

post
Get Data

https://yourasteroiddb.herokuapp.com/auth/data
Gives all data in the database by returning tags and values of every record. This method doesn't include password record for security. Password protection needs to be enabled to use this method. So this method won't work with no-password databases. added on v1.0
Request
Response
Request
Form Data Parameters
pass
required
string
The current database password.
Response
200: OK
Action is executed successfully. data parameter returns an array which contains tag, value pairs.
{
"action": "DATA",
"data": [
["tag1","value1"],
["tag2","value2"]
]
}
400: Bad Request
Action is not executed successfully.
{
"action": "ERROR",
"result": "(Error message)"
}

post
Is True

https://yourasteroiddb.herokuapp.com/istrue
Returns true in the result if database password is the same with the entered pass parameter. Otherwise, false. This method can be useful in applications to check the password before connecting to the database. added on v1.0
Request
Response
Request
Form Data Parameters
pass
optional
string
The current database password, you can leave this empty if your database is not protected with password.
Response
200: OK
Action is executed successfully. result parameter returns true if the pass parameter is the same with the database password, otherwise false.
{
"action": "IS CORRECT",
"result": false
}
400: Bad Request
Action is not executed successfully.
{
"action": "ERROR",
"result": "(Error message)"
}

get
Is Locked

https://yourasteroiddb.herokuapp.com/islocked
Returns true in the result if database is locked with password, otherwise false. added on v1.0
Request
Response
Request
Response
200: OK
Action is executed successfully. result parameter returns true if database has password, otherwise false.
{
"action": "IS LOCKED",
"result": false
}
400: Bad Request
Action is not executed successfully.
{
"action": "ERROR",
"result": "(Error message)"
}

get
Count

https://yourasteroiddb.herokuapp.com/count
Returns a number which tells how many records there are in the database. You can just use this method to learn record count without getting tag list or value list. added on v1.0
Request
Response
Request
Response
200: OK
Action is executed successfully. count parameter returns current record count.
{
"action": "COUNT",
"count": 100
}
400: Bad Request
Action is not executed successfully.
{
"action": "ERROR",
"result": "(Error message)"
}

get
Version

https://yourasteroiddb.herokuapp.com/version
Returns the AsteroidDB instance version. This is an manual version code. When every release of AsteroidDB. This method's return value will be changed. So you can know if your instance is outdated. added on v1.1
Request
Response
Request
Response
200: OK
Action is executed successfully. result parameter returns the instance version.
{
"action": "VERSION",
"result": "1.1"
}
400: Bad Request
Action is not executed successfully.
{
"action": "ERROR",
"result": "(Error message)"
}