Vincular um projeto filho
curl --request POST \
--url https://api.olie.ai/api/management/projects/{project}/hierarchy/attach-child \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"child_id": null
}
'import requests
url = "https://api.olie.ai/api/management/projects/{project}/hierarchy/attach-child"
payload = { "child_id": None }
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({child_id: null})
};
fetch('https://api.olie.ai/api/management/projects/{project}/hierarchy/attach-child', 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.olie.ai/api/management/projects/{project}/hierarchy/attach-child",
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([
'child_id' => null
]),
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.olie.ai/api/management/projects/{project}/hierarchy/attach-child"
payload := strings.NewReader("{\n \"child_id\": null\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.olie.ai/api/management/projects/{project}/hierarchy/attach-child")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"child_id\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olie.ai/api/management/projects/{project}/hierarchy/attach-child")
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 \"child_id\": null\n}"
response = http.request(request)
puts response.read_body{
"response": true,
"data": {
"parent": {
"id": "019e0edb-aa7c-70c4-9d2d-3a2f175b5ddf",
"name": "Shopping Center"
},
"child": {
"id": "019e0f21-4b3c-71a8-8f0e-9c2d5a7b1e40",
"name": "Fundação"
},
"new_hierarchy_breadcrumb": "Shopping Center > Fundação"
}
}{
"response": false,
"message": "invalid_parent_child_relationship",
"error": "Cannot attach child: would create invalid hierarchy (loop, depth limit, or self-reference)"
}projects
Vincular um projeto filho
Torna um projeto existente filho direto do projeto informado. O vínculo é recusado quando criaria um ciclo, quando o projeto seria pai de si mesmo ou quando ultrapassaria o limite de quatro níveis de profundidade.
Regras completas em Hierarquia de projetos.
POST
/
api
/
management
/
projects
/
{project}
/
hierarchy
/
attach-child
Vincular um projeto filho
curl --request POST \
--url https://api.olie.ai/api/management/projects/{project}/hierarchy/attach-child \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"child_id": null
}
'import requests
url = "https://api.olie.ai/api/management/projects/{project}/hierarchy/attach-child"
payload = { "child_id": None }
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({child_id: null})
};
fetch('https://api.olie.ai/api/management/projects/{project}/hierarchy/attach-child', 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.olie.ai/api/management/projects/{project}/hierarchy/attach-child",
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([
'child_id' => null
]),
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.olie.ai/api/management/projects/{project}/hierarchy/attach-child"
payload := strings.NewReader("{\n \"child_id\": null\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.olie.ai/api/management/projects/{project}/hierarchy/attach-child")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"child_id\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olie.ai/api/management/projects/{project}/hierarchy/attach-child")
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 \"child_id\": null\n}"
response = http.request(request)
puts response.read_body{
"response": true,
"data": {
"parent": {
"id": "019e0edb-aa7c-70c4-9d2d-3a2f175b5ddf",
"name": "Shopping Center"
},
"child": {
"id": "019e0f21-4b3c-71a8-8f0e-9c2d5a7b1e40",
"name": "Fundação"
},
"new_hierarchy_breadcrumb": "Shopping Center > Fundação"
}
}{
"response": false,
"message": "invalid_parent_child_relationship",
"error": "Cannot attach child: would create invalid hierarchy (loop, depth limit, or self-reference)"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID (UUID) do projeto.
Body
application/json
Projeto a vincular como filho.
ID (UUID) do projeto que passa a ser filho.
Was this page helpful?