List email threads
curl --request GET \
--url https://api.aisa.one/apis/v1/social/messaging/email/threads \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/social/messaging/email/threads"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aisa.one/apis/v1/social/messaging/email/threads', 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.aisa.one/apis/v1/social/messaging/email/threads",
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.aisa.one/apis/v1/social/messaging/email/threads"
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.aisa.one/apis/v1/social/messaging/email/threads")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/social/messaging/email/threads")
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{
"data": [
{
"connectionId": "<string>",
"draftIds": [
"<string>"
],
"earliestMessageAt": "2023-11-07T05:31:56Z",
"folders": [
"<string>"
],
"hasAttachments": true,
"hasDrafts": true,
"id": "<string>",
"latestMessageReceivedAt": "2023-11-07T05:31:56Z",
"latestMessageSentAt": "2023-11-07T05:31:56Z",
"messageIds": [
"<string>"
],
"participants": [
{
"email": "jsmith@example.com",
"name": "<string>"
}
],
"provider": "google",
"snippet": "<string>",
"starred": true,
"subject": "<string>",
"unread": true
}
],
"meta": {
"filteredClientSide": [
"<string>"
]
},
"pagination": {
"hasMore": true,
"nextCursor": "<string>"
}
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "<string>",
"retryable": true,
"type": "<string>"
}
}AIsa Messaging
List email threads
Email. Threads of a connected Google or Microsoft mailbox, newest first. Every filter that the provider cannot apply server-side is applied to the fetched page instead and named in meta.filteredClientSide, so a filtered page can hold fewer than limit items while pagination.hasMore stays true.
On Google, folders are Gmail labels: folder takes a well-known name or a label id, archive means mail carrying none of the inbox, trash or spam labels, and sortOrder=asc reverses the fetched page (Gmail lists newest first only).
GET
https://api.aisa.one
/
apis
/
v1
/
social
/
messaging
/
email
/
threads
List email threads
curl --request GET \
--url https://api.aisa.one/apis/v1/social/messaging/email/threads \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.aisa.one/apis/v1/social/messaging/email/threads"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.aisa.one/apis/v1/social/messaging/email/threads', 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.aisa.one/apis/v1/social/messaging/email/threads",
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.aisa.one/apis/v1/social/messaging/email/threads"
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.aisa.one/apis/v1/social/messaging/email/threads")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/social/messaging/email/threads")
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{
"data": [
{
"connectionId": "<string>",
"draftIds": [
"<string>"
],
"earliestMessageAt": "2023-11-07T05:31:56Z",
"folders": [
"<string>"
],
"hasAttachments": true,
"hasDrafts": true,
"id": "<string>",
"latestMessageReceivedAt": "2023-11-07T05:31:56Z",
"latestMessageSentAt": "2023-11-07T05:31:56Z",
"messageIds": [
"<string>"
],
"participants": [
{
"email": "jsmith@example.com",
"name": "<string>"
}
],
"provider": "google",
"snippet": "<string>",
"starred": true,
"subject": "<string>",
"unread": true
}
],
"meta": {
"filteredClientSide": [
"<string>"
]
},
"pagination": {
"hasMore": true,
"nextCursor": "<string>"
}
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "<string>",
"retryable": true,
"type": "<string>"
}
}Request contract
- Method and path: GET /apis/v1/social/messaging/email/threads
- Availability: enabled
- Request URL template:
https://api.aisa.one/apis/v1/social/messaging/email/threads - connectionId: query; required
- folder: query; optional
- unread: query; optional
- starred: query; optional
- hasAttachment: query; optional
- subject: query; optional
- from: query; optional
- to: query; optional
- cc: query; optional
- bcc: query; optional
- anyEmail: query; optional
- after: query; optional
- before: query; optional
- searchQueryNative: query; optional
- sortOrder: query; optional
- cursor: query; optional
- limit: query; optional
{
"operationId": "get_aisa_messaging_apis_v1_social_messaging_email_f221e4",
"method": "GET",
"path": "/apis/v1/social/messaging/email/threads",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [
{
"description": "Your messaging connection (msc_...), from GET /apis/v1/social/messaging/connections.",
"in": "query",
"name": "connectionId",
"required": true,
"schema": {
"pattern": "^msc_[0-9A-Za-z]+$",
"type": "string"
}
},
{
"description": "Well-known folder (`inbox`, `sent`, `drafts`, `trash`, `spam`, `archive`) or a provider folder id from `GET /apis/v1/social/messaging/email/folders`. Default inbox.",
"in": "query",
"name": "folder",
"required": false,
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "unread",
"required": false,
"schema": {
"type": "boolean"
}
},
{
"in": "query",
"name": "starred",
"required": false,
"schema": {
"type": "boolean"
}
},
{
"in": "query",
"name": "hasAttachment",
"required": false,
"schema": {
"type": "boolean"
}
},
{
"description": "Substring match on the subject.",
"in": "query",
"name": "subject",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Sender address.",
"in": "query",
"name": "from",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "A recipient address.",
"in": "query",
"name": "to",
"required": false,
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "cc",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Applied client-side on Microsoft.",
"in": "query",
"name": "bcc",
"required": false,
"schema": {
"type": "string"
}
},
{
"description": "Matches from, to, cc or bcc. Applied client-side on Microsoft.",
"in": "query",
"name": "anyEmail",
"required": false,
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "after",
"required": false,
"schema": {
"format": "date-time",
"type": "string"
}
},
{
"in": "query",
"name": "before",
"required": false,
"schema": {
"format": "date-time",
"type": "string"
}
},
{
"description": "The provider's own search syntax (Gmail search operators, Microsoft KQL). On Microsoft it cannot be combined with other filters or server-side ordering; those are applied to the page.",
"in": "query",
"name": "searchQueryNative",
"required": false,
"schema": {
"maxLength": 500,
"type": "string"
}
},
{
"in": "query",
"name": "sortOrder",
"required": false,
"schema": {
"default": "desc",
"enum": [
"asc",
"desc"
],
"type": "string"
}
},
{
"in": "query",
"name": "cursor",
"required": false,
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "limit",
"required": false,
"schema": {
"default": 50,
"maximum": 200,
"minimum": 1,
"type": "integer"
}
}
],
"security": [
{
"bearerAuth": []
}
],
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}