POST
/
rest
/
api
/
v1
/
autocomplete
from glean.api_client import Glean
import os


with Glean(
    api_token=os.getenv("GLEAN_API_TOKEN", ""),
    instance=os.getenv("GLEAN_INSTANCE", ""),
) as glean:

    res = glean.client.search.autocomplete(tracking_token="trackingToken", query="what is a que", datasource="GDRIVE", result_size=10, auth_tokens=[
        {
            "access_token": "123abc",
            "datasource": "gmail",
            "scope": "email profile https://www.googleapis.com/auth/gmail.readonly",
            "token_type": "Bearer",
            "auth_user": "1",
        },
    ])

    # Handle response
    print(res)
{
  "trackingToken": "trackingToken"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Autocomplete request

The body is of type object.

Response

200
application/json

OK

The response is of type object.