Overview
Glean has two REST APIs: Client API and Indexing API. Our developer documentation is the best resource for detailed instructions on implementation. This article is meant to provide a brief introduction to Glean's REST APIs and serve as a resource for FAQs and troubleshooting.
Client API
The Client API enables implementation of a custom client interface to interact with the Glean system.
Indexing API
The Indexing API (also referred to as the Push API) is used to upload documents to Glean.
Tokens
Token Type | Description | Features |
Indexing Token | These are specifically designed for indexing documents from internal tools or apps that Glean does not natively support. They are used with the Indexing REST API to send documents to Glean via HTTP requests. |
|
Client Token | These are utilized for making API calls to Glean's Client API. They can be scoped either to a single user or globally, allowing the caller to act as multiple users. This flexibility is crucial for interacting with Glean's Client API, enabling functionalities like querying and interacting with Glean's data programmatically. |
|
Authentication Token API Key | These are used to can be used to create authentication tokens on behalf of any user. |
|
FAQ
Question: I indexed documents for my data source, however, the document is not appearing in search results.
Answer: When using the /indexdocument and /bulkindexdocuments endpoints, documents are added to a queue for processing and are not indexed immediately. This might be why users don’t see these items in search results right away. To speed up document indexing, you can use the /processalldocuments endpoint to schedule the immediate processing of your documents. You can also confirm if a document has been uploaded/indexed or not using the get document information endpoint. If the document has been uploaded and indexed, there might be a permission issue. You can validate if a user has permission to view a document with the check document access endpoint.
Question: How can I delete documents from my custom data source?
Answer: You can delete documents using the /deletedocument endpoint. Alternatively, the /bulkindexdocuments endpoint will remove documents from the data source index that are not present in the upload. To delete all documents, you can use /bulkindexdocuments with an empty documents array and set disableStaleDocumentDeletionCheck to true.
Question: Is there example documentation on how to use and implement different endpoints?
Answer: Yes, we have a public GitHub repository with examples for our APIs. You can find it here.
Question: I created a custom data source, why is the 'Results Display' section blank in the UI?
Answer: We don't show the results display options until object definitions are created for the datasource. This is because you can customize the results display based on the object type. For more information on setting up object definitions, please refer to our documentation on custom properties.
Troubleshooting Resources
Troubleshooting Rest API Issues