Indexing API
- Documents
- Permissions
- Troubleshooting
- Datasources
- Authentication
- People
- Shortcuts
Client API
- Activity
- Announcements
- Answers
- Authentication
- Chat
- Agents
- Collections
- Documents
- Insights
- Messages
- Pins
- Search
- Entities
- Shortcuts
- Summarize
- Verification
Answers
List Answers
Answers
List Answers
List Answers created by the current user.
POST
/
rest
/
api
/
v1
/
listanswers
from glean import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as g_client:
res = g_client.client.answers.list()
# Handle response
print(res)
{
"answerResults": [
{
"answer": {
"id": 3,
"docId": "ANSWERS_answer_3",
"question": "Why is the sky blue?",
"questionVariations": [
"<string>"
],
"bodyText": "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.",
"boardId": 123,
"audienceFilters": [
{
"fieldName": "type",
"values": [
{
"value": "Spreadsheet",
"relationType": "EQUALS"
},
{
"value": "Presentation",
"relationType": "EQUALS"
}
]
}
],
"addedRoles": [
{
"sourceDocumentSpec": {
"url": "<string>"
},
"person": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"group": {
"type": "DEPARTMENT",
"id": "<string>",
"name": "<string>"
},
"role": "OWNER"
}
],
"removedRoles": [
{
"sourceDocumentSpec": {
"url": "<string>"
},
"person": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"group": {
"type": "DEPARTMENT",
"id": "<string>",
"name": "<string>"
},
"role": "OWNER"
}
],
"roles": [
{
"sourceDocumentSpec": {
"url": "<string>"
},
"person": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"group": {
"type": "DEPARTMENT",
"id": "<string>",
"name": "<string>"
},
"role": "OWNER"
}
],
"sourceDocumentSpec": {
"url": "<string>"
},
"sourceType": "DOCUMENT",
"permissions": {
"write": {
"scopeType": "GLOBAL",
"create": true,
"update": true,
"delete": true
}
},
"combinedAnswerText": {
"text": "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.",
"structuredList": [
{
"link": "https://en.wikipedia.org/wiki/Diffuse_sky_radiation",
"document": {
"id": "<string>",
"datasource": "<string>",
"connectorType": "API_CRAWL",
"docType": "<string>",
"content": {
"fullTextList": [
"<string>"
]
},
"containerDocument": {},
"parentDocument": {},
"title": "<string>",
"url": "<string>",
"metadata": {
"container": "container",
"parentId": "JIRA_EN-1337",
"createTime": "2000-01-23T04:56:07.000Z",
"datasource": "datasource",
"author": {
"name": "name"
},
"documentId": "documentId",
"updateTime": "2000-01-23T04:56:07.000Z",
"mimeType": "mimeType",
"objectType": "Feature Request",
"components": [
"Backend",
"Networking"
],
"status": [
"Done"
],
"customData": {
"someCustomField": "someCustomValue"
}
},
"sections": [
{
"title": "<string>",
"url": "<string>"
}
]
},
"text": "Because its wavelengths are shorter, blue light is more strongly scattered than the longer-wavelength lights, red or green. Hence the result that when looking at the sky away from the direct incident sunlight, the human eye perceives the sky to be blue."
}
]
},
"likes": {
"likedBy": [
{
"user": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"createTime": "2023-11-07T05:31:56Z"
}
],
"likedByUser": true,
"numLikes": 123
},
"author": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"createTime": "2023-11-07T05:31:56Z",
"updateTime": "2023-11-07T05:31:56Z",
"updatedBy": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"verification": {
"state": "UNVERIFIED",
"metadata": {
"lastVerifier": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"lastVerificationTs": 123,
"expirationTs": 123,
"document": {},
"reminders": [
{
"assignee": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"requestor": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"remindAt": 123,
"createdAt": 123,
"reason": "<string>"
}
],
"lastReminder": {
"assignee": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"requestor": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"remindAt": 123,
"createdAt": 123,
"reason": "<string>"
},
"visitorCount": [
{
"count": 123,
"period": {
"minDaysFromNow": 123,
"maxDaysFromNow": 123,
"start": {
"epochSeconds": 123,
"daysFromNow": 123
},
"end": {
"epochSeconds": 123,
"daysFromNow": 123
}
},
"org": "<string>"
}
],
"candidateVerifiers": [
{
"name": "George Clooney",
"obfuscatedId": "abc123"
}
]
}
},
"board": {
"name": "<string>",
"description": "<string>",
"addedRoles": [
{}
],
"removedRoles": [
{}
],
"audienceFilters": [
{
"fieldName": "type",
"values": [
{
"value": "Spreadsheet",
"relationType": "EQUALS"
},
{
"value": "Presentation",
"relationType": "EQUALS"
}
]
}
],
"permissions": {
"write": {
"scopeType": "GLOBAL",
"create": true,
"update": true,
"delete": true
}
},
"id": 123,
"createTime": "2023-11-07T05:31:56Z",
"updateTime": "2023-11-07T05:31:56Z",
"creator": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"updatedBy": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"itemCount": 123,
"roles": [
{}
]
},
"collections": [
{
"name": "<string>",
"description": "<string>",
"addedRoles": [
{}
],
"removedRoles": [
{}
],
"audienceFilters": [
{
"fieldName": "type",
"values": [
{
"value": "Spreadsheet",
"relationType": "EQUALS"
},
{
"value": "Presentation",
"relationType": "EQUALS"
}
]
}
],
"icon": "<string>",
"adminLocked": true,
"parentId": 123,
"thumbnail": {
"photoId": "<string>",
"url": "<string>"
},
"allowedDatasource": "<string>",
"permissions": {
"write": {
"scopeType": "GLOBAL",
"create": true,
"update": true,
"delete": true
}
},
"id": 123,
"createTime": "2023-11-07T05:31:56Z",
"updateTime": "2023-11-07T05:31:56Z",
"creator": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"updatedBy": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"itemCount": 123,
"childCount": 123,
"items": [
{
"name": "<string>",
"description": "<string>",
"icon": "<string>",
"collectionId": 123,
"documentId": "<string>",
"url": "<string>",
"itemId": "<string>",
"createdBy": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"createdAt": "2023-11-07T05:31:56Z",
"document": {},
"shortcut": {
"id": 123,
"inputAlias": "<string>",
"destinationUrl": "<string>",
"destinationDocumentId": "<string>",
"description": "<string>",
"unlisted": true,
"urlTemplate": "<string>",
"addedRoles": [
{}
],
"removedRoles": [
{}
],
"permissions": {
"write": {
"scopeType": "GLOBAL",
"create": true,
"update": true,
"delete": true
}
},
"createdBy": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"createTime": "2023-11-07T05:31:56Z",
"updatedBy": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"updateTime": "2023-11-07T05:31:56Z",
"destinationDocument": {},
"intermediateUrl": "<string>",
"viewPrefix": "<string>",
"isExternal": true,
"editUrl": "<string>",
"alias": "<string>",
"title": "<string>",
"roles": [
{}
]
},
"collection": "<any>",
"itemType": "DOCUMENT"
}
],
"pinMetadata": {
"existingPins": [
{
"category": "COMPANY_RESOURCE",
"value": "<string>",
"target": "RESOURCE_CARD"
}
],
"eligiblePins": [
{
"id": 123,
"target": {
"category": "COMPANY_RESOURCE",
"value": "<string>",
"target": "RESOURCE_CARD"
}
}
]
},
"shortcuts": [
"<string>"
],
"children": [
"<any>"
],
"roles": [
{}
]
}
],
"documentCategory": "<string>",
"sourceDocument": {
"id": "<string>",
"datasource": "<string>",
"connectorType": "API_CRAWL",
"docType": "<string>",
"content": {
"fullTextList": [
"<string>"
]
},
"containerDocument": {},
"parentDocument": {},
"title": "<string>",
"url": "<string>",
"metadata": {
"container": "container",
"parentId": "JIRA_EN-1337",
"createTime": "2000-01-23T04:56:07.000Z",
"datasource": "datasource",
"author": {
"name": "name"
},
"documentId": "documentId",
"updateTime": "2000-01-23T04:56:07.000Z",
"mimeType": "mimeType",
"objectType": "Feature Request",
"components": [
"Backend",
"Networking"
],
"status": [
"Done"
],
"customData": {
"someCustomField": "someCustomValue"
}
},
"sections": [
{
"title": "<string>",
"url": "<string>"
}
]
}
},
"trackingToken": "<string>"
}
]
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Headers
Email address of a user on whose behalf the request is intended to be made (should be non-empty only for global tokens).
Auth type being used to access the endpoint (should be non-empty only for global tokens).
Body
application/json
ListAnswers request
The body is of type object
.
Response
200
application/json
OK
The response is of type object
.
from glean import Glean
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as g_client:
res = g_client.client.answers.list()
# Handle response
print(res)
{
"answerResults": [
{
"answer": {
"id": 3,
"docId": "ANSWERS_answer_3",
"question": "Why is the sky blue?",
"questionVariations": [
"<string>"
],
"bodyText": "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.",
"boardId": 123,
"audienceFilters": [
{
"fieldName": "type",
"values": [
{
"value": "Spreadsheet",
"relationType": "EQUALS"
},
{
"value": "Presentation",
"relationType": "EQUALS"
}
]
}
],
"addedRoles": [
{
"sourceDocumentSpec": {
"url": "<string>"
},
"person": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"group": {
"type": "DEPARTMENT",
"id": "<string>",
"name": "<string>"
},
"role": "OWNER"
}
],
"removedRoles": [
{
"sourceDocumentSpec": {
"url": "<string>"
},
"person": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"group": {
"type": "DEPARTMENT",
"id": "<string>",
"name": "<string>"
},
"role": "OWNER"
}
],
"roles": [
{
"sourceDocumentSpec": {
"url": "<string>"
},
"person": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"group": {
"type": "DEPARTMENT",
"id": "<string>",
"name": "<string>"
},
"role": "OWNER"
}
],
"sourceDocumentSpec": {
"url": "<string>"
},
"sourceType": "DOCUMENT",
"permissions": {
"write": {
"scopeType": "GLOBAL",
"create": true,
"update": true,
"delete": true
}
},
"combinedAnswerText": {
"text": "From https://en.wikipedia.org/wiki/Diffuse_sky_radiation, the sky is blue because blue light is more strongly scattered than longer-wavelength light.",
"structuredList": [
{
"link": "https://en.wikipedia.org/wiki/Diffuse_sky_radiation",
"document": {
"id": "<string>",
"datasource": "<string>",
"connectorType": "API_CRAWL",
"docType": "<string>",
"content": {
"fullTextList": [
"<string>"
]
},
"containerDocument": {},
"parentDocument": {},
"title": "<string>",
"url": "<string>",
"metadata": {
"container": "container",
"parentId": "JIRA_EN-1337",
"createTime": "2000-01-23T04:56:07.000Z",
"datasource": "datasource",
"author": {
"name": "name"
},
"documentId": "documentId",
"updateTime": "2000-01-23T04:56:07.000Z",
"mimeType": "mimeType",
"objectType": "Feature Request",
"components": [
"Backend",
"Networking"
],
"status": [
"Done"
],
"customData": {
"someCustomField": "someCustomValue"
}
},
"sections": [
{
"title": "<string>",
"url": "<string>"
}
]
},
"text": "Because its wavelengths are shorter, blue light is more strongly scattered than the longer-wavelength lights, red or green. Hence the result that when looking at the sky away from the direct incident sunlight, the human eye perceives the sky to be blue."
}
]
},
"likes": {
"likedBy": [
{
"user": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"createTime": "2023-11-07T05:31:56Z"
}
],
"likedByUser": true,
"numLikes": 123
},
"author": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"createTime": "2023-11-07T05:31:56Z",
"updateTime": "2023-11-07T05:31:56Z",
"updatedBy": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"verification": {
"state": "UNVERIFIED",
"metadata": {
"lastVerifier": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"lastVerificationTs": 123,
"expirationTs": 123,
"document": {},
"reminders": [
{
"assignee": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"requestor": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"remindAt": 123,
"createdAt": 123,
"reason": "<string>"
}
],
"lastReminder": {
"assignee": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"requestor": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"remindAt": 123,
"createdAt": 123,
"reason": "<string>"
},
"visitorCount": [
{
"count": 123,
"period": {
"minDaysFromNow": 123,
"maxDaysFromNow": 123,
"start": {
"epochSeconds": 123,
"daysFromNow": 123
},
"end": {
"epochSeconds": 123,
"daysFromNow": 123
}
},
"org": "<string>"
}
],
"candidateVerifiers": [
{
"name": "George Clooney",
"obfuscatedId": "abc123"
}
]
}
},
"board": {
"name": "<string>",
"description": "<string>",
"addedRoles": [
{}
],
"removedRoles": [
{}
],
"audienceFilters": [
{
"fieldName": "type",
"values": [
{
"value": "Spreadsheet",
"relationType": "EQUALS"
},
{
"value": "Presentation",
"relationType": "EQUALS"
}
]
}
],
"permissions": {
"write": {
"scopeType": "GLOBAL",
"create": true,
"update": true,
"delete": true
}
},
"id": 123,
"createTime": "2023-11-07T05:31:56Z",
"updateTime": "2023-11-07T05:31:56Z",
"creator": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"updatedBy": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"itemCount": 123,
"roles": [
{}
]
},
"collections": [
{
"name": "<string>",
"description": "<string>",
"addedRoles": [
{}
],
"removedRoles": [
{}
],
"audienceFilters": [
{
"fieldName": "type",
"values": [
{
"value": "Spreadsheet",
"relationType": "EQUALS"
},
{
"value": "Presentation",
"relationType": "EQUALS"
}
]
}
],
"icon": "<string>",
"adminLocked": true,
"parentId": 123,
"thumbnail": {
"photoId": "<string>",
"url": "<string>"
},
"allowedDatasource": "<string>",
"permissions": {
"write": {
"scopeType": "GLOBAL",
"create": true,
"update": true,
"delete": true
}
},
"id": 123,
"createTime": "2023-11-07T05:31:56Z",
"updateTime": "2023-11-07T05:31:56Z",
"creator": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"updatedBy": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"itemCount": 123,
"childCount": 123,
"items": [
{
"name": "<string>",
"description": "<string>",
"icon": "<string>",
"collectionId": 123,
"documentId": "<string>",
"url": "<string>",
"itemId": "<string>",
"createdBy": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"createdAt": "2023-11-07T05:31:56Z",
"document": {},
"shortcut": {
"id": 123,
"inputAlias": "<string>",
"destinationUrl": "<string>",
"destinationDocumentId": "<string>",
"description": "<string>",
"unlisted": true,
"urlTemplate": "<string>",
"addedRoles": [
{}
],
"removedRoles": [
{}
],
"permissions": {
"write": {
"scopeType": "GLOBAL",
"create": true,
"update": true,
"delete": true
}
},
"createdBy": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"createTime": "2023-11-07T05:31:56Z",
"updatedBy": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"updateTime": "2023-11-07T05:31:56Z",
"destinationDocument": {},
"intermediateUrl": "<string>",
"viewPrefix": "<string>",
"isExternal": true,
"editUrl": "<string>",
"alias": "<string>",
"title": "<string>",
"roles": [
{}
]
},
"collection": "<any>",
"itemType": "DOCUMENT"
}
],
"pinMetadata": {
"existingPins": [
{
"category": "COMPANY_RESOURCE",
"value": "<string>",
"target": "RESOURCE_CARD"
}
],
"eligiblePins": [
{
"id": 123,
"target": {
"category": "COMPANY_RESOURCE",
"value": "<string>",
"target": "RESOURCE_CARD"
}
}
]
},
"shortcuts": [
"<string>"
],
"children": [
"<any>"
],
"roles": [
{}
]
}
],
"documentCategory": "<string>",
"sourceDocument": {
"id": "<string>",
"datasource": "<string>",
"connectorType": "API_CRAWL",
"docType": "<string>",
"content": {
"fullTextList": [
"<string>"
]
},
"containerDocument": {},
"parentDocument": {},
"title": "<string>",
"url": "<string>",
"metadata": {
"container": "container",
"parentId": "JIRA_EN-1337",
"createTime": "2000-01-23T04:56:07.000Z",
"datasource": "datasource",
"author": {
"name": "name"
},
"documentId": "documentId",
"updateTime": "2000-01-23T04:56:07.000Z",
"mimeType": "mimeType",
"objectType": "Feature Request",
"components": [
"Backend",
"Networking"
],
"status": [
"Done"
],
"customData": {
"someCustomField": "someCustomValue"
}
},
"sections": [
{
"title": "<string>",
"url": "<string>"
}
]
}
},
"trackingToken": "<string>"
}
]
}