{"swagger":"2.0","info":{"description":"This is a simple API with various features I want. Built for personal use.","version":"1.0.0","title":"AB API","contact":{"email":"anishb0529@gmail.com"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"tags":[{"name":"screenshots","description":"deals with screenshot creation, retrieval etc <br /> same as an image store, but used to store screenshots"}],"paths":{"/screenshots/{name}":{"get":{"tags":["screenshots"],"summary":"retrieve a screenshot","operationId":"searchScreenshot","description":"By passing in the name of the screenshot, you can search for specific screenshots by name\n","produces":["application/json"],"parameters":[{"in":"path","name":"name","description":"the name of the screenshot","required":true,"type":"string"}],"responses":{"200":{"description":"search results matching criteria","schema":{"type":"object","required":["satus","state","result"],"properties":{"status":{"type":"integer","example":200},"state":{"type":"string","example":"ok"},"result":{"type":"object","$ref":"#/definitions/ScreenshotItem"}}}},"404":{"description":"screenshot not found","schema":{"$ref":"#/definitions/Screenshot404"}}}}},"/screenshots/all/{key}":{"get":{"tags":["screenshots"],"summary":"retrieves all screenshot","operationId":"searchAllScreenshots","description":"Gives an array of all screenshots in the database\n","produces":["application/json"],"parameters":[{"in":"path","name":"key","description":"the api key","required":true,"type":"string"}],"responses":{"200":{"description":"all screenshots","schema":{"type":"object","required":["status","state","result"],"properties":{"status":{"type":"integer","example":200},"state":{"type":"string","example":"ok"},"result":{"type":"array","items":{"$ref":"#/definitions/ScreenshotItem"}}}}},"404":{"description":"screenshot not found","schema":{"$ref":"#/definitions/Screenshot404"}}}}},"/screenshots":{"post":{"tags":["screenshots"],"summary":"creates a new screenshot","operationId":"createScreenshot","description":"adds a new screenshot to the database","produces":["application/json"],"consumes":["multipart/form-data"],"parameters":[{"name":"key","in":"formData","type":"string","description":"the api key"},{"name":"img","in":"formData","type":"file","description":"the image to send"},{"name":"name","in":"formData","type":"string","description":"the name of the screenshot"},{"name":"mime","in":"formData","type":"string","description":"the mime type of the image"},{"name":"timestamp","in":"formData","type":"string","description":"the timestamp, will be created if not provided"}],"responses":{"201":{"description":"screenshot has been created"},"401":{"description":"unauthorized key"}}}},"/screnshots/{key}/{name}":{"delete":{"tags":["screenshots"],"summary":"deletes a screenshot","operationId":"deleteScreenshot","description":"Deletes a screenshot with the given name\n","produces":["application/json"],"parameters":[{"in":"path","name":"key","description":"the api key","required":true,"type":"string"},{"in":"path","name":"name","description":"the name of the screenshot","required":true,"type":"string"}],"responses":{"200":{"description":"screenshot is deleted","schema":{"$ref":"#/definitions/ScreenshotDeleted200"}},"404":{"description":"screenshot not found","schema":{"$ref":"#/definitions/Screenshot404"}},"401":{"description":"unauthorized key"}}}}},"definitions":{"ScreenshotDeleted200":{"type":"object","required":["status","state","result"],"properties":{"status":{"type":"integer","example":200},"state":{"type":"string","example":"ok"},"result":{"type":"string","example":"Deleted screenshot eccentric-camel-510"}}},"Screenshot404":{"type":"object","required":["status","state","result"],"properties":{"status":{"type":"integer","example":404},"state":{"type":"string","example":"fail"},"result":{"type":"string","example":"error: could not find screenshot"}}},"ScreenshotItem":{"type":"object","required":["img","name","mime","timestamp"],"properties":{"img":{"type":"string","example":"Binary Image Here"},"name":{"type":"string","example":"cool-cat-600"},"mime":{"type":"string","example":"image/png"},"timestamp":{"type":"string","example":"2009-11-10 23:00:00 +0000 UTC m=+0.000000000"}}}}}