Recommended reading: Microsoft REST API Guidelines
This are the required endpoints for the UA's Portal Backoffice, some of them might already exist.
All user related logic. Needs to work with a Single Page Application, preferably some JWT solution.
There's also the need for roles, this are my suggestions, they can have different names:
- Admin - access to all endpoints (admin of all subdomains)
- Editor - access to all subweb endpoints (can manage subdomains or specific pages)
- Normal - access to remaining endpoints (can edit specific pages, upload content...)
Admin - access to all endpoints (admin de todos os subdominios) Editor - access to all subweb endpoints (pode gerir subdominios inteiros ou páginas especificas editar/apagar/criar) Normal - access to remaining endpoints (pode editar paginas especificas ou editar subdominios inteiros e fazer upload de conteudo) User - faz login mas não tem acesso a nada
Starts the authentication flow with the UA Identity OAuth protocol.
(Normal) Current logged in user from the token (passed through an header, cookie, ...). Has all the necessary user information used for initial application load such as user data, his subwebs...
{
"data": {
"_id": "5d2e022beb80ed9bd5f0f5fa",
"username": "antoniojps",
"admin": true,
"moderator": null,
"email": "antoniojps@ua.pt"
}
}
(Normal) User info, maybe use a query string for specific backoffice data for user subwebs, and roles...
{
"data": {
"_id": "5d2e022beb80ed9bd5f0f5fa",
"email": "antoniojps@ua.pt",
"username": "antoniojps",
"name": "António",
"surname": "Santos",
"providers": [
{
"id": "c3c63153-4b08-4f8e-a01f-b75bc1096cf2",
"provider": "identityua"
}
],
"avatar": null,
"admin": true,
"moderator": null,
"createdAt": null,
"updatedAt": null
}
}
Good to have:
(Normal) Provide filtering, sorting, field selection, paging if possible.
Manipulate subwebs, their pages and users.
(Normal) Subwebs list
(Normal) Subweb info
(Admin) Create a new subweb
(Admin) Edit subweb (name, ...)
(Admin) Archive a subweb
(Editor) Add normal user to subweb with default role (Normal)
(Editor) Add user to subweb with a specific role
(Editor) Remove user from subweb
(Editor) Remove user role from subweb (if no other role the user is removed)
(Public) Page JSON data
(Editor) Edit page
(Admin) Create page
(Admin) Archive page
(Normal) Pages available versions (dates, version id,...)
(Normal) Page JSON data of specific version
(Editor) Roleback page to specific version
Manipulate and manage images: upload, resize and list
(Public) Get original image size
(Public) Resize image, with height and width filters
(Normal) Upload image, with alternative text if possible