List or search Gmail messages as the calling member
curl --request GET \
--url http://api.den.local/v1/capabilities/google-workspace/gmail-messagesimport requests
url = "http://api.den.local/v1/capabilities/google-workspace/gmail-messages"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('http://api.den.local/v1/capabilities/google-workspace/gmail-messages', 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 => "http://api.den.local/v1/capabilities/google-workspace/gmail-messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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 := "http://api.den.local/v1/capabilities/google-workspace/gmail-messages"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://api.den.local/v1/capabilities/google-workspace/gmail-messages")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.den.local/v1/capabilities/google-workspace/gmail-messages")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"ok": true,
"messages": [
{
"id": "<string>",
"threadId": "<string>",
"from": "<string>",
"to": "<string>",
"bcc": "<string>",
"subject": "<string>",
"date": "<string>",
"snippet": "<string>"
}
]
}{
"error": "unauthorized"
}{
"error": "needs_connection",
"message": "<string>"
}{
"error": "google_api_error",
"message": "<string>"
}Capability Sources
List or search Gmail messages as the calling member
Reads and searches inbox mail in the calling member’s Gmail mailbox, using the Google account they connected through the org Google Workspace connection. Returns needs_connection when the member has not connected their Google account yet or the connection lacks Gmail read permission.
GET
/
v1
/
capabilities
/
google-workspace
/
gmail-messages
List or search Gmail messages as the calling member
curl --request GET \
--url http://api.den.local/v1/capabilities/google-workspace/gmail-messagesimport requests
url = "http://api.den.local/v1/capabilities/google-workspace/gmail-messages"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('http://api.den.local/v1/capabilities/google-workspace/gmail-messages', 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 => "http://api.den.local/v1/capabilities/google-workspace/gmail-messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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 := "http://api.den.local/v1/capabilities/google-workspace/gmail-messages"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://api.den.local/v1/capabilities/google-workspace/gmail-messages")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.den.local/v1/capabilities/google-workspace/gmail-messages")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"ok": true,
"messages": [
{
"id": "<string>",
"threadId": "<string>",
"from": "<string>",
"to": "<string>",
"bcc": "<string>",
"subject": "<string>",
"date": "<string>",
"snippet": "<string>"
}
]
}{
"error": "unauthorized"
}{
"error": "needs_connection",
"message": "<string>"
}{
"error": "google_api_error",
"message": "<string>"
}Query Parameters
Optional Gmail search query, using Gmail's search syntax.
Required string length:
1 - 1000Maximum messages to return, capped at 25.
Required range:
1 <= x <= 25Was this page helpful?