Fabiji RESTful API


Database Entities


User (id, email, name, status = 1 for logged in or 0 for logged out, projects)
Project (id, title, description, tools, materials, license, tags, instructions, media_files, thumbnail_file)
Appointment (id, title, attendee_name, start_date, end_date, notes)
File (id, name, type, url)
Tag (id, name)
License (id, name, description)
Tool (id, name)
Material (id, name)
Instruction (id, description)






API


All methods work on JSON/XML descriptions of Objects.
When GET /entity. all its neighboring entities are returned in full, and its id is returned within its neighboring entities as well.
Relations:
1 to n: Take a text-attribute which contains a link to the linked entity. e.g. project contains license="http://...licenses/22". On Put/Post, the links are checked to point on the correct and existing entity. On the 1 side, there is a url like /licenses/{id}/projects
n to m: GET, POST and DELETE for /entity1/{id1}/entity2/{id2}.

Status Method url Description
OK GET /users Get a list of all User Objects
OK POST /users Create a new User Object
OK GET /users/online Get a list of users, whose status attribute is 1
OK GET /users/{id} Get the User Object with ID id
OK PUT /users/{id} Change the user Object with ID id
OK DELETE /users/{id} Delete user Object with ID id, and delete the link of its projects
OK GET /users/{id}/projects Get a list of Projects of the user with ID id
OK POST /users/{id}/projects Create a new project and link it to the user with ID id
OK GET /users/{idu}/projects/{idp} Get the Project with ID idp, if it belongs to User with idu, or 404 if not
OK POST/DELETE /users/{idu}/projects/{idp} Add the project with ID idp to user with ID idu
OK GET /appointments/{YYYY-MM-DD} Get a list of appointments which start on given date
OK GET /appointments/{id}/user Get are attendee of the appointment with the given id
OK GET /projects Get a list of projects
OK GET /projects/{id}/mediafiles Get a list of mediafiles of the given project
OK GET /projects/search/keyword Returns a list of projects, which contains the keyword (case insensitive) in text attributes
OK GET /projects/{id}/tags Get a list of tags of the given projects
OK POST /projects/{id}/tags Create a tag and link it to the given projects
OKPOST/DELETE/projects/{idp}/tags/{idt} Add tag to the project
OK GET /mediafiles Get a list of mediafiles
OK DELETE /mediafiles/{idm} Deletes the given mediafile, and set the thumbnail_file attribute to nil if the given mediafile is used
OK POST /mediafile Create a new mediafile (data included in the POST-body with parameter "file")
OK POST /projects/{id}/mediafiles Create a new media file and link it to the given project
OK POST/DELETE /projects/{idp}/mediafiles/{idm} Link a mediafile to a project
OK GET /mediafiles/{id} Get a mediafile object with id
OK GET /files/{id} Get the binary file instead of JSON/XML entity, with the given id
OK GET /files/{id}/small, medium Gets a small/medium (red:TODO resolution) sized version of a jpeg file/thumbnail (first frame) of movie file , or an error, if the file is not JPEG/ movie
green:OKGET /tags
~~green tiki_background_" style="color: GET /tags
~~green; background:;">OK GET /tags/{id}/projects
OK GET /licenses/{id}
works tools, materials, same as tags