Troca a senha do membro
curl --request POST \
--url https://memberkit.com.br/api/headless/v1/profile/change_password \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Memberkit-Headless-Key: <api-key>' \
--data '
{
"current_password": "<string>",
"password": "<string>",
"password_confirmation": "<string>"
}
'import requests
url = "https://memberkit.com.br/api/headless/v1/profile/change_password"
payload = {
"current_password": "<string>",
"password": "<string>",
"password_confirmation": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"X-Memberkit-Headless-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Memberkit-Headless-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
current_password: '<string>',
password: '<string>',
password_confirmation: '<string>'
})
};
fetch('https://memberkit.com.br/api/headless/v1/profile/change_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://memberkit.com.br/api/headless/v1/profile/change_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([
'current_password' => '<string>',
'password' => '<string>',
'password_confirmation' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Memberkit-Headless-Key: <api-key>"
],
]);
$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://memberkit.com.br/api/headless/v1/profile/change_password"
payload := strings.NewReader("{\n \"current_password\": \"<string>\",\n \"password\": \"<string>\",\n \"password_confirmation\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-Memberkit-Headless-Key", "<api-key>")
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://memberkit.com.br/api/headless/v1/profile/change_password")
.header("Authorization", "Bearer <token>")
.header("X-Memberkit-Headless-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"current_password\": \"<string>\",\n \"password\": \"<string>\",\n \"password_confirmation\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://memberkit.com.br/api/headless/v1/profile/change_password")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-Memberkit-Headless-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"current_password\": \"<string>\",\n \"password\": \"<string>\",\n \"password_confirmation\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "<string>"
}{
"code": "subscription_suspended",
"message": "<string>",
"request_id": "<string>",
"errors": {}
}{
"code": "subscription_suspended",
"message": "<string>",
"request_id": "<string>",
"errors": {}
}{
"code": "subscription_suspended",
"message": "<string>",
"request_id": "<string>",
"errors": {}
}{
"code": "subscription_suspended",
"message": "<string>",
"request_id": "<string>",
"errors": {}
}Perfil
Troca a senha do membro
Troca a senha do membro. A troca invalida o token usado na chamada e os de outros dispositivos, então guarde o access_token retornado. Se a resposta se perder, entre de novo com a nova senha; este envio não aceita Idempotency-Key.
POST
/
api
/
headless
/
v1
/
profile
/
change_password
Troca a senha do membro
curl --request POST \
--url https://memberkit.com.br/api/headless/v1/profile/change_password \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Memberkit-Headless-Key: <api-key>' \
--data '
{
"current_password": "<string>",
"password": "<string>",
"password_confirmation": "<string>"
}
'import requests
url = "https://memberkit.com.br/api/headless/v1/profile/change_password"
payload = {
"current_password": "<string>",
"password": "<string>",
"password_confirmation": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"X-Memberkit-Headless-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'X-Memberkit-Headless-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
current_password: '<string>',
password: '<string>',
password_confirmation: '<string>'
})
};
fetch('https://memberkit.com.br/api/headless/v1/profile/change_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://memberkit.com.br/api/headless/v1/profile/change_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([
'current_password' => '<string>',
'password' => '<string>',
'password_confirmation' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Memberkit-Headless-Key: <api-key>"
],
]);
$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://memberkit.com.br/api/headless/v1/profile/change_password"
payload := strings.NewReader("{\n \"current_password\": \"<string>\",\n \"password\": \"<string>\",\n \"password_confirmation\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-Memberkit-Headless-Key", "<api-key>")
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://memberkit.com.br/api/headless/v1/profile/change_password")
.header("Authorization", "Bearer <token>")
.header("X-Memberkit-Headless-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"current_password\": \"<string>\",\n \"password\": \"<string>\",\n \"password_confirmation\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://memberkit.com.br/api/headless/v1/profile/change_password")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-Memberkit-Headless-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"current_password\": \"<string>\",\n \"password\": \"<string>\",\n \"password_confirmation\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "<string>"
}{
"code": "subscription_suspended",
"message": "<string>",
"request_id": "<string>",
"errors": {}
}{
"code": "subscription_suspended",
"message": "<string>",
"request_id": "<string>",
"errors": {}
}{
"code": "subscription_suspended",
"message": "<string>",
"request_id": "<string>",
"errors": {}
}{
"code": "subscription_suspended",
"message": "<string>",
"request_id": "<string>",
"errors": {}
}Exige a senha atual. Todas as sessões do membro são encerradas, e a resposta traz um token novo em
access_token, que substitui o anterior neste dispositivo.Autorizações
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Chave headless da área de membros, em Configurações. É pública e vai em todas as requisições, inclusive nas que levam o token do membro.
Corpo
application/json
Resposta
Senha trocada
JWT enviado no cabeçalho Authorization das demais requisições.
Esta página foi útil?