{"swagger":"2.0","info":{"description":"This is the API used by *a Face with a Brain*","version":"1.0.0","title":"a Face with a Brain API","contact":{"email":"davidsima@windowslive.com"},"license":{"name":"GNU AGPLv3","url":"https://choosealicense.com/licenses/agpl-3.0/"}},"host":"virtserver.swaggerhub.com","basePath":"/The24thDS/aFacewithaBrain/1.0.0","tags":[{"name":"developers","description":"Operations available to regular developers"},{"name":"admins","description":"Operations available to admins"}],"schemes":["https"],"paths":{"/":{"get":{"tags":["developers"],"summary":"readme.html","description":"Return the API documentation\n","operationId":"root","produces":["text/html"],"parameters":[],"responses":{"200":{"description":"server is up and the documentation is available"}}}},"/clarifai":{"post":{"tags":["developers"],"summary":"checks the image against Clarifai' Face Model","description":"It will send the image to the Clarifai servers if the user is logged in returning the bounding boxes of the faces and the current ammount of entries","operationId":"checkImage","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"image","description":"image url to check","required":false,"schema":{"$ref":"#/definitions/Image"}}],"responses":{"200":{"description":"The was image valid, the user was logged in and the Clarifai API was available","schema":{"type":"object","properties":{"regions":{"type":"string","example":{"The server returns the regions object here":"Check Clarifai API for further information"}},"entries":{"type":"string","example":"3"}}}},"400":{"description":"The image doesn't contain any faces or the user is not logged in"}}}},"/register":{"post":{"tags":["developers"],"summary":"registers the user","description":"It will register the user if the provided data is valid","operationId":"registerUser","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"data","description":"data provided by the user when submitting the registration form","required":false,"schema":{"$ref":"#/definitions/Register"}}],"responses":{"200":{"description":"Successful registration","schema":{"type":"object","properties":{"status":{"type":"string","example":"Success"},"message":{"type":"string","example":"You have successfully registered \uD83D\uDC4D"}}}},"400":{"description":"registration has failed because: \n  • the email is already registered \n  • the email is not valid\n  • the password is not valid\n  • the username is not valid\n","schema":{"type":"object","properties":{"status":{"type":"string","example":"Error"},"message":{"type":"string","example":"Different message depending on the failure reason"}}}}}}},"/signin":{"post":{"tags":["developers"],"summary":"logs in the user","description":"It will log in the user if the provided data is valid","operationId":"loginUser","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"data","description":"data provided by the user when submitting the login form","required":false,"schema":{"$ref":"#/definitions/Login"}}],"responses":{"200":{"description":"Successful login","schema":{"type":"object","properties":{"status":{"type":"string","example":"Success"},"message":{"type":"string","example":"You have successfully logged in \uD83D\uDC4D"}}}},"400":{"description":"credentials don't match\n","schema":{"type":"object","properties":{"status":{"type":"string","example":"Error"},"message":{"type":"string","example":"\uD83E\uDD1A Wrong credentials \uD83D\uDED1"}}}}}}},"/entries":{"post":{"tags":["developers"],"summary":"returns user's current number of entries","description":"It will return the entries number if the email provided is logged in","operationId":"userEntries","consumes":["application/json"],"produces":["application/json"],"parameters":[{"in":"body","name":"email","description":"users's email","required":false,"schema":{"$ref":"#/definitions/email"}}],"responses":{"200":{"description":"user is logged in","schema":{"type":"object","properties":{"status":{"type":"string","example":"Success"},"entries":{"type":"string","example":"3"}}}}}}},"/log":{"post":{"tags":["admins"],"summary":"returns errors' log file","description":"It will return the file containing the server errors if the provided\npassword is an admin password \n","operationId":"errors","consumes":["application/json"],"produces":["text/plain"],"parameters":[{"in":"body","name":"password","description":"this is the admin's password","required":false,"schema":{"$ref":"#/definitions/password"}}],"responses":{"200":{"description":"The provided password was an admin password"}}}}},"definitions":{"Image":{"required":["email","image"],"properties":{"email":{"type":"string","format":"email","example":"someemail@domain.com"},"image":{"type":"string","format":"url","example":"https://somesite.com/some/path/to/the/image.jpg"}}},"Register":{"required":["email","password","username"],"properties":{"username":{"type":"string","format":"username","example":"SomeUsername12"},"email":{"type":"string","format":"url","example":"someemail@domain.com"},"password":{"type":"string","format":"password","example":"VeryStr0ng.Password"}}},"Login":{"required":["email","password"],"properties":{"email":{"type":"string","format":"url","example":"someemail@domain.com"},"password":{"type":"string","format":"password","example":"VeryStr0ng.Password"}}},"email":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email","example":"someemail@domain.com"}}},"password":{"type":"object","required":["password"],"properties":{"password":{"type":"string","format":"adminPassword","example":"Y0urVery$tr0ngAdminPa$$w0rd"}}}}}