115 lines
3.5 KiB
JSON
115 lines
3.5 KiB
JSON
|
{
|
||
|
|
||
|
"GET": {
|
||
|
"info": "returns api information",
|
||
|
"scope": [[]],
|
||
|
"in": {},
|
||
|
"out": {
|
||
|
"version": { "info": "current api version", "type": "varchar(1,8)" },
|
||
|
"info": { "info": "api information details", "type": "<any>" }
|
||
|
}
|
||
|
},
|
||
|
|
||
|
"/": {
|
||
|
|
||
|
"user": {
|
||
|
|
||
|
"GET": {
|
||
|
"info": "gets all | a specific user by id",
|
||
|
"scope": [[]],
|
||
|
"in": {
|
||
|
"URL#0": { "info": "optional user id | all users are returned if missing", "name": "uid", "type": "?int", "default": null }
|
||
|
},
|
||
|
"out": {
|
||
|
"users": { "info": "matching user(s) data", "type": "<any>" }
|
||
|
}
|
||
|
},
|
||
|
|
||
|
"POST": {
|
||
|
"info": "creates a new user",
|
||
|
"scope": [["admin"]],
|
||
|
"in": {
|
||
|
"firstname": { "info": "new first name", "type": "varchar(3,20)" },
|
||
|
"lastname": { "info": "new last name", "type": "varchar(3,20)" },
|
||
|
"mail": { "info": "new mail", "type": "string" }
|
||
|
},
|
||
|
"out": {
|
||
|
"user": { "info": "user data to acknowledge creation", "type": "<any>" }
|
||
|
}
|
||
|
},
|
||
|
|
||
|
"PUT": {
|
||
|
"info": "updates data of an existing user; only the data given will be updated, all fields are optional",
|
||
|
"scope": [["admin"], ["user"]],
|
||
|
"in": {
|
||
|
"URL#0": { "info": "id of the user to update", "type": "int", "name": "user_id" },
|
||
|
"firstname": { "info": "new first name", "type": "?varchar(3,20)", "default": null },
|
||
|
"lastname": { "info": "new last name", "type": "?varchar(3,20)", "default": null },
|
||
|
"mail": { "info": "new mail", "type": "?string", "default": null }
|
||
|
},
|
||
|
"out": {
|
||
|
"user": { "info": "new updated data to acknowledge updates", "type": "<any>" }
|
||
|
}
|
||
|
},
|
||
|
|
||
|
"DELETE": {
|
||
|
"info": "deletes an existing user",
|
||
|
"scope": [["admin"], ["user"]],
|
||
|
"in": {
|
||
|
"URL#0": { "info": "id of the user to delete", "type": "int" }
|
||
|
},
|
||
|
"out": {}
|
||
|
},
|
||
|
|
||
|
"/": {
|
||
|
"post": {
|
||
|
"GET": {
|
||
|
"info": "gets all | a specific post for an existing user",
|
||
|
"scope": [["user"], []],
|
||
|
"in": {
|
||
|
"URL#0": { "info": "optional post id", "type": "int", "name": "?post_id", "default": null },
|
||
|
"URL#1": { "info": "user id (if missing, current connected user)", "type": "int", "name": "?user_id", "default": null }
|
||
|
},
|
||
|
"out": {
|
||
|
"posts": { "info": "matching post(s) data", "type": "<any>" }
|
||
|
}
|
||
|
},
|
||
|
|
||
|
"POST": {
|
||
|
"info": "creates a new post for the current connected user",
|
||
|
"scope": [["user"]],
|
||
|
"in": {
|
||
|
"title": { "info": "new post title", "type": "varchar(3,20)" },
|
||
|
"content": { "info": "new post content", "type": "string" }
|
||
|
},
|
||
|
"out": {
|
||
|
"post": { "info": "post data to acknowledge creation", "type": "<any>" }
|
||
|
}
|
||
|
},
|
||
|
|
||
|
"PUT": {
|
||
|
"info": "updates data of an existing post of the current connected user; only the data given will be updated, all fields are optional",
|
||
|
"scope": [["user"]],
|
||
|
"in": {
|
||
|
"title": { "info": "new post title", "type": "?varchar(3,20)", "default": null },
|
||
|
"content": { "info": "new post content", "type": "?string", "default": null }
|
||
|
},
|
||
|
"out": {
|
||
|
"post": { "info": "new updated data to acknowledge updates", "type": "<any>" }
|
||
|
}
|
||
|
},
|
||
|
|
||
|
"DELETE": {
|
||
|
"info": "deletes an existing post of the current connected user",
|
||
|
"scope": [["user"]],
|
||
|
"in": {
|
||
|
"URL#0": { "info": "id of the post to delete", "type": "int", "name": "post_id" }
|
||
|
},
|
||
|
"out": {}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|
||
|
}
|