-
Notifications
You must be signed in to change notification settings - Fork 0
Server | Endpoints
Mitchell Mastromonaco edited this page Apr 15, 2020
·
27 revisions
Endpoints in express (and in general) follow certain guidelines. Therefore, one must follow these guidelines to make proper endpoints. The format for the endpoint is as follows :
- The beginning is standardized by starting with
/api. - Add the name of your entity followed by an s. For example,
/tasksor/taskPrioritys. - Add the name of what the endpoint does. For example,
/create,/updateor/list. - (Optional) Add any parameters required. This step may be repeated. For example,
/:taskIdor/:taskId/:attr.
/api/bugtracker/auth/login/api/management
annotations
-
/api/annotations/api/annotations/create/api/annotations/clone/:annotationId/api/annotations/update/:annotationId/api/annotations/delete/:annotationId/api/annotations/list/api/annotations/list/:attr([a-zA-Z][a-zA-Z0-9]+)/api/annotations/getBase/api/annotations/get/getEmpty/api/annotations/get/:annotationId([0-9]+)/api/annotations/get/:annotationId([0-9]+)/:attr([a-zA-Z][a-zA-Z0-9]+)/api/annotations/get/api/annotations/get/:attr([a-zA-Z][a-zA-Z0-9]+)
images
-
/api/images/api/images/create/api/images/createNew/api/images/createCli/api/images/update/:imageId/api/images/updateFile/:imageId/api/images/updatePreprocessing/:imageId/api/images/delete/:imageId/api/images/list/api/images/list/attr([a-zA-Z][a-zA-Z0-9]+)/api/images/gallery/api/images/get/:imageId([0-9]+)/api/images/get/:imageId([0-9]+)/attr([a-zA-Z][a-zA-Z0-9]+)/api/images/get/api/images/get/:attr([a-zA-Z][a-zA-Z0-9]+)
submission events
-
/api/submissionEvents/api/submissionEvents/list/api/submissionEvents/list/:attr([a-zA-Z][a-zA-Z0-9]+)/api/submissionEvents/get/:id([0-9]+)/api/submissionEvents/get/:id([0-9]+)/attr([a-zA-Z][a-zA-Z0-9]+)/api/submissionEvents/get/api/submissionEvents/get/:attr([a-zA-Z][a-zA-Z0-9]+)
task
-
/api/tasks/api/tasks/create/api/tasks/update/:taskId/api/tasks/delete/:taskId/api/tasks/submit/:taskId/api/tasks/list/api/tasks/list/:attr([a-zA-Z][a-zA-Z0-9]+)/api/tasks/gallery/:userId/api/tasks/get/:taskId([0-9]+)/api/tasks/get/:taskId([0-9]+)/attr([a-zA-Z][a-zA-Z0-9]+)/api/tasks/get/api/tasks/get/:attr([a-zA-Z][a-zA-Z0-9]+)/api/tasks/get/next/:userId
task prioritys
-
/api/taskPrioritys/api/taskPrioritys/create/api/taskPrioritys/update/:taskPriorityId/api/taskPrioritys/delete/:taskPriorityId/api/taskPrioritys/assign//api/taskPrioritys/get/tasksBundles
task types
-
/api/taskTypes/api/taskTypes/create/api/taskTypes/update/:taskTypeId/api/taskTypes/delete/:taskTypeId/api/taskTypes/list/api/taskTypes/list/:attr/api/taskTypes/get/:taskTypeId([0-9]+)/api/taskTypes/get/:taskTypeId([0-9]+)/attr([a-zA-Z][a-zA-Z0-9]+)/api/taskTypes/get/api/taskTypes/get/:attr([a-zA-Z][a-zA-Z0-9]+)
users
-
/api/users/api/users/create/api/users/update/:userId/api/users/delete/:userId/api/users/get/:userId/:attr/api/users/get/:attr/api/users/:userId/last-event/api/users/list
widgets
-
/api/widgets/api/widgets/create/api/widgets/update/:widgetId/api/widgets/delete/:widgetId
-
Add a user to the database. This operation needs administrator privilege.
-
firstName[str]: User's first name. -
lastName[str]: User's last name. -
email[str]: User's email. It's also the ID used by the user to authenticate to the server. -
password[str]: User's password. As of now, the CLI doesn't encrypt the password. -
isAdmin[bool]: Set the role of the user (deprecated since more role have been added).
-
-
Modify a user in the database.
-
userId[int]: The index of the user to modify.
-
firstName[strOPTIONAL]: User's first name. -
lastName[strOPTIONAL]: User's last name. -
email[strOPTIONAL]: User's email. It's also the ID used by the user to authenticate to the server. -
password[strOPTIONAL]: User's password. As of now, the CLI doesn't encrypt the password. -
isAdmin[boolOPTIONAL]: Set the role of the user (deprecated since more role have been added).
-
-
Delete a user in the database.
-
userId[int]: The index of the user to delete.
-
-
Fetch a user from the database.
-
userId[int]: The index of the user to modify. -
attr[string]: The attribute to fetch from the selected user. If none is provided the entireUserentity is transmitted. See the return section for more information. -
undefined: the entireUserentity. -
proto: theProtoUserprototype.
-
-
Fetch several users from the database.
-
attr[string]: The attribute to fetch from the selected users. If none is provided the entireUserentities are transmitted. See the return section for more information.
-
ids[list]: The indexes of the users to fetch.
The returned object depend on the
attrrequests parameters:-
undefined: A list of entireUserentities. -
proto: A list ofProtoUserprototype.
-