Mover um projeto para outro pai
curl --request PUT \
--url https://api.olie.ai/api/management/projects/{project}/hierarchy/move-to-parent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"new_parent_id": null
}
'import requests
url = "https://api.olie.ai/api/management/projects/{project}/hierarchy/move-to-parent"
payload = { "new_parent_id": None }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({new_parent_id: null})
};
fetch('https://api.olie.ai/api/management/projects/{project}/hierarchy/move-to-parent', 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/move-to-parent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'new_parent_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/move-to-parent"
payload := strings.NewReader("{\n \"new_parent_id\": null\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.olie.ai/api/management/projects/{project}/hierarchy/move-to-parent")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"new_parent_id\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olie.ai/api/management/projects/{project}/hierarchy/move-to-parent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"new_parent_id\": null\n}"
response = http.request(request)
puts response.read_body{
"response": true,
"data": {
"project": {
"id": "019e0f21-4b3c-71a8-8f0e-9c2d5a7b1e40",
"name": "Fundação"
},
"old_parent": {
"id": "019e0edb-aa7c-70c4-9d2d-3a2f175b5ddf",
"name": "Shopping Center"
},
"new_parent": {
"id": "019e0f22-8c11-7233-b5a1-77d0c9e41a02",
"name": "Estrutura"
},
"new_hierarchy_breadcrumb": "Shopping Center > Estrutura > Fundação",
"is_root": false
}
}projects
Mover um projeto para outro pai
Muda o projeto de lugar na estrutura, colocando-o sob outro pai. Enviar new_parent_id como null promove o projeto a raiz.
A movimentação é recusada quando criaria um ciclo ou quando a subárvore do projeto ultrapassaria o limite de quatro níveis de profundidade — veja Hierarquia de projetos.
PUT
/
api
/
management
/
projects
/
{project}
/
hierarchy
/
move-to-parent
Mover um projeto para outro pai
curl --request PUT \
--url https://api.olie.ai/api/management/projects/{project}/hierarchy/move-to-parent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"new_parent_id": null
}
'import requests
url = "https://api.olie.ai/api/management/projects/{project}/hierarchy/move-to-parent"
payload = { "new_parent_id": None }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({new_parent_id: null})
};
fetch('https://api.olie.ai/api/management/projects/{project}/hierarchy/move-to-parent', 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/move-to-parent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'new_parent_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/move-to-parent"
payload := strings.NewReader("{\n \"new_parent_id\": null\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.olie.ai/api/management/projects/{project}/hierarchy/move-to-parent")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"new_parent_id\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olie.ai/api/management/projects/{project}/hierarchy/move-to-parent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"new_parent_id\": null\n}"
response = http.request(request)
puts response.read_body{
"response": true,
"data": {
"project": {
"id": "019e0f21-4b3c-71a8-8f0e-9c2d5a7b1e40",
"name": "Fundação"
},
"old_parent": {
"id": "019e0edb-aa7c-70c4-9d2d-3a2f175b5ddf",
"name": "Shopping Center"
},
"new_parent": {
"id": "019e0f22-8c11-7233-b5a1-77d0c9e41a02",
"name": "Estrutura"
},
"new_hierarchy_breadcrumb": "Shopping Center > Estrutura > Fundação",
"is_root": false
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID (UUID) do projeto.
Body
application/json
Novo pai do projeto.
ID (UUID) do novo pai. null promove o projeto a raiz.
Was this page helpful?