Skip to content

REST Interface: Accent

MikeKlemarewski edited this page Jul 26, 2012 · 24 revisions

Questions

see REST Interface: Presenter

Comments

see REST Interface: Presenter

Follower

Add Follower (Work in Progress)

  • adds a follower to a question tag
  • command: PUT /api/question/:uid/follow/:follower
  • response: ???

Remove Follower (Work in Progress)

  • adds a follower to a question tag
  • command: DELETE /api/question/:uid/follow/:follower
  • response: ???

Tag

Get a tag based on the ID

  • retrieve a tag
  • command: GET /api/tag/:id
  • response: {errorcode: 0, tag:{...}}

Add Tag

  • adds a tag to a MediaFile
  • command: POST /api/tag
  • request:
{
    start: 50,
    end: 140,
    type: 1,
    target: "uuid of target media file",
    title: "optional title",
    description: "optional description",
    question: "uuid of question",
    important: true/false,
    interest: true/false,
    examable: true/false,
    reviewlater: true/false,
    shared: true/false
}
  • response: {errorcode: 0, tag:{...}}

Update Tag

  • update a tag based on the id
  • command: PUT /api/tag/:id
  • response: {errorcode: 0, tag:{...}}

Delete Tag

  • remove a Tag
  • command: DELETE /api/tag/:id
  • response: {errorcode: 0, tag:{...}}

Get Last Watched Tag

  • Get the last watched tag of the user who is logged in
  • command: GET /api/tag/last-watched
  • response: {errorcode: 0, tag:{...}}

Set Last Watched Tag

  • Set the last watched tag of the user who is logged in
  • command: PUT /api/tag/last-watched
  • request:
{
    start: 50,
    end: 140,
    type: 1,
    target: "1A2B-3C4D-5E6F-7G8H",
}
  • response: {errorcode: 0, tag:{...}}

Get users tags by media

  • Get all the tags of the media file that belong to the user who is logged in
  • command: GET /api/tag/mediafile/:id
  • response: {errorcode: 0, tags:[{...},{...}]}

MediaFile

Get a MediaFile based on the ID

  • retrieve a media file
  • command: GET /api/mediafile/:id
  • response: {errorcode: 0, mediafile:{...}}

Add MediaFile

  • adds a media file
  • command: POST /api/mediafile
  • request:
{
    title: "new media title"
    course: "1A2B-3C4D-5E6F-7G8H"
    description: "Double rainbow all the way!"
    path: "/path/to/media/file"
    type: 0
}
  • response: {errorcode: 0, mediafile:{...}}

Update MediaFile

  • update a media file based on the id
  • command: PUT /api/mediafile/:id
  • response: {errorcode: 0, mediafile:{...}}

Delete MediaFile

  • remove a media file
  • command: DELETE /api/mediafile/:id
  • response: {errorcode: 0, mediafile:{...}}

Get all Tags by MediaFile ID

  • retrieve all the tags from the media file
  • command: GET /api/mediafile/:tid/tags
  • response: JSON data of the tags

Get all Questions by MediaFile ID

  • retrieve all the tags from the media file
  • command: GET /api/questions/mediafile/:tid
  • response: {errorcode: 0, questions:[{...},{...}]}

Get Course Media

  • gets all the media files for a certain course
  • command: GET /api/mediafiles/course/:id
  • response: {errorcode: 0, media:[{...},{...}]}

##Conversations

Get Users Conversations For Media File

  • Returns a list of conversations for a specific media file, as well as all conversations that the user has participated in
  • command: GET /api/mediafile/:id/conversations
  • reponse: {errorcode: 0, mediaQuestions:[{...},{...}], userQuestions:[{...},{...}]}