-
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/annotations``__](#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]+)``-
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.
-