Agent Tools
Read a Google Sheet's column headers
Returns the header row of the agent’s connected spreadsheet, plus the available tab names.
Worth the round trip: a mistyped column name does not error at call time, it soft-fails to an empty value. Discover the real headers here before you write a lookup_row hook against them.
GET
/
agent
/
{id}
/
tools
/
google_sheets
/
sheet-columns
Read a Google Sheet's column headers
curl --request GET \
--url https://api.vocobase.com/api/v2/agent/{id}/tools/google_sheets/sheet-columns \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.vocobase.com/api/v2/agent/{id}/tools/google_sheets/sheet-columns"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.vocobase.com/api/v2/agent/{id}/tools/google_sheets/sheet-columns', 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.vocobase.com/api/v2/agent/{id}/tools/google_sheets/sheet-columns",
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.vocobase.com/api/v2/agent/{id}/tools/google_sheets/sheet-columns"
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.vocobase.com/api/v2/agent/{id}/tools/google_sheets/sheet-columns")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vocobase.com/api/v2/agent/{id}/tools/google_sheets/sheet-columns")
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{
"success": true,
"data": {
"columns": [
"Name",
"Phone",
"Plan",
"Renews On"
],
"sheet_name": "Leads",
"spreadsheet_id": "1AbC...",
"tabs": [
"Leads",
"Archive"
],
"truncated": false
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "sheet_name must be a string"
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found"
}
}{
"success": false,
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded. Retry after 60 seconds."
}
}{
"success": false,
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred"
}
}Authorizations
API key in format: rg_live_xxxx. Pass as a Bearer token in the Authorization header.
Path Parameters
Agent ID.
Query Parameters
Spreadsheet to read. Defaults to the one configured on the agent.
Tab to read. Defaults to the first tab.
⌘I
Read a Google Sheet's column headers
curl --request GET \
--url https://api.vocobase.com/api/v2/agent/{id}/tools/google_sheets/sheet-columns \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.vocobase.com/api/v2/agent/{id}/tools/google_sheets/sheet-columns"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.vocobase.com/api/v2/agent/{id}/tools/google_sheets/sheet-columns', 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.vocobase.com/api/v2/agent/{id}/tools/google_sheets/sheet-columns",
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.vocobase.com/api/v2/agent/{id}/tools/google_sheets/sheet-columns"
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.vocobase.com/api/v2/agent/{id}/tools/google_sheets/sheet-columns")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vocobase.com/api/v2/agent/{id}/tools/google_sheets/sheet-columns")
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{
"success": true,
"data": {
"columns": [
"Name",
"Phone",
"Plan",
"Renews On"
],
"sheet_name": "Leads",
"spreadsheet_id": "1AbC...",
"tabs": [
"Leads",
"Archive"
],
"truncated": false
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "sheet_name must be a string"
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
}{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Resource not found"
}
}{
"success": false,
"error": {
"code": "RATE_LIMITED",
"message": "Rate limit exceeded. Retry after 60 seconds."
}
}{
"success": false,
"error": {
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred"
}
}