systemapic / wu

Systemapic web server and API
https://systemapic.com
2 stars 3 forks source link

Documentation of API #296

Open knutole opened 8 years ago

knutole commented 8 years ago

Need to write a full documentation of all API endpoints.

See #253 for how this fits in with testing and refactors, which should be done together.

Documentation needed:

All routes.js must be documented like this.

/**
    * @api {post} /api/project/create Create a project
    * @apiName create
    * @apiGroup Project
    * @apiUse token
    * @apiParam {String} name Name of project
    *
    * @apiSuccess {JSON} Project JSON object of the newly created project
    * @apiSuccessExample {json} Success-Response:
    *     {
    *       "project": "project-o121l2m-12d12dlk-addasml",
    *       "deleted": true
    *     }
    */

References
knutole commented 8 years ago

@IgorZiegler There is also lots of API documentation to do. I've started with some of the routes, would be great if you could continue. This goes closely hand-in-hand with testing, so it's good to get into both at the same time perhaps. See above, everything should be explained there.

do npm run-script apidocs to create docs, and see them at https://dev3.systemapic.com/docs/api/

strk commented 8 years ago

+1 this is very important

knutole commented 8 years ago

@IgorZiegler Can you please go over the API documentation?

Want to close this asap.

IgorZiegler commented 8 years ago

@knutole I begin to check all docs. you can see progress in the table below I am going to do more checks tomorrow

API v2

Current API DOCS

wu request method endpoint api doc api doc worked test
PORTAL 
Get portal GET /v2/portal exist yes no
Get status GET /v2/status exist yes yes
DATA
Create file POST v2/data/create Added yes added
Share dataset POST /v2/data/share exist yes yes
Delete dataset POST /v2/data/delete exist yes yes
Update data POST /v2/data/update Added yes yes
Get layers @ data POST /v2/data/layers exist Doesn't know how we can check it yes
Download data POST  /v2/data/download  added yes no
PROJECTS
Create project POST  /v2/projects/create exist yes yes
Update project POST /v2/projects/update exist yes yes
Delete project POST /v2/projects/delete exist yes yes
Add data to project POST /v2/projects/data exist yes yes
Get public project GET /v2/projects/public exist yes yes
Get private project GET /v2/projects/private exist yes yes
Set project access POST /v2/projects/access Added yes yes
Get project layers POST /v2/projects/layers exist yes yes
USERS 
Get session GET /v2/users/session exist yes yes
Get token from password GET /v2/users/token exist yes yes
Create user POST /v2/users/create exist yes yes
Update user POST /v2/users/update exist yes yes
Check if email unique POST /v2/users/email/unique exist yes yes
Check if username unique POST /v2/users/username/unique exist yes yes
Get invite link GET /v2/users/invite/link exist yes yes
Invite user to project POST /v2/users/invite/project exist Doesn't know how we can check it yes
Invite user POST  /v2/users/invite exist Doesn't know how we can check it yes
Reset password POST /v2/users/password/reset exist yes yes
Request contact POST /v2/users/contacts/request exist yes yes
Refresh token POST /v2/users/token/refresh exist yes yes
Check token POST /v2/users/token/check updated yes yes
Check token GET /v2/users/token/check updated yes yes
LAYERS
Delete layer POST /v2/layers/delete exist yes yes
Update layer POST /v2/layers/update exist yes yes
Set CartoCSS POST /v2/layers/carto added yes no
Get CartoCSS GET /v2/layers/carto added yes no
Download layer POST /v2/layers/download added yes no
Create layer POST /v2/layers/create exist yes yes
Create default layer POST /v2/layers/create/default added yes no
Reload meta POST /v2/layers/meta added yes yes
Convert styleJSON to CartoCSS POST /v2/layers/carto/json exist Doesn't know how we can check it yes
LEGENDS
Create legends POST /v2/legends/create added yes need to add
HASHES
Create hash POST /v2/hashes/set exist Doesn't know how we can check it yes
Get hash GET /v2/hashes/get exist yes yes
LOG/ANALYTICS
Set analytics POST /v2/log not clear
Get analytics GET  /v2/log outdated
Log error POST /v2/log/error updated worked, but very strange endpoint no