-
Notifications
You must be signed in to change notification settings - Fork 3
REST Interface: Accent
jrf2 edited this page Jul 7, 2012
·
24 revisions
- None of the REST commands on this page have been fully implemented yet.
- update a tag
- Method: GET
- Path: /user/0/tags
- Request: { }
- success:
- Response: { errorcode: 0, tags: [{ tag_id: 0 }, { tag_id: 1 }] }
- error: file not found
- Response: { errorcode: 1, message: "user not found" }
- update a tag
- Method: GET
- Path: /user/0/tags/latest
- Request: { }
- success:
- Response: { errorcode: 0, tag_id: 0 }
- success: but user has not tags
- Response: { errorcode: 0, tag_id: -1 }
- error: file not found
- Response: { errorcode: 1, message: "user not found" }
- update a tag
- Method: GET
- Path: /file/0/tags
- Request: { }
- success:
- Response: { errorcode: 0, tags: [{ tag_id: 0 }, { tag_id: 1 }] }
- error: file not found
- Response: { errorcode: 1, message: "file not found" }
- adds a tag
- Request: { command: "addtag", file_id: 0, user_id: 0, start: 0, end: 120, Category: 0 }
- success
- error: file_id not found in database
- error: start time is greater than end time
- error: category is not valid
- error: user id is not found in database
- error: command != "addtag"
- update a tag
- Method: PUT
- Path: /tag/0
- Request: { start: 25, end: 100 }
- success:
- Response: { errorcode: 0 }
- error: tag not found
- Response: { errorcode: 1, message: "tag not found" }
- deletes a tag
- Method: DELETE
- Path: /tag/0
- Request: { }
- success
- Response: { errorcode: 0 }
- error: tag id not found in database
- Response: { errorcode: 1, message: "tag id not found in database" }
- get the complete info of an individual file
- Method: GET
- Path: /file/0
- Request: { }
- success:
- Response: { data: "data" }
- error: file not found
- Response: { errorcode: 1, message: "file not found" }
- get a list of all the file ids associated with a user
- Method: GET
- Path: /user/0/files
- Request: { }
- success:
- Response: { errorcode: 0, files: [{ file_id: 0 }, { file_id: 1 }] }
- success: but user has not files
- Response: { errorcode: 0, files: [ ] }
- get a list of all the file ids associated with a course
- Method: GET
- Path: /course/0/files
- Request: { }
- success:
- Response: { errorcode: 0, files: [{ file_id: 0 }, { file_id: 1 }] }
- success: but user has not files
- Response: { errorcode: 0, files: [ ] }
- get a list of all the file ids associated with a study group
- Method: GET
- Path: /studygroup/0/files
- Request: { }
- success:
- Response: { errorcode: 0, files: [{ file_id: 0 }, { file_id: 1 }] }
- success: but user has not files
- Response: { errorcode: 0, files: [ ] }
- get the file id of a resource given the id of a tag
- Method: GET
- Path: /tag/0/file
- Request: { }
- success:
- Response: { errorcode: 0, file_id: 0 }
- error: tag not found
- Response: { errorcode: 1, message: "tag not found" }
- adds a file
- Method: POST
- Path: /file/add
- Request: { title:"mytitle", path: "mypath", category_id: 0 }
- success:
- Response: { errorcode: 0 }
- updates a file
- Method: PUT
- Path: /file/0
- Request: { title:"newtitle"}
- success:
- Response: { errorcode: 0 }
- error: file not found
- Response: { errorcode: 1, message: "file not found" }
- deletes a file
- Method: DELETE
- Path: /file/0
- Request: { }
- success:
- Response: { errorcode: 0 }
- error: file not found
- Response: { errorcode: 1, message: "file not found" }