Promover um projeto a raiz
curl --request PUT \
--url https://api.olie.ai/api/management/projects/{project}/hierarchy/promote-to-root \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.olie.ai/api/management/projects/{project}/hierarchy/promote-to-root"
headers = {"Authorization": "Bearer <token>"}
response = requests.put(url, headers=headers)
print(response.text)const options = {method: 'PUT', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.olie.ai/api/management/projects/{project}/hierarchy/promote-to-root', 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/promote-to-root",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
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.olie.ai/api/management/projects/{project}/hierarchy/promote-to-root"
req, _ := http.NewRequest("PUT", 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.put("https://api.olie.ai/api/management/projects/{project}/hierarchy/promote-to-root")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olie.ai/api/management/projects/{project}/hierarchy/promote-to-root")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"response": true,
"data": {
"project": {
"id": "019e0f21-4b3c-71a8-8f0e-9c2d5a7b1e40",
"name": "Fundação",
"is_root": true
},
"former_parent": {
"id": "019e0edb-aa7c-70c4-9d2d-3a2f175b5ddf",
"name": "Shopping Center"
}
}
}{
"response": false,
"message": "Project is already at root level"
}projects
Promover um projeto a raiz
Desliga o projeto de seu pai, deixando-o como raiz de uma nova estrutura. Os filhos do projeto acompanham a mudança e mantêm as posições relativas entre si. Projetos que já são raiz respondem com erro.
PUT
/
api
/
management
/
projects
/
{project}
/
hierarchy
/
promote-to-root
Promover um projeto a raiz
curl --request PUT \
--url https://api.olie.ai/api/management/projects/{project}/hierarchy/promote-to-root \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.olie.ai/api/management/projects/{project}/hierarchy/promote-to-root"
headers = {"Authorization": "Bearer <token>"}
response = requests.put(url, headers=headers)
print(response.text)const options = {method: 'PUT', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.olie.ai/api/management/projects/{project}/hierarchy/promote-to-root', 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/promote-to-root",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
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.olie.ai/api/management/projects/{project}/hierarchy/promote-to-root"
req, _ := http.NewRequest("PUT", 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.put("https://api.olie.ai/api/management/projects/{project}/hierarchy/promote-to-root")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olie.ai/api/management/projects/{project}/hierarchy/promote-to-root")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"response": true,
"data": {
"project": {
"id": "019e0f21-4b3c-71a8-8f0e-9c2d5a7b1e40",
"name": "Fundação",
"is_root": true
},
"former_parent": {
"id": "019e0edb-aa7c-70c4-9d2d-3a2f175b5ddf",
"name": "Shopping Center"
}
}
}{
"response": false,
"message": "Project is already at root level"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID (UUID) do projeto.
Was this page helpful?