List branches
curl --request GET \
--url https://unify.bundleup.io/v1/git/repos/{repo}/branches \
--header 'Authorization: Bearer <token>' \
--header 'BU-Connection-ID: <bu-connection-id>'import requests
url = "https://unify.bundleup.io/v1/git/repos/{repo}/branches"
headers = {
"Authorization": "Bearer <token>",
"BU-Connection-ID": "<bu-connection-id>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'BU-Connection-ID': '<bu-connection-id>'}
};
fetch('https://unify.bundleup.io/v1/git/repos/{repo}/branches', 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://unify.bundleup.io/v1/git/repos/{repo}/branches",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"BU-Connection-ID: <bu-connection-id>"
],
]);
$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://unify.bundleup.io/v1/git/repos/{repo}/branches"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("BU-Connection-ID", "<bu-connection-id>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://unify.bundleup.io/v1/git/repos/{repo}/branches")
.header("Authorization", "Bearer <token>")
.header("BU-Connection-ID", "<bu-connection-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://unify.bundleup.io/v1/git/repos/{repo}/branches")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["BU-Connection-ID"] = '<bu-connection-id>'
response = http.request(request)
puts response.read_body{
"response": {
"data": [
{
"name": "<string>",
"commit_sha": "<string>",
"protected": true
}
],
"metadata": {
"next": "<string>"
}
}
}{
"success": false,
"errors": [
{
"code": 7001,
"message": "Input Validation Error",
"path": [
"body"
]
}
]
}{
"success": false,
"errors": [
{
"code": 1000,
"message": "Not Authorized"
}
]
}{
"success": false,
"errors": [
{
"code": 7002,
"message": "Not Found"
}
]
}Git
List branches
List branches for a git repository on GitHub, GitLab and Bitbucket
GET
/
v1
/
git
/
repos
/
{repo}
/
branches
List branches
curl --request GET \
--url https://unify.bundleup.io/v1/git/repos/{repo}/branches \
--header 'Authorization: Bearer <token>' \
--header 'BU-Connection-ID: <bu-connection-id>'import requests
url = "https://unify.bundleup.io/v1/git/repos/{repo}/branches"
headers = {
"Authorization": "Bearer <token>",
"BU-Connection-ID": "<bu-connection-id>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'BU-Connection-ID': '<bu-connection-id>'}
};
fetch('https://unify.bundleup.io/v1/git/repos/{repo}/branches', 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://unify.bundleup.io/v1/git/repos/{repo}/branches",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"BU-Connection-ID: <bu-connection-id>"
],
]);
$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://unify.bundleup.io/v1/git/repos/{repo}/branches"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("BU-Connection-ID", "<bu-connection-id>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://unify.bundleup.io/v1/git/repos/{repo}/branches")
.header("Authorization", "Bearer <token>")
.header("BU-Connection-ID", "<bu-connection-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://unify.bundleup.io/v1/git/repos/{repo}/branches")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["BU-Connection-ID"] = '<bu-connection-id>'
response = http.request(request)
puts response.read_body{
"response": {
"data": [
{
"name": "<string>",
"commit_sha": "<string>",
"protected": true
}
],
"metadata": {
"next": "<string>"
}
}
}{
"success": false,
"errors": [
{
"code": 7001,
"message": "Input Validation Error",
"path": [
"body"
]
}
]
}{
"success": false,
"errors": [
{
"code": 1000,
"message": "Not Authorized"
}
]
}{
"success": false,
"errors": [
{
"code": 7002,
"message": "Not Found"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
API Key for authentication
Connection ID for the integration
Maximum number of retries for the request
Path Parameters
Repository name
Query Parameters
Whether to include raw response from the provider
Available options:
true, false Optional passthrough parameter
Example:
"{\"team_id\":\"12345\"}"
Number of branches to return
Required range:
1 <= x <= 100Cursor for pagination
Response
Successful Response For branches
Show child attributes
Show child attributes
Was this page helpful?
⌘I

