Campos de inscrição
Atualizar campo de inscrição
PATCH
/
events
/
{event}
/
registration-fields
/
{field}
Atualizar campo de inscrição
curl --request PATCH \
--url http://localhost/api/v1/events/{event}/registration-fields/{field} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>",
"key": "<string>",
"validation_rules": [
"<string>"
],
"help_text": "<string>",
"is_required": true,
"show_only_with_kit": true,
"is_active": true,
"sort_order": 1,
"options": [
{
"value": "<string>",
"label": "<string>"
}
]
}
'import requests
url = "http://localhost/api/v1/events/{event}/registration-fields/{field}"
payload = {
"label": "<string>",
"key": "<string>",
"validation_rules": ["<string>"],
"help_text": "<string>",
"is_required": True,
"show_only_with_kit": True,
"is_active": True,
"sort_order": 1,
"options": [
{
"value": "<string>",
"label": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: '<string>',
key: '<string>',
validation_rules: ['<string>'],
help_text: '<string>',
is_required: true,
show_only_with_kit: true,
is_active: true,
sort_order: 1,
options: [{value: '<string>', label: '<string>'}]
})
};
fetch('http://localhost/api/v1/events/{event}/registration-fields/{field}', 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 => "http://localhost/api/v1/events/{event}/registration-fields/{field}",
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([
'label' => '<string>',
'key' => '<string>',
'validation_rules' => [
'<string>'
],
'help_text' => '<string>',
'is_required' => true,
'show_only_with_kit' => true,
'is_active' => true,
'sort_order' => 1,
'options' => [
[
'value' => '<string>',
'label' => '<string>'
]
]
]),
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 := "http://localhost/api/v1/events/{event}/registration-fields/{field}"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"key\": \"<string>\",\n \"validation_rules\": [\n \"<string>\"\n ],\n \"help_text\": \"<string>\",\n \"is_required\": true,\n \"show_only_with_kit\": true,\n \"is_active\": true,\n \"sort_order\": 1,\n \"options\": [\n {\n \"value\": \"<string>\",\n \"label\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("http://localhost/api/v1/events/{event}/registration-fields/{field}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"key\": \"<string>\",\n \"validation_rules\": [\n \"<string>\"\n ],\n \"help_text\": \"<string>\",\n \"is_required\": true,\n \"show_only_with_kit\": true,\n \"is_active\": true,\n \"sort_order\": 1,\n \"options\": [\n {\n \"value\": \"<string>\",\n \"label\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/api/v1/events/{event}/registration-fields/{field}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"<string>\",\n \"key\": \"<string>\",\n \"validation_rules\": [\n \"<string>\"\n ],\n \"help_text\": \"<string>\",\n \"is_required\": true,\n \"show_only_with_kit\": true,\n \"is_active\": true,\n \"sort_order\": 1,\n \"options\": [\n {\n \"value\": \"<string>\",\n \"label\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"event_id": 123,
"key": "<string>",
"label": "<string>",
"type": "<string>",
"options": [
"<unknown>"
],
"validation_rules": [
"<unknown>"
],
"help_text": "<string>",
"is_required": true,
"show_only_with_kit": true,
"is_active": true,
"sort_order": 123,
"created_at": "<string>",
"updated_at": "<string>"
}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Authorizations
API key do hub com escopo manage. Header: Authorization: Bearer <api_key>.
Body
application/json
PATCH /api/v1/events/{event}/registration-fields/{field} — atualização parcial.
Maximum string length:
120Maximum string length:
60Available options:
text, textarea, select, multiselect, checkbox, file Maximum string length:
500Required range:
x >= 0Show child attributes
Show child attributes
Response
JsonResource
Show child attributes
Show child attributes
⌘I
Atualizar campo de inscrição
curl --request PATCH \
--url http://localhost/api/v1/events/{event}/registration-fields/{field} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "<string>",
"key": "<string>",
"validation_rules": [
"<string>"
],
"help_text": "<string>",
"is_required": true,
"show_only_with_kit": true,
"is_active": true,
"sort_order": 1,
"options": [
{
"value": "<string>",
"label": "<string>"
}
]
}
'import requests
url = "http://localhost/api/v1/events/{event}/registration-fields/{field}"
payload = {
"label": "<string>",
"key": "<string>",
"validation_rules": ["<string>"],
"help_text": "<string>",
"is_required": True,
"show_only_with_kit": True,
"is_active": True,
"sort_order": 1,
"options": [
{
"value": "<string>",
"label": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
label: '<string>',
key: '<string>',
validation_rules: ['<string>'],
help_text: '<string>',
is_required: true,
show_only_with_kit: true,
is_active: true,
sort_order: 1,
options: [{value: '<string>', label: '<string>'}]
})
};
fetch('http://localhost/api/v1/events/{event}/registration-fields/{field}', 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 => "http://localhost/api/v1/events/{event}/registration-fields/{field}",
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([
'label' => '<string>',
'key' => '<string>',
'validation_rules' => [
'<string>'
],
'help_text' => '<string>',
'is_required' => true,
'show_only_with_kit' => true,
'is_active' => true,
'sort_order' => 1,
'options' => [
[
'value' => '<string>',
'label' => '<string>'
]
]
]),
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 := "http://localhost/api/v1/events/{event}/registration-fields/{field}"
payload := strings.NewReader("{\n \"label\": \"<string>\",\n \"key\": \"<string>\",\n \"validation_rules\": [\n \"<string>\"\n ],\n \"help_text\": \"<string>\",\n \"is_required\": true,\n \"show_only_with_kit\": true,\n \"is_active\": true,\n \"sort_order\": 1,\n \"options\": [\n {\n \"value\": \"<string>\",\n \"label\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("http://localhost/api/v1/events/{event}/registration-fields/{field}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"<string>\",\n \"key\": \"<string>\",\n \"validation_rules\": [\n \"<string>\"\n ],\n \"help_text\": \"<string>\",\n \"is_required\": true,\n \"show_only_with_kit\": true,\n \"is_active\": true,\n \"sort_order\": 1,\n \"options\": [\n {\n \"value\": \"<string>\",\n \"label\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/api/v1/events/{event}/registration-fields/{field}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"<string>\",\n \"key\": \"<string>\",\n \"validation_rules\": [\n \"<string>\"\n ],\n \"help_text\": \"<string>\",\n \"is_required\": true,\n \"show_only_with_kit\": true,\n \"is_active\": true,\n \"sort_order\": 1,\n \"options\": [\n {\n \"value\": \"<string>\",\n \"label\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"event_id": 123,
"key": "<string>",
"label": "<string>",
"type": "<string>",
"options": [
"<unknown>"
],
"validation_rules": [
"<unknown>"
],
"help_text": "<string>",
"is_required": true,
"show_only_with_kit": true,
"is_active": true,
"sort_order": 123,
"created_at": "<string>",
"updated_at": "<string>"
}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}