Créer une équipe
curl --request POST \
--url https://www.corgea.app/api/v1/teams \
--header 'CORGEA-TOKEN: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Payments Team",
"member_ids": [
12,
34
],
"project_ids": [
101
],
"project_tags": [
"payments",
"backend"
],
"repo_url_patterns": [
"github.com/acme/payments-"
]
}
'import requests
url = "https://www.corgea.app/api/v1/teams"
payload = {
"name": "Payments Team",
"member_ids": [12, 34],
"project_ids": [101],
"project_tags": ["payments", "backend"],
"repo_url_patterns": ["github.com/acme/payments-"]
}
headers = {
"CORGEA-TOKEN": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'CORGEA-TOKEN': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Payments Team',
member_ids: [12, 34],
project_ids: [101],
project_tags: ['payments', 'backend'],
repo_url_patterns: ['github.com/acme/payments-']
})
};
fetch('https://www.corgea.app/api/v1/teams', 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://www.corgea.app/api/v1/teams",
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([
'name' => 'Payments Team',
'member_ids' => [
12,
34
],
'project_ids' => [
101
],
'project_tags' => [
'payments',
'backend'
],
'repo_url_patterns' => [
'github.com/acme/payments-'
]
]),
CURLOPT_HTTPHEADER => [
"CORGEA-TOKEN: <api-key>",
"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://www.corgea.app/api/v1/teams"
payload := strings.NewReader("{\n \"name\": \"Payments Team\",\n \"member_ids\": [\n 12,\n 34\n ],\n \"project_ids\": [\n 101\n ],\n \"project_tags\": [\n \"payments\",\n \"backend\"\n ],\n \"repo_url_patterns\": [\n \"github.com/acme/payments-\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("CORGEA-TOKEN", "<api-key>")
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://www.corgea.app/api/v1/teams")
.header("CORGEA-TOKEN", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Payments Team\",\n \"member_ids\": [\n 12,\n 34\n ],\n \"project_ids\": [\n 101\n ],\n \"project_tags\": [\n \"payments\",\n \"backend\"\n ],\n \"repo_url_patterns\": [\n \"github.com/acme/payments-\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.corgea.app/api/v1/teams")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["CORGEA-TOKEN"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Payments Team\",\n \"member_ids\": [\n 12,\n 34\n ],\n \"project_ids\": [\n 101\n ],\n \"project_tags\": [\n \"payments\",\n \"backend\"\n ],\n \"repo_url_patterns\": [\n \"github.com/acme/payments-\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"team": {
"id": 123,
"name": "<string>",
"active": true,
"members": [
{
"id": 123,
"email": "jsmith@example.com",
"first_name": "<string>",
"last_name": "<string>"
}
],
"project_ids": [
123
],
"project_tags": [
"<string>"
],
"repo_url_patterns": [
"<string>"
],
"project_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": "Invalid JSON body"
}{
"error": "Missing or invalid authorization header"
}{
"error": "Permission denied"
}Équipes
Créer une équipe
Crée une équipe et lui affecte éventuellement des membres, des projets explicites, des sélecteurs de tags de projet et des sélecteurs de fragments d’URL de dépôt. Nécessite l’autorisation user_management.change_content_access.
POST
/
teams
Créer une équipe
curl --request POST \
--url https://www.corgea.app/api/v1/teams \
--header 'CORGEA-TOKEN: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Payments Team",
"member_ids": [
12,
34
],
"project_ids": [
101
],
"project_tags": [
"payments",
"backend"
],
"repo_url_patterns": [
"github.com/acme/payments-"
]
}
'import requests
url = "https://www.corgea.app/api/v1/teams"
payload = {
"name": "Payments Team",
"member_ids": [12, 34],
"project_ids": [101],
"project_tags": ["payments", "backend"],
"repo_url_patterns": ["github.com/acme/payments-"]
}
headers = {
"CORGEA-TOKEN": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'CORGEA-TOKEN': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Payments Team',
member_ids: [12, 34],
project_ids: [101],
project_tags: ['payments', 'backend'],
repo_url_patterns: ['github.com/acme/payments-']
})
};
fetch('https://www.corgea.app/api/v1/teams', 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://www.corgea.app/api/v1/teams",
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([
'name' => 'Payments Team',
'member_ids' => [
12,
34
],
'project_ids' => [
101
],
'project_tags' => [
'payments',
'backend'
],
'repo_url_patterns' => [
'github.com/acme/payments-'
]
]),
CURLOPT_HTTPHEADER => [
"CORGEA-TOKEN: <api-key>",
"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://www.corgea.app/api/v1/teams"
payload := strings.NewReader("{\n \"name\": \"Payments Team\",\n \"member_ids\": [\n 12,\n 34\n ],\n \"project_ids\": [\n 101\n ],\n \"project_tags\": [\n \"payments\",\n \"backend\"\n ],\n \"repo_url_patterns\": [\n \"github.com/acme/payments-\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("CORGEA-TOKEN", "<api-key>")
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://www.corgea.app/api/v1/teams")
.header("CORGEA-TOKEN", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Payments Team\",\n \"member_ids\": [\n 12,\n 34\n ],\n \"project_ids\": [\n 101\n ],\n \"project_tags\": [\n \"payments\",\n \"backend\"\n ],\n \"repo_url_patterns\": [\n \"github.com/acme/payments-\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.corgea.app/api/v1/teams")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["CORGEA-TOKEN"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Payments Team\",\n \"member_ids\": [\n 12,\n 34\n ],\n \"project_ids\": [\n 101\n ],\n \"project_tags\": [\n \"payments\",\n \"backend\"\n ],\n \"repo_url_patterns\": [\n \"github.com/acme/payments-\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"team": {
"id": 123,
"name": "<string>",
"active": true,
"members": [
{
"id": 123,
"email": "jsmith@example.com",
"first_name": "<string>",
"last_name": "<string>"
}
],
"project_ids": [
123
],
"project_tags": [
"<string>"
],
"repo_url_patterns": [
"<string>"
],
"project_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"error": "Invalid JSON body"
}{
"error": "Missing or invalid authorization header"
}{
"error": "Permission denied"
}Autorisations
CorgeaTokenBearerAuth
Clé API pour l'authentification Les jetons API des utilisateurs inactifs sont refusés.
Corps
application/json
ID des projets à affecter explicitement.
Tags qui accordent dynamiquement l’accès aux projets correspondants.
Fragments d’URL de dépôt qui accordent dynamiquement l’accès aux projets correspondants.
Minimum string length:
3Réponse
Équipe créée avec succès
Show child attributes
Show child attributes
Cette page vous a-t-elle été utile ?
