Create a relation definition
curl --request POST \
--url https://api.occtoo.com/v1/relation-definitions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"name": "<string>",
"sourceCardId": "<string>",
"targetCardId": "<string>",
"match": {
"sourceProperty": "<string>",
"targetProperty": "<string>"
},
"description": "<string>",
"tags": [
"<string>"
],
"sourceDisplayName": "<string>",
"targetDisplayName": "<string>",
"order": {
"property": "<string>",
"targetMatchProperty": "<string>"
}
}
'import requests
url = "https://api.occtoo.com/v1/relation-definitions"
payload = {
"id": "<string>",
"name": "<string>",
"sourceCardId": "<string>",
"targetCardId": "<string>",
"match": {
"sourceProperty": "<string>",
"targetProperty": "<string>"
},
"description": "<string>",
"tags": ["<string>"],
"sourceDisplayName": "<string>",
"targetDisplayName": "<string>",
"order": {
"property": "<string>",
"targetMatchProperty": "<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({
id: '<string>',
name: '<string>',
sourceCardId: '<string>',
targetCardId: '<string>',
match: {sourceProperty: '<string>', targetProperty: '<string>'},
description: '<string>',
tags: ['<string>'],
sourceDisplayName: '<string>',
targetDisplayName: '<string>',
order: {property: '<string>', targetMatchProperty: '<string>'}
})
};
fetch('https://api.occtoo.com/v1/relation-definitions', 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/relation-definitions",
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([
'id' => '<string>',
'name' => '<string>',
'sourceCardId' => '<string>',
'targetCardId' => '<string>',
'match' => [
'sourceProperty' => '<string>',
'targetProperty' => '<string>'
],
'description' => '<string>',
'tags' => [
'<string>'
],
'sourceDisplayName' => '<string>',
'targetDisplayName' => '<string>',
'order' => [
'property' => '<string>',
'targetMatchProperty' => '<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/relation-definitions"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"sourceCardId\": \"<string>\",\n \"targetCardId\": \"<string>\",\n \"match\": {\n \"sourceProperty\": \"<string>\",\n \"targetProperty\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"sourceDisplayName\": \"<string>\",\n \"targetDisplayName\": \"<string>\",\n \"order\": {\n \"property\": \"<string>\",\n \"targetMatchProperty\": \"<string>\"\n }\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("https://api.occtoo.com/v1/relation-definitions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"sourceCardId\": \"<string>\",\n \"targetCardId\": \"<string>\",\n \"match\": {\n \"sourceProperty\": \"<string>\",\n \"targetProperty\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"sourceDisplayName\": \"<string>\",\n \"targetDisplayName\": \"<string>\",\n \"order\": {\n \"property\": \"<string>\",\n \"targetMatchProperty\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.occtoo.com/v1/relation-definitions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"sourceCardId\": \"<string>\",\n \"targetCardId\": \"<string>\",\n \"match\": {\n \"sourceProperty\": \"<string>\",\n \"targetProperty\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"sourceDisplayName\": \"<string>\",\n \"targetDisplayName\": \"<string>\",\n \"order\": {\n \"property\": \"<string>\",\n \"targetMatchProperty\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"tags": [
"<string>"
],
"sourceCardId": "<string>",
"targetCardId": "<string>",
"match": {
"sourceProperty": "<string>",
"targetProperty": "<string>"
},
"sourceDisplayName": "<string>",
"targetDisplayName": "<string>",
"order": {
"type": "BasedOnTargetProperty",
"property": "<string>",
"targetMatchProperty": "<string>"
},
"status": "Initializing",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"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>"
}Relation definitions
Create a relation definition
Creates a relation definition between two Active card definitions. The links between cards are built in the background: status is Initializing until that finishes, so read the relation definition until it is Active. 400: an unknown card definition or card property. 409: the id is taken.
POST
/
v1
/
relation-definitions
Create a relation definition
curl --request POST \
--url https://api.occtoo.com/v1/relation-definitions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"name": "<string>",
"sourceCardId": "<string>",
"targetCardId": "<string>",
"match": {
"sourceProperty": "<string>",
"targetProperty": "<string>"
},
"description": "<string>",
"tags": [
"<string>"
],
"sourceDisplayName": "<string>",
"targetDisplayName": "<string>",
"order": {
"property": "<string>",
"targetMatchProperty": "<string>"
}
}
'import requests
url = "https://api.occtoo.com/v1/relation-definitions"
payload = {
"id": "<string>",
"name": "<string>",
"sourceCardId": "<string>",
"targetCardId": "<string>",
"match": {
"sourceProperty": "<string>",
"targetProperty": "<string>"
},
"description": "<string>",
"tags": ["<string>"],
"sourceDisplayName": "<string>",
"targetDisplayName": "<string>",
"order": {
"property": "<string>",
"targetMatchProperty": "<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({
id: '<string>',
name: '<string>',
sourceCardId: '<string>',
targetCardId: '<string>',
match: {sourceProperty: '<string>', targetProperty: '<string>'},
description: '<string>',
tags: ['<string>'],
sourceDisplayName: '<string>',
targetDisplayName: '<string>',
order: {property: '<string>', targetMatchProperty: '<string>'}
})
};
fetch('https://api.occtoo.com/v1/relation-definitions', 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/relation-definitions",
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([
'id' => '<string>',
'name' => '<string>',
'sourceCardId' => '<string>',
'targetCardId' => '<string>',
'match' => [
'sourceProperty' => '<string>',
'targetProperty' => '<string>'
],
'description' => '<string>',
'tags' => [
'<string>'
],
'sourceDisplayName' => '<string>',
'targetDisplayName' => '<string>',
'order' => [
'property' => '<string>',
'targetMatchProperty' => '<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/relation-definitions"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"sourceCardId\": \"<string>\",\n \"targetCardId\": \"<string>\",\n \"match\": {\n \"sourceProperty\": \"<string>\",\n \"targetProperty\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"sourceDisplayName\": \"<string>\",\n \"targetDisplayName\": \"<string>\",\n \"order\": {\n \"property\": \"<string>\",\n \"targetMatchProperty\": \"<string>\"\n }\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("https://api.occtoo.com/v1/relation-definitions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"sourceCardId\": \"<string>\",\n \"targetCardId\": \"<string>\",\n \"match\": {\n \"sourceProperty\": \"<string>\",\n \"targetProperty\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"sourceDisplayName\": \"<string>\",\n \"targetDisplayName\": \"<string>\",\n \"order\": {\n \"property\": \"<string>\",\n \"targetMatchProperty\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.occtoo.com/v1/relation-definitions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"sourceCardId\": \"<string>\",\n \"targetCardId\": \"<string>\",\n \"match\": {\n \"sourceProperty\": \"<string>\",\n \"targetProperty\": \"<string>\"\n },\n \"description\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ],\n \"sourceDisplayName\": \"<string>\",\n \"targetDisplayName\": \"<string>\",\n \"order\": {\n \"property\": \"<string>\",\n \"targetMatchProperty\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"tags": [
"<string>"
],
"sourceCardId": "<string>",
"targetCardId": "<string>",
"match": {
"sourceProperty": "<string>",
"targetProperty": "<string>"
},
"sourceDisplayName": "<string>",
"targetDisplayName": "<string>",
"order": {
"type": "BasedOnTargetProperty",
"property": "<string>",
"targetMatchProperty": "<string>"
},
"status": "Initializing",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"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>"
}Authorizations
kindeOAuthbearerAuthapiKey
Body
application/json
Holds a new relation definition.
Response
Created
Links the cards of two card definitions, a source and a target. Segments (relation in where) and destination endpoints (relation content) follow relation definitions by id.
Was this page helpful?