User Password
Change password and reset password.
post
https://<domain>/<api prefix>/<version>/user/profile/change-password/
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;
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. |
post
https://<domain>/<api prefix>/<version>/user/forgot-password/
Node
ar request = require('request');
var options = {
'method': 'POST',
'url': 'https://<domain>/<api prefix>/<version>/user/forgot-password/',
'headers': {
'apikey': '<apikey>',
},
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>"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
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. |
post
https://<domain>/<api prefix>/<version>/user/forgot-password-submit/
Node
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://<domain>/<api prefix>/<version>/user/forgot-password-submit/',
'headers': {
'apikey': '<apikey>'
},
formData: {
'token': '<token_from_link>',
'new_password': '<new_password>',
'user': '<user_key_from_link>'
}
};
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('user' => '<user_key_from_link>','token' => '<token>','new_password' => '<new_password>'),
CURLOPT_HTTPHEADER => array(
"apikey: <apikey>"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
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. |
400 | Validation Error | user | This field is required. |
Last modified 1yr ago