Registrar prestador (usuario CAMELLOS + perfil Camello)
curl --request POST \
--url http://localhost:3000/api/register/camello \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"password": "<string>",
"confirmPassword": "<string>",
"acceptTerms": true,
"city": "<string>",
"trades": [
"<string>"
],
"documentId": "<string>",
"neighborhood": "<string>",
"professionalCard": "<string>",
"serviceIds": [
"<string>"
],
"description": "<string>"
}
'import requests
url = "http://localhost:3000/api/register/camello"
payload = {
"name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"password": "<string>",
"confirmPassword": "<string>",
"acceptTerms": True,
"city": "<string>",
"trades": ["<string>"],
"documentId": "<string>",
"neighborhood": "<string>",
"professionalCard": "<string>",
"serviceIds": ["<string>"],
"description": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
password: '<string>',
confirmPassword: '<string>',
acceptTerms: true,
city: '<string>',
trades: ['<string>'],
documentId: '<string>',
neighborhood: '<string>',
professionalCard: '<string>',
serviceIds: ['<string>'],
description: '<string>'
})
};
fetch('http://localhost:3000/api/register/camello', 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/register/camello",
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([
'name' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>',
'password' => '<string>',
'confirmPassword' => '<string>',
'acceptTerms' => true,
'city' => '<string>',
'trades' => [
'<string>'
],
'documentId' => '<string>',
'neighborhood' => '<string>',
'professionalCard' => '<string>',
'serviceIds' => [
'<string>'
],
'description' => '<string>'
]),
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/register/camello"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"password\": \"<string>\",\n \"confirmPassword\": \"<string>\",\n \"acceptTerms\": true,\n \"city\": \"<string>\",\n \"trades\": [\n \"<string>\"\n ],\n \"documentId\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"professionalCard\": \"<string>\",\n \"serviceIds\": [\n \"<string>\"\n ],\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://localhost:3000/api/register/camello")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"password\": \"<string>\",\n \"confirmPassword\": \"<string>\",\n \"acceptTerms\": true,\n \"city\": \"<string>\",\n \"trades\": [\n \"<string>\"\n ],\n \"documentId\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"professionalCard\": \"<string>\",\n \"serviceIds\": [\n \"<string>\"\n ],\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/register/camello")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"password\": \"<string>\",\n \"confirmPassword\": \"<string>\",\n \"acceptTerms\": true,\n \"city\": \"<string>\",\n \"trades\": [\n \"<string>\"\n ],\n \"documentId\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"professionalCard\": \"<string>\",\n \"serviceIds\": [\n \"<string>\"\n ],\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"user": {
"id": "<string>",
"email": "jsmith@example.com",
"role": "ADMIN",
"createdAt": "2023-11-07T05:31:56Z",
"name": "<string>"
},
"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": "Sin permisos de administrador",
"issues": {},
"detail": "<string>"
}{
"error": "Sin permisos de administrador",
"issues": {},
"detail": "<string>"
}Auth
Registrar prestador (usuario CAMELLOS + perfil Camello)
Crea en una transaccion el usuario con rol CAMELLOS y su perfil de camello en estado PENDIENTE. Acepta multipart/form-data cuando se envia foto (campo file); en ese caso trades y serviceIds viajan como cadenas JSON.
POST
/
api
/
register
/
camello
Registrar prestador (usuario CAMELLOS + perfil Camello)
curl --request POST \
--url http://localhost:3000/api/register/camello \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"password": "<string>",
"confirmPassword": "<string>",
"acceptTerms": true,
"city": "<string>",
"trades": [
"<string>"
],
"documentId": "<string>",
"neighborhood": "<string>",
"professionalCard": "<string>",
"serviceIds": [
"<string>"
],
"description": "<string>"
}
'import requests
url = "http://localhost:3000/api/register/camello"
payload = {
"name": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"password": "<string>",
"confirmPassword": "<string>",
"acceptTerms": True,
"city": "<string>",
"trades": ["<string>"],
"documentId": "<string>",
"neighborhood": "<string>",
"professionalCard": "<string>",
"serviceIds": ["<string>"],
"description": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
password: '<string>',
confirmPassword: '<string>',
acceptTerms: true,
city: '<string>',
trades: ['<string>'],
documentId: '<string>',
neighborhood: '<string>',
professionalCard: '<string>',
serviceIds: ['<string>'],
description: '<string>'
})
};
fetch('http://localhost:3000/api/register/camello', 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/register/camello",
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([
'name' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>',
'password' => '<string>',
'confirmPassword' => '<string>',
'acceptTerms' => true,
'city' => '<string>',
'trades' => [
'<string>'
],
'documentId' => '<string>',
'neighborhood' => '<string>',
'professionalCard' => '<string>',
'serviceIds' => [
'<string>'
],
'description' => '<string>'
]),
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/register/camello"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"password\": \"<string>\",\n \"confirmPassword\": \"<string>\",\n \"acceptTerms\": true,\n \"city\": \"<string>\",\n \"trades\": [\n \"<string>\"\n ],\n \"documentId\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"professionalCard\": \"<string>\",\n \"serviceIds\": [\n \"<string>\"\n ],\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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("http://localhost:3000/api/register/camello")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"password\": \"<string>\",\n \"confirmPassword\": \"<string>\",\n \"acceptTerms\": true,\n \"city\": \"<string>\",\n \"trades\": [\n \"<string>\"\n ],\n \"documentId\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"professionalCard\": \"<string>\",\n \"serviceIds\": [\n \"<string>\"\n ],\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3000/api/register/camello")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"password\": \"<string>\",\n \"confirmPassword\": \"<string>\",\n \"acceptTerms\": true,\n \"city\": \"<string>\",\n \"trades\": [\n \"<string>\"\n ],\n \"documentId\": \"<string>\",\n \"neighborhood\": \"<string>\",\n \"professionalCard\": \"<string>\",\n \"serviceIds\": [\n \"<string>\"\n ],\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"user": {
"id": "<string>",
"email": "jsmith@example.com",
"role": "ADMIN",
"createdAt": "2023-11-07T05:31:56Z",
"name": "<string>"
},
"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": "Sin permisos de administrador",
"issues": {},
"detail": "<string>"
}{
"error": "Sin permisos de administrador",
"issues": {},
"detail": "<string>"
}Body
application/jsonmultipart/form-data
Required string length:
2 - 120Required string length:
7 - 32Required string length:
8 - 128Available options:
true Required string length:
2 - 120Required array length:
1 - 20 elementsMaximum string length:
32Maximum string length:
120Maximum string length:
120Maximum array length:
50Maximum string length:
5000