You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ashley williams edited this page Jun 12, 2015
·
1 revision
Files Resource
API Documentation
Data Model
The File resource is represented in the database as such:
{
id: <Type.Integer.unique>
path: <Type.String.unique>
project_id: <Type.Integer> // The foreign key of the Project object the File belongs to
buffer: <Type.Blob> // The actual file data
}
Routes, Requests, Responses
CREATE
POST /files
Creates a new File object.
Expects a request.payload with the following attribtues:
// GET /files/1
{
"id":1,
"project_id":1,
"path":"index.js",
"buffer":[118,97,114,32,102,115,32,61,32,114,101,113,117,105,...
}
UPDATE
PUT /files/{id}
Updates a Project object based on its id attribute. The representation that is passed will replace the current representation of the object, so the full representation should be passed, alongside any changes.