Get Public Tree Document At Commit
curl --request GET \
--url https://api.yertle.com/public/orgs/{org_id}/nodes/{node_id}/tree/{branch}/commits/{commit_id}/tree \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.yertle.com/public/orgs/{org_id}/nodes/{node_id}/tree/{branch}/commits/{commit_id}/tree"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.yertle.com/public/orgs/{org_id}/nodes/{node_id}/tree/{branch}/commits/{commit_id}/tree', 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.yertle.com/public/orgs/{org_id}/nodes/{node_id}/tree/{branch}/commits/{commit_id}/tree",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.yertle.com/public/orgs/{org_id}/nodes/{node_id}/tree/{branch}/commits/{commit_id}/tree"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.yertle.com/public/orgs/{org_id}/nodes/{node_id}/tree/{branch}/commits/{commit_id}/tree")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yertle.com/public/orgs/{org_id}/nodes/{node_id}/tree/{branch}/commits/{commit_id}/tree")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"state": {
"node": {
"title": "<string>",
"description": "",
"metadata": {}
},
"tags": {},
"directories": [
"<string>"
],
"visual_properties": [
{
"child_node_id": "<string>",
"position_x": 0,
"position_y": 0,
"z_index": 0,
"width": 123,
"height": 123,
"rotation": 0,
"transparency": 1,
"show_border": true,
"title_position": "center",
"show_preview": false,
"_title": "<string>",
"_description": "<string>",
"_snapshot_commit_id": "<string>"
}
],
"connections": [
{
"id": "<string>",
"from_child_id": "<string>",
"to_child_id": "<string>",
"from_edge": "center",
"to_edge": "center",
"style": {},
"label": "<string>",
"type": "default",
"metadata": {},
"_from_title": "<string>",
"_to_title": "<string>"
}
]
},
"status": {
"node_id": "<string>",
"org_id": "<string>",
"counts": {
"children": 123,
"connections": 123,
"parents": 123,
"ingress": 123,
"egress": 123
},
"branch": "<string>",
"commit_id": "<string>",
"created_at": "<string>",
"parents": [
{}
],
"ingress": [
{}
],
"egress": [
{}
]
},
"expected_head_commit": "<string>",
"message": ""
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Public API
Get Public Tree Document At Commit
Anonymous read of a node’s tree document at a commit. Read-only.
The same document as the authed .../commits/{commit_id}/tree.
GET
/
public
/
orgs
/
{org_id}
/
nodes
/
{node_id}
/
tree
/
{branch}
/
commits
/
{commit_id}
/
tree
Get Public Tree Document At Commit
curl --request GET \
--url https://api.yertle.com/public/orgs/{org_id}/nodes/{node_id}/tree/{branch}/commits/{commit_id}/tree \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.yertle.com/public/orgs/{org_id}/nodes/{node_id}/tree/{branch}/commits/{commit_id}/tree"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.yertle.com/public/orgs/{org_id}/nodes/{node_id}/tree/{branch}/commits/{commit_id}/tree', 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.yertle.com/public/orgs/{org_id}/nodes/{node_id}/tree/{branch}/commits/{commit_id}/tree",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.yertle.com/public/orgs/{org_id}/nodes/{node_id}/tree/{branch}/commits/{commit_id}/tree"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.yertle.com/public/orgs/{org_id}/nodes/{node_id}/tree/{branch}/commits/{commit_id}/tree")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yertle.com/public/orgs/{org_id}/nodes/{node_id}/tree/{branch}/commits/{commit_id}/tree")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"state": {
"node": {
"title": "<string>",
"description": "",
"metadata": {}
},
"tags": {},
"directories": [
"<string>"
],
"visual_properties": [
{
"child_node_id": "<string>",
"position_x": 0,
"position_y": 0,
"z_index": 0,
"width": 123,
"height": 123,
"rotation": 0,
"transparency": 1,
"show_border": true,
"title_position": "center",
"show_preview": false,
"_title": "<string>",
"_description": "<string>",
"_snapshot_commit_id": "<string>"
}
],
"connections": [
{
"id": "<string>",
"from_child_id": "<string>",
"to_child_id": "<string>",
"from_edge": "center",
"to_edge": "center",
"style": {},
"label": "<string>",
"type": "default",
"metadata": {},
"_from_title": "<string>",
"_to_title": "<string>"
}
]
},
"status": {
"node_id": "<string>",
"org_id": "<string>",
"counts": {
"children": 123,
"connections": 123,
"parents": 123,
"ingress": 123,
"egress": 123
},
"branch": "<string>",
"commit_id": "<string>",
"created_at": "<string>",
"parents": [
{}
],
"ingress": [
{}
],
"egress": [
{}
]
},
"expected_head_commit": "<string>",
"message": ""
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Path Parameters
Response
Successful Response
GET /tree/{branch}. Valid input to PUT /tree/{branch}/push as returned:
edit state, set message, send it back. expected_head_commit is the
branch head this document was read at; a stale one is rejected with 409.
Read at a commit (GET .../commits/{commit_id}/tree) the document is
read-only: it has no expected_head_commit, so push rejects it (422).