-
Notifications
You must be signed in to change notification settings - Fork 3
API Documentation
The API backend for the AIIMS Inventory Management System
DELETE /item/:id
| Name | Type | Description |
|---|---|---|
| id | Number | The id of item to be deleted |
Error:
{
"status": "Error status code",
"message": "Error Message"
}:
This can be used to get item details
GET /item/:id
| Name | Type | Description |
|---|---|---|
| id | String | The id of the item |
Error:
{
"status": "Error status code",
"message": "Error Message"
}
GET /item?params
| Name | Type | Description |
|---|---|---|
| page | The page number of items |
|
| size | The number of items on each page |
|
| sort | The field to sort according to |
|
| order | The order to sort with 'asc' or 'desc' |
Error:
{
"status": "Error status code",
"message": "Error Message"
}
This can only by used by admin to add a new item
POST /item
PUT /item/:id
| Name | Type | Description |
|---|---|---|
| item | Number | The id of the item to be changed |
| parameter | Type | The parameter to change |
Error:
{
"status": "Error status code",
"message": "Error Message"
}
Sending a post to this route will return a login token which should be sent with every request to access data. There is no need for logout since the token expires after a fixed time anyway
POST /auth
Success:
{
"token": "an access token"
}
Error:
{
"status": "Error status code",
"message": "Error Message"
}
GET /search/items?params
| Name | Type | Description |
|---|---|---|
| query | The query to search for |
|
| limit | The number of items in result |
|
| sort | The field to sort according to |
|
| order | The order to sort with 'asc' or 'desc' |
Success:
{
"status": "Status code",
"data": [{Objects}]
}
Error:
{
"status": "Error status code",
"message": "Error Message"
}
GET /search/users?params
| Name | Type | Description |
|---|---|---|
| query | The query to search for |
|
| limit | The number of items in result |
|
| sort | The field to sort according to |
|
| order | The order to sort with 'asc' or 'desc' |
Success:
{
"status": "Status code",
"data": [{Objects}]
}
Error:
{
"status": "Error status code",
"message": "Error Message"
}
DELETE /user/:id
| Name | Type | Description |
|---|---|---|
| username | Number | The username to be deleted |
Error:
{
"status": "Error status code",
"message": "Error Message"
}
This can only by used by admin to get the imformation about all users in one place.
GET /user/
Success:
[{
"name": "User Name",
"role": "User Role"
}]
Error:
{
"status": "Error status code",
"error": "Error Message"
}
This can be used to get user details
GET /user/:id
| Name | Type | Description |
|---|---|---|
| username | Number | The username of the user |
Success:
{
"name": "Name",
"username": "Username",
"role": "User Role"
}
Error:
{
"status": "Error status code",
"error": "Error Message"
}
This can only by used by admin to add a new user
POST /user/
PUT /user/:id
| Name | Type | Description |
|---|---|---|
| username | Number | The username to be changed |
| name | String | (optional) New name |
Success:
{
"id": "User ID",
"name": "New Name",
"role": "User Role"
}
Error:
{
"status": "Error status code",
"error": "Error Message"
}