Change a destination endpoint
curl --request PATCH \
--url https://api.occtoo.com/v1/destinations/{destinationId}/versions/{version}/endpoints/{endpoint} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"content": {
"cardId": "<string>",
"properties": [
{
"id": "<string>",
"alias": "<string>",
"facet": {
"size": 123,
"header": {}
}
}
],
"segments": {
"include": [
"<string>"
],
"exclude": [
"<string>"
]
},
"relations": [
{
"id": "<string>",
"alias": "<string>",
"content": "<unknown>",
"order": {
"by": "<string>"
}
}
]
}
}
'import requests
url = "https://api.occtoo.com/v1/destinations/{destinationId}/versions/{version}/endpoints/{endpoint}"
payload = {
"name": "<string>",
"description": "<string>",
"content": {
"cardId": "<string>",
"properties": [
{
"id": "<string>",
"alias": "<string>",
"facet": {
"size": 123,
"header": {}
}
}
],
"segments": {
"include": ["<string>"],
"exclude": ["<string>"]
},
"relations": [
{
"id": "<string>",
"alias": "<string>",
"content": "<unknown>",
"order": { "by": "<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({
name: '<string>',
description: '<string>',
content: {
cardId: '<string>',
properties: [{id: '<string>', alias: '<string>', facet: {size: 123, header: {}}}],
segments: {include: ['<string>'], exclude: ['<string>']},
relations: [
{
id: '<string>',
alias: '<string>',
content: '<unknown>',
order: {by: '<string>'}
}
]
}
})
};
fetch('https://api.occtoo.com/v1/destinations/{destinationId}/versions/{version}/endpoints/{endpoint}', 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 => "https://api.occtoo.com/v1/destinations/{destinationId}/versions/{version}/endpoints/{endpoint}",
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>',
'description' => '<string>',
'content' => [
'cardId' => '<string>',
'properties' => [
[
'id' => '<string>',
'alias' => '<string>',
'facet' => [
'size' => 123,
'header' => [
]
]
]
],
'segments' => [
'include' => [
'<string>'
],
'exclude' => [
'<string>'
]
],
'relations' => [
[
'id' => '<string>',
'alias' => '<string>',
'content' => '<unknown>',
'order' => [
'by' => '<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 := "https://api.occtoo.com/v1/destinations/{destinationId}/versions/{version}/endpoints/{endpoint}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"content\": {\n \"cardId\": \"<string>\",\n \"properties\": [\n {\n \"id\": \"<string>\",\n \"alias\": \"<string>\",\n \"facet\": {\n \"size\": 123,\n \"header\": {}\n }\n }\n ],\n \"segments\": {\n \"include\": [\n \"<string>\"\n ],\n \"exclude\": [\n \"<string>\"\n ]\n },\n \"relations\": [\n {\n \"id\": \"<string>\",\n \"alias\": \"<string>\",\n \"content\": \"<unknown>\",\n \"order\": {\n \"by\": \"<string>\"\n }\n }\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("https://api.occtoo.com/v1/destinations/{destinationId}/versions/{version}/endpoints/{endpoint}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"content\": {\n \"cardId\": \"<string>\",\n \"properties\": [\n {\n \"id\": \"<string>\",\n \"alias\": \"<string>\",\n \"facet\": {\n \"size\": 123,\n \"header\": {}\n }\n }\n ],\n \"segments\": {\n \"include\": [\n \"<string>\"\n ],\n \"exclude\": [\n \"<string>\"\n ]\n },\n \"relations\": [\n {\n \"id\": \"<string>\",\n \"alias\": \"<string>\",\n \"content\": \"<unknown>\",\n \"order\": {\n \"by\": \"<string>\"\n }\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.occtoo.com/v1/destinations/{destinationId}/versions/{version}/endpoints/{endpoint}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"content\": {\n \"cardId\": \"<string>\",\n \"properties\": [\n {\n \"id\": \"<string>\",\n \"alias\": \"<string>\",\n \"facet\": {\n \"size\": 123,\n \"header\": {}\n }\n }\n ],\n \"segments\": {\n \"include\": [\n \"<string>\"\n ],\n \"exclude\": [\n \"<string>\"\n ]\n },\n \"relations\": [\n {\n \"id\": \"<string>\",\n \"alias\": \"<string>\",\n \"content\": \"<unknown>\",\n \"order\": {\n \"by\": \"<string>\"\n }\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"content": {
"cardId": "<string>",
"properties": [
{
"id": "<string>",
"alias": "<string>",
"facet": {
"size": 123,
"header": {}
}
}
],
"segments": {
"include": [
"<string>"
],
"exclude": [
"<string>"
]
},
"relations": [
{
"id": "<string>",
"alias": "<string>",
"cardinality": "Plural",
"content": "<unknown>",
"order": {
"by": "<string>",
"direction": "Asc"
}
}
]
},
"pendingContent": {
"cardId": "<string>",
"properties": [
{
"id": "<string>",
"alias": "<string>",
"facet": {
"size": 123,
"header": {}
}
}
],
"segments": {
"include": [
"<string>"
],
"exclude": [
"<string>"
]
},
"relations": [
{
"id": "<string>",
"alias": "<string>",
"cardinality": "Plural",
"content": "<unknown>",
"order": {
"by": "<string>",
"direction": "Asc"
}
}
]
},
"etag": 123
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errors": {}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Destination endpoints
Change a destination endpoint
Omitted or null fields stay as they are; content replaces everything the endpoint returns. Before the version is published the change applies at once. On a published version the content waits as pendingContent for the next publish, and returns 409 when it removes a property, relation or facet, changes an alias, or changes name or description. Needs the latest ETag in If-Match.
PATCH
/
v1
/
destinations
/
{destinationId}
/
versions
/
{version}
/
endpoints
/
{endpoint}
Change a destination endpoint
curl --request PATCH \
--url https://api.occtoo.com/v1/destinations/{destinationId}/versions/{version}/endpoints/{endpoint} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"content": {
"cardId": "<string>",
"properties": [
{
"id": "<string>",
"alias": "<string>",
"facet": {
"size": 123,
"header": {}
}
}
],
"segments": {
"include": [
"<string>"
],
"exclude": [
"<string>"
]
},
"relations": [
{
"id": "<string>",
"alias": "<string>",
"content": "<unknown>",
"order": {
"by": "<string>"
}
}
]
}
}
'import requests
url = "https://api.occtoo.com/v1/destinations/{destinationId}/versions/{version}/endpoints/{endpoint}"
payload = {
"name": "<string>",
"description": "<string>",
"content": {
"cardId": "<string>",
"properties": [
{
"id": "<string>",
"alias": "<string>",
"facet": {
"size": 123,
"header": {}
}
}
],
"segments": {
"include": ["<string>"],
"exclude": ["<string>"]
},
"relations": [
{
"id": "<string>",
"alias": "<string>",
"content": "<unknown>",
"order": { "by": "<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({
name: '<string>',
description: '<string>',
content: {
cardId: '<string>',
properties: [{id: '<string>', alias: '<string>', facet: {size: 123, header: {}}}],
segments: {include: ['<string>'], exclude: ['<string>']},
relations: [
{
id: '<string>',
alias: '<string>',
content: '<unknown>',
order: {by: '<string>'}
}
]
}
})
};
fetch('https://api.occtoo.com/v1/destinations/{destinationId}/versions/{version}/endpoints/{endpoint}', 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 => "https://api.occtoo.com/v1/destinations/{destinationId}/versions/{version}/endpoints/{endpoint}",
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>',
'description' => '<string>',
'content' => [
'cardId' => '<string>',
'properties' => [
[
'id' => '<string>',
'alias' => '<string>',
'facet' => [
'size' => 123,
'header' => [
]
]
]
],
'segments' => [
'include' => [
'<string>'
],
'exclude' => [
'<string>'
]
],
'relations' => [
[
'id' => '<string>',
'alias' => '<string>',
'content' => '<unknown>',
'order' => [
'by' => '<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 := "https://api.occtoo.com/v1/destinations/{destinationId}/versions/{version}/endpoints/{endpoint}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"content\": {\n \"cardId\": \"<string>\",\n \"properties\": [\n {\n \"id\": \"<string>\",\n \"alias\": \"<string>\",\n \"facet\": {\n \"size\": 123,\n \"header\": {}\n }\n }\n ],\n \"segments\": {\n \"include\": [\n \"<string>\"\n ],\n \"exclude\": [\n \"<string>\"\n ]\n },\n \"relations\": [\n {\n \"id\": \"<string>\",\n \"alias\": \"<string>\",\n \"content\": \"<unknown>\",\n \"order\": {\n \"by\": \"<string>\"\n }\n }\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("https://api.occtoo.com/v1/destinations/{destinationId}/versions/{version}/endpoints/{endpoint}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"content\": {\n \"cardId\": \"<string>\",\n \"properties\": [\n {\n \"id\": \"<string>\",\n \"alias\": \"<string>\",\n \"facet\": {\n \"size\": 123,\n \"header\": {}\n }\n }\n ],\n \"segments\": {\n \"include\": [\n \"<string>\"\n ],\n \"exclude\": [\n \"<string>\"\n ]\n },\n \"relations\": [\n {\n \"id\": \"<string>\",\n \"alias\": \"<string>\",\n \"content\": \"<unknown>\",\n \"order\": {\n \"by\": \"<string>\"\n }\n }\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.occtoo.com/v1/destinations/{destinationId}/versions/{version}/endpoints/{endpoint}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"content\": {\n \"cardId\": \"<string>\",\n \"properties\": [\n {\n \"id\": \"<string>\",\n \"alias\": \"<string>\",\n \"facet\": {\n \"size\": 123,\n \"header\": {}\n }\n }\n ],\n \"segments\": {\n \"include\": [\n \"<string>\"\n ],\n \"exclude\": [\n \"<string>\"\n ]\n },\n \"relations\": [\n {\n \"id\": \"<string>\",\n \"alias\": \"<string>\",\n \"content\": \"<unknown>\",\n \"order\": {\n \"by\": \"<string>\"\n }\n }\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"content": {
"cardId": "<string>",
"properties": [
{
"id": "<string>",
"alias": "<string>",
"facet": {
"size": 123,
"header": {}
}
}
],
"segments": {
"include": [
"<string>"
],
"exclude": [
"<string>"
]
},
"relations": [
{
"id": "<string>",
"alias": "<string>",
"cardinality": "Plural",
"content": "<unknown>",
"order": {
"by": "<string>",
"direction": "Asc"
}
}
]
},
"pendingContent": {
"cardId": "<string>",
"properties": [
{
"id": "<string>",
"alias": "<string>",
"facet": {
"size": 123,
"header": {}
}
}
],
"segments": {
"include": [
"<string>"
],
"exclude": [
"<string>"
]
},
"relations": [
{
"id": "<string>",
"alias": "<string>",
"cardinality": "Plural",
"content": "<unknown>",
"order": {
"by": "<string>",
"direction": "Asc"
}
}
]
},
"etag": 123
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errors": {}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Authorizations
kindeOAuthbearerAuthapiKey
Path Parameters
Body
application/json
Changes to an endpoint. Omitted or null fields stay as they are.
Response
OK
An endpoint of a destination version: one route of the published API and what it returns.
Was this page helpful?