Difference between revisions of "API:POST /activate"

From SoFurry
Jump to: navigation, search
(Request)
(Response: Failed Login)
Line 20: Line 20:
 
If the result is TRUE, then the activation was a success. The corresponding user will now be able to log in with their username and password.
 
If the result is TRUE, then the activation was a success. The corresponding user will now be able to log in with their username and password.
  
= Response: Failed Login =
+
= Response: Failed Validation =
 +
 
 +
Examples of the failure response messages you'll see.
 +
 
 +
HTTP 422
 +
{
 +
  "activate_token": [
 +
    "The activate token field is required."
 +
  ]
 +
}
 +
 
 +
HTTP 422
 +
{
 +
  "activate_token": [
 +
    "The activate token must be 8 characters."
 +
  ]
 +
}
  
 
  HTTP 422
 
  HTTP 422
 
  {
 
  {
   "result": false,
+
   "activate_token": [
  "message": "Incorrect username or password"
+
    "The selected activate token is invalid."
 +
  ]
 
  }
 
  }
  
  
 
[[Category:API]]
 
[[Category:API]]

Revision as of 12:50, 25 April 2016

Resource URL

https://api.sofurrybeta.com/activate

Request

POST /activate
{
  "activate_token": "abcd1234" # Required, 8 characters
}

Response: Success

HTTP 200
{
  "result": true,
  "token": "Activated! Go ahead and log in."
}

If the result is TRUE, then the activation was a success. The corresponding user will now be able to log in with their username and password.

Response: Failed Validation

Examples of the failure response messages you'll see.

HTTP 422
{
  "activate_token": [
    "The activate token field is required."
  ]
}
HTTP 422
{
  "activate_token": [
    "The activate token must be 8 characters."
  ]
}
HTTP 422
{
  "activate_token": [
    "The selected activate token is invalid."
  ]
}