Update password of logged in user
Changes the calling user’s password. Requires the current password in the body for re-authentication.
POST
/
me
/
password
Update password of logged in user
curl --request POST \
--url https://stage-api.findity.com/api/v1/expense/me/password \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"oldPassword": "oldNotSoFancyPassword321?",
"newPassword": "newFancyPassword123!"
}
'import requests
url = "https://stage-api.findity.com/api/v1/expense/me/password"
payload = {
"oldPassword": "oldNotSoFancyPassword321?",
"newPassword": "newFancyPassword123!"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({oldPassword: 'oldNotSoFancyPassword321?', newPassword: 'newFancyPassword123!'})
};
fetch('https://stage-api.findity.com/api/v1/expense/me/password', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://stage-api.findity.com/api/v1/expense/me/password",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'oldPassword' => 'oldNotSoFancyPassword321?',
'newPassword' => 'newFancyPassword123!'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://stage-api.findity.com/api/v1/expense/me/password"
payload := strings.NewReader("{\n \"oldPassword\": \"oldNotSoFancyPassword321?\",\n \"newPassword\": \"newFancyPassword123!\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://stage-api.findity.com/api/v1/expense/me/password")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"oldPassword\": \"oldNotSoFancyPassword321?\",\n \"newPassword\": \"newFancyPassword123!\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://stage-api.findity.com/api/v1/expense/me/password")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"oldPassword\": \"oldNotSoFancyPassword321?\",\n \"newPassword\": \"newFancyPassword123!\"\n}"
response = http.request(request)
puts response.read_body{
"expiresIn": 3600,
"accessToken": "eae3a3a225368f247b419e2318dec3eefa19dbb33023fea7987bc2a893e90c7ec5473ca0c50b17265fb23adf0a23ff34c105bb33f13c88ddbbd13bae82d7cb15",
"refreshToken": "59fec24de9f49918f50a315f61e114d82925e30d1b62ef90d1d9ed598a08c5f48c9d82572d35de38879cb6b03ca99e2261d17b9f579e6f598662f3aad326976d"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
⌘I
Update password of logged in user
curl --request POST \
--url https://stage-api.findity.com/api/v1/expense/me/password \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"oldPassword": "oldNotSoFancyPassword321?",
"newPassword": "newFancyPassword123!"
}
'import requests
url = "https://stage-api.findity.com/api/v1/expense/me/password"
payload = {
"oldPassword": "oldNotSoFancyPassword321?",
"newPassword": "newFancyPassword123!"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({oldPassword: 'oldNotSoFancyPassword321?', newPassword: 'newFancyPassword123!'})
};
fetch('https://stage-api.findity.com/api/v1/expense/me/password', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://stage-api.findity.com/api/v1/expense/me/password",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'oldPassword' => 'oldNotSoFancyPassword321?',
'newPassword' => 'newFancyPassword123!'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://stage-api.findity.com/api/v1/expense/me/password"
payload := strings.NewReader("{\n \"oldPassword\": \"oldNotSoFancyPassword321?\",\n \"newPassword\": \"newFancyPassword123!\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://stage-api.findity.com/api/v1/expense/me/password")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"oldPassword\": \"oldNotSoFancyPassword321?\",\n \"newPassword\": \"newFancyPassword123!\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://stage-api.findity.com/api/v1/expense/me/password")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"oldPassword\": \"oldNotSoFancyPassword321?\",\n \"newPassword\": \"newFancyPassword123!\"\n}"
response = http.request(request)
puts response.read_body{
"expiresIn": 3600,
"accessToken": "eae3a3a225368f247b419e2318dec3eefa19dbb33023fea7987bc2a893e90c7ec5473ca0c50b17265fb23adf0a23ff34c105bb33f13c88ddbbd13bae82d7cb15",
"refreshToken": "59fec24de9f49918f50a315f61e114d82925e30d1b62ef90d1d9ed598a08c5f48c9d82572d35de38879cb6b03ca99e2261d17b9f579e6f598662f3aad326976d"
}
