User Password

Change password and reset password.

Change password

post
​

β€Žhttps://<domain>/<api prefix>/<version>/user/profile/change-password/
This API endpoint is for changing user password
Request
Response
Request
Headers
apikey
required
string
apikey
Authorization
required
string
Bearer access-token
Body Parameters
old_password
required
string
old password
new_password
required
string
new password
confirm_password
required
string
confirm password
Response
200: OK
HTTP/1.1 200 OK
Content-Type: application/json
​
Body:
{
"status_code": 200,
"errors": {},
"data": {}
}

Sample code

Node

var request = require('request');
var options = {
'method': 'POST',
'url': 'https://<domain>/<api prefix>/<version>/user/profile/change-password/',
'headers': {
'apikey': '<apikey>',
'Authorization': 'Bearer <access-token>',
},
formData: {
'old_password': '<old_password>',
'new_password': '<new_password>',
'confirm_password': '<confirm_password>',
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
​

PHP

<?php
​
$curl = curl_init();
​
curl_setopt_array($curl, array(
CURLOPT_URL => "https://<domain>/<api prefix>/<version>/user/profile/change-password/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => array('old_password' => '<old_password>','new_password' => '<new_password>','confirm_password' => '<confirm_password>'),
CURLOPT_HTTPHEADER => array(
"apikey: <apikey>",
"Authorization: Bearer <access-token>"
),
));
​
$response = curl_exec($curl);
​
curl_close($curl);
echo $response;

Error Responses

Status Code

Error Type

Field

Description

401

Authentication Error

​

Your old password was entered incorrectly. Please enter it again.

400

Validation Error

confirm_password

The two password fields didn't match.

400

Validation Error

password

Your password can't be too similar to your other personal information.

Your password must contain at least 8 characters.

Your password can't be a commonly used password.

Your password can't be entirely numeric.

Your password must contain at least one capital letter, small letter, number and special character.

Forgot password request

post
​

β€Žhttps://<domain>/<api prefix>/<version>/user/forgot-password/
This API endpoint is to reset the user password. User can request with the registered email or username. A verification token will send to the user's email. This token and a new password can send to the forget password submit API endpoint to change the current password.
Request
Response
Request
Headers
apikey
required
string
apikey
Authorization
required
string
Bearer access-token
Body Parameters
email
required
string
email or username
Response
200: OK
HTTP/1.1 200 OK
Content-Type: application/json
​
Body:
{
"status_code": 200,
"errors": {},
"data": {}
}

Sample code

Node

ar request = require('request');
var options = {
'method': 'POST',
'url': 'https://<domain>/<api prefix>/<version>/user/forgot-password/',
'headers': {
'apikey': '<apikey>',
'Authorization': 'Bearer <access-token>',
},
formData: {
'email': '<email or username>'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});

PHP

<?php
​
$curl = curl_init();
​
curl_setopt_array($curl, array(
CURLOPT_URL => "https://<domain>/<api prefix>/<version>/user/forgot-password/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => array('email' => '<email or username>'),
CURLOPT_HTTPHEADER => array(
"apikey: <apikey>",
"Authorization: Bearer <access-token>"
),
));
​
$response = curl_exec($curl);
​
curl_close($curl);
echo $response;

Error Responses

Status Code

Error Type

Description

401

Authentication Error

There is multiple users are registered with the specified E-Mail address.Please enter the username

401

Authentication Error

This username or email does not exist in the system.

Forgot password submit

post
​

β€Žhttps://<domain>/<api prefix>/<version>/user/forgot-password-submit/β€Žβ€Ž
This endpoint is to reset the user password. User will get a link with token and user key in an email after success response from forgot password request API endpoint. Once use the link to change the password else send the token, user key, and a new password to this API endpoint to change the current user password.
Request
Response
Request
Headers
apikey
required
string
apikey
Authorization
required
string
Bearer access-token
Body Parameters
user
required
string
user key
token
required
string
token
new_password
required
string
new password
Response
200: OK
HTTP/1.1 200 OK
Content-Type: application/json
​
Body:
{
"status_code": 200,
"errors": {},
"data": {}
}

Sample code

Node

var request = require('request');
var options = {
'method': 'POST',
'url': 'https://<domain>/<api prefix>/<version>/user/forgot-password-submit/',
'headers': {
'apikey': '<apikey>',
'Authorization': 'Bearer <access-token>',
},
formData: {
'token': '<token>',
'new_password': '<new_password>',
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});

PHP

<?php
​
$curl = curl_init();
​
curl_setopt_array($curl, array(
CURLOPT_URL => "https://<domain>/<api prefix>/<version>/user/forgot-password-submit/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => array('token' => '<token>','new_password' => '<new_password>'),
CURLOPT_HTTPHEADER => array(
"apikey: <apikey>",
"Authorization: Bearer <access-token>"
),
));
​
$response = curl_exec($curl);
​
curl_close($curl);
echo $response;

Error Responses

Status Code

Error Type

Field

Description

400

Validation Error

token

The token is invalid. Enter the correct token that send to your email.

400

Validation Error

password

Your password can't be too similar to your other personal information.

Your password must contain at least 8 characters.

Your password can't be a commonly used password.

Your password can't be entirely numeric.

Your password must contain at least one capital letter, small letter, number and special character.