Connect template to GitHub repository
curl --request POST \
--url https://app.apigene.ai/api/ui-templates/github/connect/{api_name}/{template_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"repo_owner": "<string>",
"repo_name": "<string>",
"github_token": "<string>",
"branch": "main",
"repo_path": "<string>",
"auto_sync": false,
"sync_direction": "bidirectional",
"on_conflict": "manual"
}
'import requests
url = "https://app.apigene.ai/api/ui-templates/github/connect/{api_name}/{template_id}"
payload = {
"repo_owner": "<string>",
"repo_name": "<string>",
"github_token": "<string>",
"branch": "main",
"repo_path": "<string>",
"auto_sync": False,
"sync_direction": "bidirectional",
"on_conflict": "manual"
}
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({
repo_owner: '<string>',
repo_name: '<string>',
github_token: '<string>',
branch: 'main',
repo_path: '<string>',
auto_sync: false,
sync_direction: 'bidirectional',
on_conflict: 'manual'
})
};
fetch('https://app.apigene.ai/api/ui-templates/github/connect/{api_name}/{template_id}', 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://app.apigene.ai/api/ui-templates/github/connect/{api_name}/{template_id}",
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([
'repo_owner' => '<string>',
'repo_name' => '<string>',
'github_token' => '<string>',
'branch' => 'main',
'repo_path' => '<string>',
'auto_sync' => false,
'sync_direction' => 'bidirectional',
'on_conflict' => 'manual'
]),
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://app.apigene.ai/api/ui-templates/github/connect/{api_name}/{template_id}"
payload := strings.NewReader("{\n \"repo_owner\": \"<string>\",\n \"repo_name\": \"<string>\",\n \"github_token\": \"<string>\",\n \"branch\": \"main\",\n \"repo_path\": \"<string>\",\n \"auto_sync\": false,\n \"sync_direction\": \"bidirectional\",\n \"on_conflict\": \"manual\"\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://app.apigene.ai/api/ui-templates/github/connect/{api_name}/{template_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"repo_owner\": \"<string>\",\n \"repo_name\": \"<string>\",\n \"github_token\": \"<string>\",\n \"branch\": \"main\",\n \"repo_path\": \"<string>\",\n \"auto_sync\": false,\n \"sync_direction\": \"bidirectional\",\n \"on_conflict\": \"manual\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.apigene.ai/api/ui-templates/github/connect/{api_name}/{template_id}")
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 \"repo_owner\": \"<string>\",\n \"repo_name\": \"<string>\",\n \"github_token\": \"<string>\",\n \"branch\": \"main\",\n \"repo_path\": \"<string>\",\n \"auto_sync\": false,\n \"sync_direction\": \"bidirectional\",\n \"on_conflict\": \"manual\"\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}GitHub Sync
Connect template to GitHub repository
Connect a template to a GitHub repository for syncing.
POST
/
api
/
ui-templates
/
github
/
connect
/
{api_name}
/
{template_id}
Connect template to GitHub repository
curl --request POST \
--url https://app.apigene.ai/api/ui-templates/github/connect/{api_name}/{template_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"repo_owner": "<string>",
"repo_name": "<string>",
"github_token": "<string>",
"branch": "main",
"repo_path": "<string>",
"auto_sync": false,
"sync_direction": "bidirectional",
"on_conflict": "manual"
}
'import requests
url = "https://app.apigene.ai/api/ui-templates/github/connect/{api_name}/{template_id}"
payload = {
"repo_owner": "<string>",
"repo_name": "<string>",
"github_token": "<string>",
"branch": "main",
"repo_path": "<string>",
"auto_sync": False,
"sync_direction": "bidirectional",
"on_conflict": "manual"
}
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({
repo_owner: '<string>',
repo_name: '<string>',
github_token: '<string>',
branch: 'main',
repo_path: '<string>',
auto_sync: false,
sync_direction: 'bidirectional',
on_conflict: 'manual'
})
};
fetch('https://app.apigene.ai/api/ui-templates/github/connect/{api_name}/{template_id}', 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://app.apigene.ai/api/ui-templates/github/connect/{api_name}/{template_id}",
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([
'repo_owner' => '<string>',
'repo_name' => '<string>',
'github_token' => '<string>',
'branch' => 'main',
'repo_path' => '<string>',
'auto_sync' => false,
'sync_direction' => 'bidirectional',
'on_conflict' => 'manual'
]),
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://app.apigene.ai/api/ui-templates/github/connect/{api_name}/{template_id}"
payload := strings.NewReader("{\n \"repo_owner\": \"<string>\",\n \"repo_name\": \"<string>\",\n \"github_token\": \"<string>\",\n \"branch\": \"main\",\n \"repo_path\": \"<string>\",\n \"auto_sync\": false,\n \"sync_direction\": \"bidirectional\",\n \"on_conflict\": \"manual\"\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://app.apigene.ai/api/ui-templates/github/connect/{api_name}/{template_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"repo_owner\": \"<string>\",\n \"repo_name\": \"<string>\",\n \"github_token\": \"<string>\",\n \"branch\": \"main\",\n \"repo_path\": \"<string>\",\n \"auto_sync\": false,\n \"sync_direction\": \"bidirectional\",\n \"on_conflict\": \"manual\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.apigene.ai/api/ui-templates/github/connect/{api_name}/{template_id}")
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 \"repo_owner\": \"<string>\",\n \"repo_name\": \"<string>\",\n \"github_token\": \"<string>\",\n \"branch\": \"main\",\n \"repo_path\": \"<string>\",\n \"auto_sync\": false,\n \"sync_direction\": \"bidirectional\",\n \"on_conflict\": \"manual\"\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
JWT Authorization header using the Bearer scheme. Example: 'Authorization: Bearer {token}'
Body
application/json
Request to connect template to GitHub.
GitHub repository owner
GitHub repository name
GitHub Personal Access Token
Branch name
Optional custom repository path
Enable auto-sync on save
Sync direction
Available options:
push, pull, bidirectional Conflict resolution strategy
Available options:
manual, local, remote Response
Successful Response
⌘I
