Recriar Usuário
curl --request PATCH \
--url https://mcapi.knewcms.com:2087/lines/recreate/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"password": "<string>"
}
'import requests
url = "https://mcapi.knewcms.com:2087/lines/recreate/{id}"
payload = { "password": "<string>" }
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({password: '<string>'})
};
fetch('https://mcapi.knewcms.com:2087/lines/recreate/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "2087",
CURLOPT_URL => "https://mcapi.knewcms.com:2087/lines/recreate/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'password' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://mcapi.knewcms.com:2087/lines/recreate/{id}"
payload := strings.NewReader("{\n \"password\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.patch("https://mcapi.knewcms.com:2087/lines/recreate/{id}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"password\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mcapi.knewcms.com:2087/lines/recreate/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"password\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"message": "Usuário recriado com sucesso",
"response": {
"id": 1201,
"username": "usuario_exemplo",
"password": "nova_senha_456",
"updatedAt": "2025-01-22T10:30:00.000Z"
}
}
Clientes
Recriar Usuário
Este endpoint permite recriar um usuário alterando sua senha na plataforma.
PATCH
/
lines
/
recreate
/
{id}
Recriar Usuário
curl --request PATCH \
--url https://mcapi.knewcms.com:2087/lines/recreate/{id} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"password": "<string>"
}
'import requests
url = "https://mcapi.knewcms.com:2087/lines/recreate/{id}"
payload = { "password": "<string>" }
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({password: '<string>'})
};
fetch('https://mcapi.knewcms.com:2087/lines/recreate/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "2087",
CURLOPT_URL => "https://mcapi.knewcms.com:2087/lines/recreate/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'password' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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://mcapi.knewcms.com:2087/lines/recreate/{id}"
payload := strings.NewReader("{\n \"password\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.patch("https://mcapi.knewcms.com:2087/lines/recreate/{id}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"password\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mcapi.knewcms.com:2087/lines/recreate/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"password\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": 200,
"message": "Usuário recriado com sucesso",
"response": {
"id": 1201,
"username": "usuario_exemplo",
"password": "nova_senha_456",
"updatedAt": "2025-01-22T10:30:00.000Z"
}
}
Como utilizar este endpoint?
Esse endpoint permite recriar um usuário alterando sua senha atual para uma nova senha.Headers obrigatórios
string
required
O token de autenticação no formato Bearer é obrigatório para acessar este
endpoint.
Parâmetros da URL
string
required
ID do usuário a ser recriado. Esse parâmetro deve ser informado diretamente na URL.
Parâmetros do corpo da requisição (Payload)
string
required
Senha atual do usuário. Campo obrigatório.
Exemplo de Requisição
PATCH https://mcapi.knewcms.com:2087/lines/recreate/1201
Headers:
{
"Authorization": "Bearer seu_token_aqui",
"Content-Type": "application/json"
}
Payload:
{
"password": "senha_atual_123",
"newPassword": "nova_senha_456"
}
Resposta
number
Indica o código HTTP da resposta. Esperado: 200 (OK).
string
Mensagem de confirmação da operação.
object
Exemplo de Resposta
{
"status": 200,
"message": "Usuário recriado com sucesso",
"response": {
"id": 1201,
"username": "usuario_exemplo",
"password": "nova_senha_456",
"updatedAt": "2025-01-22T10:30:00.000Z"
}
}
⌘I