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
Shortcuts
List shortcuts
Shortcuts
List shortcuts
List shortcuts editable/owned by the currently authenticated user.
from glean import Glean, models
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as g_client:
res = g_client.client.shortcuts.list(page_size=10, filters=[
{
"field_name": "type",
"values": [
{
"value": "Spreadsheet",
"relation_type": models.RelationType.EQUALS,
},
{
"value": "Presentation",
"relation_type": models.RelationType.EQUALS,
},
],
},
])
# Handle response
print(res)
{
"shortcuts": [
{
"id": 123,
"inputAlias": "<string>",
"destinationUrl": "<string>",
"destinationDocumentId": "<string>",
"description": "<string>",
"unlisted": true,
"urlTemplate": "<string>",
"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"
}
],
"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": {
"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>"
}
]
},
"intermediateUrl": "<string>",
"viewPrefix": "<string>",
"isExternal": true,
"editUrl": "<string>",
"alias": "<string>",
"title": "<string>",
"roles": [
{
"sourceDocumentSpec": {
"url": "<string>"
},
"person": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"group": {
"type": "DEPARTMENT",
"id": "<string>",
"name": "<string>"
},
"role": "OWNER"
}
]
}
],
"facetResults": [
{
"sourceName": "container_name",
"operatorName": "SelectMultiple",
"buckets": [
{
"count": 1,
"datasource": "jira",
"percentage": 5,
"value": {
"stringValue": "engineering",
"integerValue": 5,
"displayLabel": "engineering",
"iconConfig": {
"color": "#343CED",
"key": "person_icon",
"iconType": "GLYPH",
"name": "user"
}
}
}
],
"hasMoreBuckets": false,
"groupName": "Service Cloud"
}
],
"meta": {
"cursor": "<string>",
"hasNextPage": true,
"totalItemCount": 123
}
}
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
Filters, sorters, paging params required for pagination
The body is of type object
.
Response
200
application/json
OK
The response is of type object
.
from glean import Glean, models
import os
with Glean(
api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as g_client:
res = g_client.client.shortcuts.list(page_size=10, filters=[
{
"field_name": "type",
"values": [
{
"value": "Spreadsheet",
"relation_type": models.RelationType.EQUALS,
},
{
"value": "Presentation",
"relation_type": models.RelationType.EQUALS,
},
],
},
])
# Handle response
print(res)
{
"shortcuts": [
{
"id": 123,
"inputAlias": "<string>",
"destinationUrl": "<string>",
"destinationDocumentId": "<string>",
"description": "<string>",
"unlisted": true,
"urlTemplate": "<string>",
"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"
}
],
"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": {
"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>"
}
]
},
"intermediateUrl": "<string>",
"viewPrefix": "<string>",
"isExternal": true,
"editUrl": "<string>",
"alias": "<string>",
"title": "<string>",
"roles": [
{
"sourceDocumentSpec": {
"url": "<string>"
},
"person": {
"name": "George Clooney",
"obfuscatedId": "abc123"
},
"group": {
"type": "DEPARTMENT",
"id": "<string>",
"name": "<string>"
},
"role": "OWNER"
}
]
}
],
"facetResults": [
{
"sourceName": "container_name",
"operatorName": "SelectMultiple",
"buckets": [
{
"count": 1,
"datasource": "jira",
"percentage": 5,
"value": {
"stringValue": "engineering",
"integerValue": 5,
"displayLabel": "engineering",
"iconConfig": {
"color": "#343CED",
"key": "person_icon",
"iconType": "GLYPH",
"name": "user"
}
}
}
],
"hasMoreBuckets": false,
"groupName": "Service Cloud"
}
],
"meta": {
"cursor": "<string>",
"hasNextPage": true,
"totalItemCount": 123
}
}