Difference between revisions of "API:POST /login"
(→Sample Response) |
|||
Line 11: | Line 11: | ||
} | } | ||
− | = | + | = Response: Success = |
HTTP 200 | HTTP 200 | ||
{ | { | ||
− | "token": " | + | "result": true, |
+ | "token": "1:fd776c3a631eeae849688a618887546d" | ||
} | } | ||
+ | If the result is TRUE, then the login was a success. The token it returns should be sent on all future requests, using the <code>X-SoFurry-Token</code> HTTP header. | ||
+ | |||
+ | = Response: Failed Login = | ||
+ | |||
+ | HTTP 422 | ||
+ | { | ||
+ | "result": false, | ||
+ | "message": "Incorrect username or password" | ||
+ | } | ||
+ | |||
+ | You don't need to display that exact message in your client app. It will fail like this if the email address or password is incorrect, or if the user has not yet been activated. | ||
[[Category:API]] | [[Category:API]] |
Revision as of 12:42, 25 April 2016
Resource URL
https://api.sofurrybeta.com/login
Request
POST /login { "email": "bob@example.org", "password": "hunter2" }
Response: Success
HTTP 200 { "result": true, "token": "1:fd776c3a631eeae849688a618887546d" }
If the result is TRUE, then the login was a success. The token it returns should be sent on all future requests, using the X-SoFurry-Token
HTTP header.
Response: Failed Login
HTTP 422 { "result": false, "message": "Incorrect username or password" }
You don't need to display that exact message in your client app. It will fail like this if the email address or password is incorrect, or if the user has not yet been activated.