Functions
Get the linked repository
The link and its last deploy. Never returns the webhook secret.
GET
/
v1
/
functions
/
{functionId}
/
git-link
Get the linked repository
curl --request GET \
--url https://api.zavu.dev/v1/functions/{functionId}/git-link \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.zavu.dev/v1/functions/{functionId}/git-link"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zavu.dev/v1/functions/{functionId}/git-link', 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.zavu.dev/v1/functions/{functionId}/git-link",
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>"
],
]);
$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.zavu.dev/v1/functions/{functionId}/git-link"
req, _ := http.NewRequest("GET", 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.get("https://api.zavu.dev/v1/functions/{functionId}/git-link")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zavu.dev/v1/functions/{functionId}/git-link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"link": {
"id": "<string>",
"functionId": "<string>",
"provider": "github",
"owner": "acme",
"repo": "order-bot",
"branch": "main",
"autoDeploy": true,
"connection": "app",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"rootDir": "<string>",
"lastStatus": "deploying",
"lastCommitSha": "<string>",
"lastCommitMessage": "<string>",
"lastError": "<string>",
"lastDeployAt": "2023-11-07T05:31:56Z"
},
"webhookUrl": "<string>",
"webhookSecret": "ghs_a1b2c3..."
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Zavu Function ID.
Response
The link.
A GitHub repository bound to a function. A push to branch deploys the function. A function holds at most one link.
Show child attributes
Show child attributes
Endpoint that receives GitHub's push deliveries. Only needed on a manual link, where you add it to the repository yourself.
Shared secret for the repository's webhook. Returned only when creating a manual link, and only there — every later read strips it, and re-linking mints a new one. Absent entirely on an app link, which needs no secret of its own.
Example:
"ghs_a1b2c3..."
⌘I
Get the linked repository
curl --request GET \
--url https://api.zavu.dev/v1/functions/{functionId}/git-link \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.zavu.dev/v1/functions/{functionId}/git-link"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zavu.dev/v1/functions/{functionId}/git-link', 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.zavu.dev/v1/functions/{functionId}/git-link",
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>"
],
]);
$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.zavu.dev/v1/functions/{functionId}/git-link"
req, _ := http.NewRequest("GET", 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.get("https://api.zavu.dev/v1/functions/{functionId}/git-link")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zavu.dev/v1/functions/{functionId}/git-link")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"link": {
"id": "<string>",
"functionId": "<string>",
"provider": "github",
"owner": "acme",
"repo": "order-bot",
"branch": "main",
"autoDeploy": true,
"connection": "app",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"rootDir": "<string>",
"lastStatus": "deploying",
"lastCommitSha": "<string>",
"lastCommitMessage": "<string>",
"lastError": "<string>",
"lastDeployAt": "2023-11-07T05:31:56Z"
},
"webhookUrl": "<string>",
"webhookSecret": "ghs_a1b2c3..."
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}