-
Notifications
You must be signed in to change notification settings - Fork 3
Role Endpoint
Wiki ▸ Endpoints ▸ Role
Contains data of all roles available on our e-learning platform.
The Role endpoint is a representation of the roles added to the application. The endpoint's purpose is to facilitate accessing, creating, updating and deleting these resources.
Retrieves all the entries
Status code: 200
Body:
[
{
"id": "662d426a-cfb9-4f9e-ac50-ae719194257d",
"name": "ROLE_EXAMPLE"
},
{
"id": "7b1d518c-8106-41e4-800f-fb14c38671f6",
"name": "ROLE_NAME"
}
]Retrieves the entry with the provided id
| Path Parameter | Description |
|---|---|
:id |
The id of the role entry. |
Status code: 200
Body:
{
"id": "662d426a-cfb9-4f9e-ac50-ae719194257d",
"name": "ROLE_STUDENT"
}Status code: 404
Body:
{
"error": "Not Found"
}
Creates a new entry
Status code: 201
Request Body:
{
"name": "ROLE_EXAMPLE"
}
Response Body:
{
"id": "6a144d71-f7dc-4203-bb66-c280bde12350",
"name": "ROLE_EXAMPLE"
}
Status code: 400
Request Body:
{
"name": "",
}
Response Body:
{
"error": "POST: Role Invalid Name",
}
Edits the entry with the provided id
| Path Parameter | Description |
|---|---|
:id |
The id of the role entry. |
Status code: 200
Request Body:
{
"name": "ROLE_EXAMPLE_EDITED"
}
Response Body:
{
"id": "6a144d71-f7dc-4203-bb66-c280bde12350",
"name": "ROLE_EXAMPLE_EDITED"
}Status code: 400
Request Body:
{
"name": "",
}
Response Body:
{
"error": "POST: Role Invalid Name",
}
Status code: 404
Request Body:
{
"name": "ROLE_EXAMPLE",
}
Response Body:
{
"error": "Role not found",
}
Deletes the entry with the provided id
| Path Parameter | Description |
|---|---|
:id |
The id of the role entry. |
Status code: 200
Body:
Status code: 404
Body:
{
"error": "Not Found",
}
Wiki | Site | Project Roadmap | Figma