Get Started
Indexing
- Get Started
- Guides
- Authentication
- Datasources
- Documents
- Debugging
- API Reference
- OpenAPI Spec
Client
- Get Started
- Guides
- Search
- Governance
- API Reference
- Activity
- Announcements
- Answers
- Authentication
- Chat
- Agents
- Collections
- Documents
- Insights
- Messages
- Pins
- Search
- Entities
- Shortcuts
- Summarize
- Verification
- Tools
- Governance
- OpenAPI Spec
Web SDK
- Get Started
- Components
- Guides
Actions
- Get Started
- Examples
Messages
Read messages
Retrieves list of messages from messaging/chat datasources (e.g. Slack, Teams).
POST
/
rest
/
api
/
v1
/
messages
from glean import Glean, models
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as g_client:
res = g_client.client.messages.retrieve(id_type=models.IDType.CONVERSATION_ID, id="<id>")
# Handle response
print(res)
{
"hasMore": true,
"searchResponse": {
"trackingToken": "trackingToken",
"suggestedSpellCorrectedQuery": "suggestedSpellCorrectedQuery",
"hasMoreResults": true,
"errorInfo": {
"errorMessages": [
{
"source": "gmail",
"errorMessage": "invalid token"
},
{
"source": "slack",
"errorMessage": "expired token"
}
]
},
"requestID": "5e345ae500ff0befa2b9d1a3ba0001737e7363696f312d323535323137000171756572792d656e64706f696e743a323032303031333074313830343032000100",
"results": [
{
"snippets": [
{
"snippet": "snippet",
"mimeType": "mimeType"
}
],
"metadata": {
"container": "container",
"createTime": "2000-01-23T04:56:07.000Z",
"datasource": "datasource",
"author": {
"name": "name"
},
"documentId": "documentId",
"updateTime": "2000-01-23T04:56:07.000Z",
"mimeType": "mimeType",
"objectType": "objectType"
},
"title": "title",
"url": "https://www.example.com/"
},
{
"snippets": [
{
"snippet": "snippet",
"mimeType": "mimeType"
}
],
"metadata": {
"container": "container",
"createTime": "2000-01-23T04:56:07.000Z",
"datasource": "datasource",
"author": {
"name": "name"
},
"documentId": "documentId",
"updateTime": "2000-01-23T04:56:07.000Z",
"mimeType": "mimeType",
"objectType": "objectType"
},
"title": "title",
"url": "https://www.example.com/"
}
],
"facetResults": [
{
"buckets": [
{
"percentage": 5,
"count": 1,
"value": {
"stringValue": "stringValue",
"integerValue": 5
}
},
{
"percentage": 5,
"count": 1,
"value": {
"stringValue": "stringValue",
"integerValue": 5
}
}
],
"sourceName": "sourceName",
"operatorName": "operatorName",
"objectType": "objectType"
},
{
"buckets": [
{
"percentage": 5,
"count": 1,
"value": {
"stringValue": "stringValue",
"integerValue": 5
}
},
{
"percentage": 5,
"count": 1,
"value": {
"stringValue": "stringValue",
"integerValue": 5
}
}
],
"sourceName": "sourceName",
"operatorName": "operatorName",
"objectType": "objectType"
}
],
"rewrittenQuery": "rewrittenQuery",
"rewrittenFacetFilters": [
{
"fieldName": "fieldName",
"values": [
"fieldValues",
"fieldValues"
]
},
{
"fieldName": "fieldName",
"values": [
"fieldValues",
"fieldValues"
]
}
]
},
"rootMessage": {
"snippets": [
{
"snippet": "snippet",
"mimeType": "mimeType"
}
],
"metadata": {
"container": "container",
"createTime": "2000-01-23T04:56:07.000Z",
"datasource": "datasource",
"author": {
"name": "name"
},
"documentId": "documentId",
"updateTime": "2000-01-23T04:56:07.000Z",
"mimeType": "mimeType",
"objectType": "objectType"
},
"title": "title",
"url": "https://example.com/foo/bar",
"nativeAppUrl": "slack://foo/bar",
"mustIncludeSuggestions": [
{
"missingTerm": "container",
"query": "container"
}
]
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
Includes request params such as the id for channel/message and direction.
The body is of type object
.
Response
200
application/json
OK
The response is of type object
.
Was this page helpful?
from glean import Glean, models
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as g_client:
res = g_client.client.messages.retrieve(id_type=models.IDType.CONVERSATION_ID, id="<id>")
# Handle response
print(res)
{
"hasMore": true,
"searchResponse": {
"trackingToken": "trackingToken",
"suggestedSpellCorrectedQuery": "suggestedSpellCorrectedQuery",
"hasMoreResults": true,
"errorInfo": {
"errorMessages": [
{
"source": "gmail",
"errorMessage": "invalid token"
},
{
"source": "slack",
"errorMessage": "expired token"
}
]
},
"requestID": "5e345ae500ff0befa2b9d1a3ba0001737e7363696f312d323535323137000171756572792d656e64706f696e743a323032303031333074313830343032000100",
"results": [
{
"snippets": [
{
"snippet": "snippet",
"mimeType": "mimeType"
}
],
"metadata": {
"container": "container",
"createTime": "2000-01-23T04:56:07.000Z",
"datasource": "datasource",
"author": {
"name": "name"
},
"documentId": "documentId",
"updateTime": "2000-01-23T04:56:07.000Z",
"mimeType": "mimeType",
"objectType": "objectType"
},
"title": "title",
"url": "https://www.example.com/"
},
{
"snippets": [
{
"snippet": "snippet",
"mimeType": "mimeType"
}
],
"metadata": {
"container": "container",
"createTime": "2000-01-23T04:56:07.000Z",
"datasource": "datasource",
"author": {
"name": "name"
},
"documentId": "documentId",
"updateTime": "2000-01-23T04:56:07.000Z",
"mimeType": "mimeType",
"objectType": "objectType"
},
"title": "title",
"url": "https://www.example.com/"
}
],
"facetResults": [
{
"buckets": [
{
"percentage": 5,
"count": 1,
"value": {
"stringValue": "stringValue",
"integerValue": 5
}
},
{
"percentage": 5,
"count": 1,
"value": {
"stringValue": "stringValue",
"integerValue": 5
}
}
],
"sourceName": "sourceName",
"operatorName": "operatorName",
"objectType": "objectType"
},
{
"buckets": [
{
"percentage": 5,
"count": 1,
"value": {
"stringValue": "stringValue",
"integerValue": 5
}
},
{
"percentage": 5,
"count": 1,
"value": {
"stringValue": "stringValue",
"integerValue": 5
}
}
],
"sourceName": "sourceName",
"operatorName": "operatorName",
"objectType": "objectType"
}
],
"rewrittenQuery": "rewrittenQuery",
"rewrittenFacetFilters": [
{
"fieldName": "fieldName",
"values": [
"fieldValues",
"fieldValues"
]
},
{
"fieldName": "fieldName",
"values": [
"fieldValues",
"fieldValues"
]
}
]
},
"rootMessage": {
"snippets": [
{
"snippet": "snippet",
"mimeType": "mimeType"
}
],
"metadata": {
"container": "container",
"createTime": "2000-01-23T04:56:07.000Z",
"datasource": "datasource",
"author": {
"name": "name"
},
"documentId": "documentId",
"updateTime": "2000-01-23T04:56:07.000Z",
"mimeType": "mimeType",
"objectType": "objectType"
},
"title": "title",
"url": "https://example.com/foo/bar",
"nativeAppUrl": "slack://foo/bar",
"mustIncludeSuggestions": [
{
"missingTerm": "container",
"query": "container"
}
]
}
}
Assistant
Responses are generated using AI and may contain mistakes.