curl --request POST \
--url https://api.olie.ai/api/management/project-groups/{project_group}/projects/{project_id}/reorder \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"order": 0
}'import requests
url = "https://api.olie.ai/api/management/project-groups/{project_group}/projects/{project_id}/reorder"
payload = { "order": 0 }
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({order: 0})
};
fetch('https://api.olie.ai/api/management/project-groups/{project_group}/projects/{project_id}/reorder', 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/project-groups/{project_group}/projects/{project_id}/reorder",
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([
'order' => 0
]),
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/project-groups/{project_group}/projects/{project_id}/reorder"
payload := strings.NewReader("{\n \"order\": 0\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/project-groups/{project_group}/projects/{project_id}/reorder")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"order\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olie.ai/api/management/project-groups/{project_group}/projects/{project_id}/reorder")
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 \"order\": 0\n}"
response = http.request(request)
puts response.read_body{
"response": true
}{
"response": false,
"message": "project_model_not_found",
"error": "No query results for model [App\\\\Models\\\\Project] 00000000-0000-0000-0000-000000000000"
}{
"response": false,
"message": "validation_errors",
"error": "O campo order é obrigatório.",
"validation": {
"order": [
"O campo order é obrigatório."
]
}
}Alterar a ordem de um projeto dentro de um grupo
Define a posição do projeto dentro do grupo; a listagem de projetos do grupo passa a usar esse valor. A posição é gravada apenas para o projeto informado — os demais não são renumerados, então repetir uma posição já ocupada deixa os dois projetos empatados e a ordem entre eles fica indefinida.
curl --request POST \
--url https://api.olie.ai/api/management/project-groups/{project_group}/projects/{project_id}/reorder \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"order": 0
}'import requests
url = "https://api.olie.ai/api/management/project-groups/{project_group}/projects/{project_id}/reorder"
payload = { "order": 0 }
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({order: 0})
};
fetch('https://api.olie.ai/api/management/project-groups/{project_group}/projects/{project_id}/reorder', 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/project-groups/{project_group}/projects/{project_id}/reorder",
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([
'order' => 0
]),
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/project-groups/{project_group}/projects/{project_id}/reorder"
payload := strings.NewReader("{\n \"order\": 0\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/project-groups/{project_group}/projects/{project_id}/reorder")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"order\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olie.ai/api/management/project-groups/{project_group}/projects/{project_id}/reorder")
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 \"order\": 0\n}"
response = http.request(request)
puts response.read_body{
"response": true
}{
"response": false,
"message": "project_model_not_found",
"error": "No query results for model [App\\\\Models\\\\Project] 00000000-0000-0000-0000-000000000000"
}{
"response": false,
"message": "validation_errors",
"error": "O campo order é obrigatório.",
"validation": {
"order": [
"O campo order é obrigatório."
]
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID (UUID) do grupo de projetos.
ID (UUID) do projeto que será reposicionado. Ele precisa já pertencer ao grupo.
Body
Nova posição do projeto dentro do grupo.
Posição do projeto na lista do grupo, começando em 0. Vale apenas para este projeto: os demais não são renumerados.
x >= 0Response
Sucesso
Confirmação da nova posição do projeto no grupo.
Sempre true quando a operação foi concluída.
Was this page helpful?