Skip to content

Instantly share code, notes, and snippets.

@paralin
Last active August 29, 2015 14:11
Show Gist options
  • Save paralin/e3ba0b3776b8fe86d407 to your computer and use it in GitHub Desktop.
Save paralin/e3ba0b3776b8fe86d407 to your computer and use it in GitHub Desktop.
Documentation v1 for the dotareplay api

Submissions

POST -> /api/submissions/create

To make a submission submit the following data (shown here in JSON). Please note that the contents of these fields are simply the value, not the min/max values. These are just there to show you the properties used to store the data in the database.

{
   "_id":           "5FkMTSAnEzBWipBsN",
   "status":        2,
   "show":          "fail",
   "uid":           "swag",
   "name":          "Test123",
   "description":   "This is a test",
   "matchid":        1097863094
}

GET -> /api/shows/:id

Will return the show definition or 404 if not found.

{
   "status":200,
   "data":{
      "_id":"fail",
      "name":"Fails of the Week",
      "thumbnail":"http://art.ngfiles.com/images/304000/304913_jazza_dotacinema-100-fails-episodes.jpg",
      "description":"A collection of the week's funniest fails with Reaves and Sunsfan.",
      "submissionsOpen":true
   },
   "error":null
}

Dealing with Errors

The return object will always look like this:

    {"error": "This is the error reason.", "status": 404, "data": {}}

The error field will have the error text. This could be null.

The status field will be the HTTP status.

The data will be an array, object, or null, depending on the API method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment