Actualizar camello (JSON o multipart)
curl --request PATCH \
--url http://localhost:3000/api/admin/camellos/{id} \
--header 'Content-Type: application/json' \
--cookie next-auth.session-token= \
--data '
{
"name": "<string>",
"documentId": "<string>",
"phone": "<string>",
"trades": [
"<string>"
],
"serviceIds": [
"<string>"
],
"city": "<string>",
"neighborhood": "<string>",
"professionalCard": "<string>",
"premium": true,
"notes": "<string>"
}
'import requests
url = "http://localhost:3000/api/admin/camellos/{id}"
payload = {
"name": "<string>",
"documentId": "<string>",
"phone": "<string>",
"trades": ["<string>"],
"serviceIds": ["<string>"],
"city": "<string>",
"neighborhood": "<string>",
"professionalCard": "<string>",
"premium": True,
"notes": "<string>"
}
headers = {
"cookie": "next-auth.session-token=",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {cookie: 'next-auth.session-token=', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
documentId: '<string>',
phone: '<string>',
trades: ['<string>'],
serviceIds: ['<string>'],
city: '<string>',
neighborhood: '<string>',
professionalCard: '<string>',
premium: true,
notes: '<string>'
})
};
fetch('http://localhost:3000/api/admin/camellos/{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 => "3000",
CURLOPT_URL => "http://localhost:3000/api/admin/camellos/{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([
'name' => '<string>',
'documentId' => '<string>',
'phone' => '<string>',
'trades' => [
'<string>'
],
'serviceIds' => [
'<string>'
],
'city' => '<string>',
'neighborhood' => '<string>',
'professionalCard' => '<string>',
'premium' => true,
'notes' => '<string>'
]),
CURLOPT_COOKIE => "next-auth.session-token=",
CURLOPT_HTTPHEADER => [
"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 := "http://localhost:3000/api/admin/camellos/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"documentId\": \"<string>\",\n \"phone\": \"<string>\",\n \"trades\": [\n \"<string>\"\n ],\n \"serviceIds\": [\n \"<string>\"\n ],\n \"city\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"professionalCard\": \"<string>\",\n \"premium\": true,\n \"notes\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("cookie", "next-auth.session-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.patch("http://localhost:3000/api/admin/camellos/{id}")
.header("cookie", "next-auth.session-token=")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"documentId\": \"<string>\",\n \"phone\": \"<string>\",\n \"trades\": [\n \"<string>\"\n ],\n \"serviceIds\": [\n \"<string>\"\n ],\n \"city\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"professionalCard\": \"<string>\",\n \"premium\": true,\n \"notes\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/admin/camellos/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["cookie"] = 'next-auth.session-token='
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"documentId\": \"<string>\",\n \"phone\": \"<string>\",\n \"trades\": [\n \"<string>\"\n ],\n \"serviceIds\": [\n \"<string>\"\n ],\n \"city\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"professionalCard\": \"<string>\",\n \"premium\": true,\n \"notes\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"camello": {
"id": "<string>",
"name": "<string>",
"trades": [
"<string>"
],
"status": "ACTIVO",
"premium": true,
"services": [
{
"id": "<string>",
"name": "<string>",
"slug": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"documentId": "<string>",
"phone": "<string>",
"city": "<string>",
"neighborhood": "<string>",
"professionalCard": "<string>",
"photo": "/uploads/camellos/clx....jpg",
"notes": "<string>",
"description": "<string>"
}
}{
"error": "Sin permisos de administrador",
"issues": {},
"detail": "<string>"
}{
"error": "No autenticado"
}{
"error": "Sin permisos de administrador"
}{
"error": "Sin permisos de administrador",
"issues": {},
"detail": "<string>"
}{
"error": "Sin permisos de administrador",
"issues": {},
"detail": "<string>"
}Admin Camellos
Actualizar camello (JSON o multipart)
PATCH
/
api
/
admin
/
camellos
/
{id}
Actualizar camello (JSON o multipart)
curl --request PATCH \
--url http://localhost:3000/api/admin/camellos/{id} \
--header 'Content-Type: application/json' \
--cookie next-auth.session-token= \
--data '
{
"name": "<string>",
"documentId": "<string>",
"phone": "<string>",
"trades": [
"<string>"
],
"serviceIds": [
"<string>"
],
"city": "<string>",
"neighborhood": "<string>",
"professionalCard": "<string>",
"premium": true,
"notes": "<string>"
}
'import requests
url = "http://localhost:3000/api/admin/camellos/{id}"
payload = {
"name": "<string>",
"documentId": "<string>",
"phone": "<string>",
"trades": ["<string>"],
"serviceIds": ["<string>"],
"city": "<string>",
"neighborhood": "<string>",
"professionalCard": "<string>",
"premium": True,
"notes": "<string>"
}
headers = {
"cookie": "next-auth.session-token=",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {cookie: 'next-auth.session-token=', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
documentId: '<string>',
phone: '<string>',
trades: ['<string>'],
serviceIds: ['<string>'],
city: '<string>',
neighborhood: '<string>',
professionalCard: '<string>',
premium: true,
notes: '<string>'
})
};
fetch('http://localhost:3000/api/admin/camellos/{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 => "3000",
CURLOPT_URL => "http://localhost:3000/api/admin/camellos/{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([
'name' => '<string>',
'documentId' => '<string>',
'phone' => '<string>',
'trades' => [
'<string>'
],
'serviceIds' => [
'<string>'
],
'city' => '<string>',
'neighborhood' => '<string>',
'professionalCard' => '<string>',
'premium' => true,
'notes' => '<string>'
]),
CURLOPT_COOKIE => "next-auth.session-token=",
CURLOPT_HTTPHEADER => [
"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 := "http://localhost:3000/api/admin/camellos/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"documentId\": \"<string>\",\n \"phone\": \"<string>\",\n \"trades\": [\n \"<string>\"\n ],\n \"serviceIds\": [\n \"<string>\"\n ],\n \"city\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"professionalCard\": \"<string>\",\n \"premium\": true,\n \"notes\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("cookie", "next-auth.session-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.patch("http://localhost:3000/api/admin/camellos/{id}")
.header("cookie", "next-auth.session-token=")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"documentId\": \"<string>\",\n \"phone\": \"<string>\",\n \"trades\": [\n \"<string>\"\n ],\n \"serviceIds\": [\n \"<string>\"\n ],\n \"city\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"professionalCard\": \"<string>\",\n \"premium\": true,\n \"notes\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/admin/camellos/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["cookie"] = 'next-auth.session-token='
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"documentId\": \"<string>\",\n \"phone\": \"<string>\",\n \"trades\": [\n \"<string>\"\n ],\n \"serviceIds\": [\n \"<string>\"\n ],\n \"city\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"professionalCard\": \"<string>\",\n \"premium\": true,\n \"notes\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"camello": {
"id": "<string>",
"name": "<string>",
"trades": [
"<string>"
],
"status": "ACTIVO",
"premium": true,
"services": [
{
"id": "<string>",
"name": "<string>",
"slug": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"documentId": "<string>",
"phone": "<string>",
"city": "<string>",
"neighborhood": "<string>",
"professionalCard": "<string>",
"photo": "/uploads/camellos/clx....jpg",
"notes": "<string>",
"description": "<string>"
}
}{
"error": "Sin permisos de administrador",
"issues": {},
"detail": "<string>"
}{
"error": "No autenticado"
}{
"error": "Sin permisos de administrador"
}{
"error": "Sin permisos de administrador",
"issues": {},
"detail": "<string>"
}{
"error": "Sin permisos de administrador",
"issues": {},
"detail": "<string>"
}Authorizations
Path Parameters
Body
application/jsonmultipart/form-data
Required string length:
2 - 160Required array length:
1 - 20 elementsSi se envia, reemplaza los servicios vinculados
Maximum array length:
50Available options:
ACTIVO, INACTIVO, PENDIENTE Maximum string length:
5000Response
Camello actualizado
Show child attributes
Show child attributes