- Rust-API
- Modules
Route to log a user in, returns the bearer token and user object
No Auth Required
{
email: String,
password: String
}
{
token: String,
user: {
name: String,
email: String,
username: String
}
}
Error Code | Error Reason |
---|---|
400 | Email or Password is incorrect |
Route to register a user, returns a bearer token and user object
No Auth Required
{
name: String,
username: String
email: String,
password: String
}
{
token: String,
user: {
name: String,
email: String,
username: String
}
}
Error Code | Error Reason |
---|---|
400 | Email Exists, Username Exists |
Get all the records for a user
A valid bearer token is required
None
{
[
{
record_type: Secret || Password,
_id: String,
user_id: String,
key: Option<String>,
secret: Option<String>,
service: Option<String>,
password: Option<String>,
email: Option<String>,
username: Option<String>,
}
]
}
Error Code | Error Reason |
---|---|
400 | User id is not a valid object id |
401 | User id and Id in token do not match |
Get a specific record, :id is id of record
A valid bearer token is required
None
{
records: {
record_type: Secret || Password,
_id: String,
user_id: String,
key: Option<String>,
secret: Option<String>,
service: Option<String>,
password: Option<String>,
email: Option<String>,
username: Option<String>,
}
}
Error Code | Error Reason |
---|---|
400 | User id is not a valid object id |
401 | User id and Id in token do not match |
404 | Record was not found |
Create a new record
A valid bearer token is required
{
record_type: "Secret" || "Password",
key: Option<String>,
secret: Option<String>,
service: Option<String>,
password: Option<String>,
email: Option<String>,
username: Option<String>,
}
Notes
- A 400 will be thrown if record_type is Secret and key or secret is not in body
- A 400 will be thrown if record_type is Secret and any password fields are passed in
- A 400 will be thrown if record_type is Password and service, password, email or username are not in body
- Email or Username can be passed in. Both do not need to be passed in
- A 400 will be thrown if record_type is Password and any secret fields are passed in
{
id: String
}
Error Code | Error Reason |
---|---|
400 | User id is not a valid object id |
401 | User id and Id in token do not match |
Update a record, :id is id of record
A valid bearer token is required
{
service: Option<String>,
password: Option<String>,
email: Option<String>,
username: Option<String>,
key: Option<String>,
secret: Option<String>,
}
Notes
- A 400 will be thrown if record_type is Secret and any password fields are passed in
- A 400 will be thrown if record_type is Password and any secret fields are passed in
No body but response Code: 204
Error Code | Error Reason |
---|---|
400 | User id is not a valid object id |
401 | User id and Id in token do not match |
404 | Record was not found |
Delete a record, :id is id of record
A valid bearer token is required
None
No Body but reponse code is 204
Error Code | Error Reason |
---|---|
400 | User id is not a valid object id |
401 | User id and Id in token do not match |
404 | Record was not found |
Search a users record
Parameter Name | Description |
---|---|
Page | The page of the search, used for pagination |
Limit | The amount of records to show |
Query | A text query to search for records |
A valid bearer token is required
None
{
records: {
record_type: Secret || Password,
_id: String,
user_id: String,
key: Option<String>,
secret: Option<String>,
service: Option<String>,
password: Option<String>,
email: Option<String>,
username: Option<String>,
}
}
Error Code | Error Reason |
---|---|
400 | User id is not a valid object id |
401 | User id and Id in token do not match |
Get the user object
A valid bearer token is required
None
{
id: String,
email: String,
username: String,
name: String
}
Error Code | Error Reason |
---|---|
400 | User id is not a valid object id |
401 | User id and Id in token do not match |
404 | User does not exist |
Update either the users email or password
A valid bearer token is required
{
new_password: Option<String>,
email: Option<String>,
password: String
}
None, return code is 204
Error Code | Error Reason |
---|---|
400 | User id is not a valid object id, Password does not match, new_password or email not sent |
401 | User id and Id in token do not match |
404 | User does not exist |