Search Emails
curl --request GET \
--url https://omnicommerce.ai/api/v1/email/search \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://omnicommerce.ai/api/v1/email/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://omnicommerce.ai/api/v1/email/search"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"ok": true,
"operationId": "<string>",
"status": "<string>",
"data": {
"connectionId": "<string>",
"provider": "gmail",
"emailAddress": "<string>",
"query": "<string>",
"results": [
{
"id": "<string>",
"threadId": "<string>",
"subject": "<string>",
"from": "<string>",
"to": "<string>",
"date": "<string>",
"snippet": "<string>",
"isRead": true,
"isDraft": true
}
],
"count": 123,
"nextPageToken": "<string>"
}
}Email
Search Emails
One page of message summaries (subject, from, to, date, snippet, read and draft state) from your mailbox. Gmail accepts its search operators (from:, subject:, newer_than:); Outlook takes free text.
Pass nextPageToken back as pageToken with the same mailbox, query, readState and maxResults until it is null; a token is refused with different search arguments. readState=unread filters unread messages, which is not the same as unreplied.
Authorization
Requires email:read and the integration permission the matching chat tool needs, with a person’s credential: a CLI login, a signed-in session, or the SDK key inside your own chat sandbox. Only your own connected mailboxes are reachable; another account’s connectionId is refused.
GET
/
api
/
v1
/
email
/
search
Search Emails
curl --request GET \
--url https://omnicommerce.ai/api/v1/email/search \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://omnicommerce.ai/api/v1/email/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://omnicommerce.ai/api/v1/email/search"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"ok": true,
"operationId": "<string>",
"status": "<string>",
"data": {
"connectionId": "<string>",
"provider": "gmail",
"emailAddress": "<string>",
"query": "<string>",
"results": [
{
"id": "<string>",
"threadId": "<string>",
"subject": "<string>",
"from": "<string>",
"to": "<string>",
"date": "<string>",
"snippet": "<string>",
"isRead": true,
"isDraft": true
}
],
"count": 123,
"nextPageToken": "<string>"
}
}