REQUEST

This API is used to reset the password for the user. You can call this API without the header.

The structure of API as below:

POST/auth/reset_email

BODY

You have to put the name of the user into the body of API.

See example as below:

{
  "name": "string"
}

JSON RESPONSE

There is message return as JSON format. It will return the result of API and the related information as well.

If you provide correct name, the server will return code 200 with a message as below:

{
   "success": true
}

 

If you provide the incorrect name, the server will check and see there is no user in system then return code 404 with a message as below:

{
   "error_type": "not_found_error",
   "success": false
}

 

If you don't input anything in the body or missing any fields, It will return code 400 and message as below:

{
   "error_type": "validation_error",
   "success": false,
   "errors": [   {
      "name": ["Missing data for required field."]
   }]
}

On this page:

EXAMPLE

We will know more about the API through the example below:

Request

I will call API to reset password as below:

curl \
-X POST -d "{ \"name\": \"Dang\"}" \
"http://88.99.175.131:8000/v1/auth/reset_email"
 

Response

{
	"success": true
}
  • No labels