Checkpoints
Criar checkpoint
Adiciona um ponto
POST
/
events
/
{event}
/
checkpoints
Criar checkpoint
curl --request POST \
--url http://localhost/api/v1/events/{event}/checkpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>",
"name": "<string>",
"latitude": 0,
"longitude": 0,
"altitude": 123,
"description": "<string>",
"physical_type": "<string>"
}
'import requests
url = "http://localhost/api/v1/events/{event}/checkpoints"
payload = {
"code": "<string>",
"name": "<string>",
"latitude": 0,
"longitude": 0,
"altitude": 123,
"description": "<string>",
"physical_type": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
code: '<string>',
name: '<string>',
latitude: 0,
longitude: 0,
altitude: 123,
description: '<string>',
physical_type: '<string>'
})
};
fetch('http://localhost/api/v1/events/{event}/checkpoints', 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}/checkpoints",
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([
'code' => '<string>',
'name' => '<string>',
'latitude' => 0,
'longitude' => 0,
'altitude' => 123,
'description' => '<string>',
'physical_type' => '<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}/checkpoints"
payload := strings.NewReader("{\n \"code\": \"<string>\",\n \"name\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"altitude\": 123,\n \"description\": \"<string>\",\n \"physical_type\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("http://localhost/api/v1/events/{event}/checkpoints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"<string>\",\n \"name\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"altitude\": 123,\n \"description\": \"<string>\",\n \"physical_type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/api/v1/events/{event}/checkpoints")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"<string>\",\n \"name\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"altitude\": 123,\n \"description\": \"<string>\",\n \"physical_type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"event_id": 123,
"code": "<string>",
"name": "<string>",
"latitude": 123,
"longitude": 123,
"altitude": 123,
"description": "<string>",
"physical_type": "<string>",
"status": "<string>",
"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>.
Path Parameters
Body
application/json
POST /api/v1/events/{event}/checkpoints — ponto de controle do evento. Espelha EventView::saveCheckpoint + UpdateRaceConfigRequest (checkpoints.*). code é único por evento (validado no controller, que tem o contexto do evento).
Maximum string length:
10Maximum string length:
80Required range:
-90 <= x <= 90Required range:
-180 <= x <= 180Maximum string length:
255Maximum string length:
20Status genérico usado por várias entidades (Hub, User, Group, Category, etc.). Entidades com estados específicos (Event, Registration) têm enums próprios.
Available options:
active, inactive, suspended Response
JsonResource
Show child attributes
Show child attributes
⌘I
Criar checkpoint
curl --request POST \
--url http://localhost/api/v1/events/{event}/checkpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>",
"name": "<string>",
"latitude": 0,
"longitude": 0,
"altitude": 123,
"description": "<string>",
"physical_type": "<string>"
}
'import requests
url = "http://localhost/api/v1/events/{event}/checkpoints"
payload = {
"code": "<string>",
"name": "<string>",
"latitude": 0,
"longitude": 0,
"altitude": 123,
"description": "<string>",
"physical_type": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
code: '<string>',
name: '<string>',
latitude: 0,
longitude: 0,
altitude: 123,
description: '<string>',
physical_type: '<string>'
})
};
fetch('http://localhost/api/v1/events/{event}/checkpoints', 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}/checkpoints",
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([
'code' => '<string>',
'name' => '<string>',
'latitude' => 0,
'longitude' => 0,
'altitude' => 123,
'description' => '<string>',
'physical_type' => '<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}/checkpoints"
payload := strings.NewReader("{\n \"code\": \"<string>\",\n \"name\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"altitude\": 123,\n \"description\": \"<string>\",\n \"physical_type\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("http://localhost/api/v1/events/{event}/checkpoints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"<string>\",\n \"name\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"altitude\": 123,\n \"description\": \"<string>\",\n \"physical_type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/api/v1/events/{event}/checkpoints")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"<string>\",\n \"name\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"altitude\": 123,\n \"description\": \"<string>\",\n \"physical_type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 123,
"event_id": 123,
"code": "<string>",
"name": "<string>",
"latitude": 123,
"longitude": 123,
"altitude": 123,
"description": "<string>",
"physical_type": "<string>",
"status": "<string>",
"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": {}
}