POST
/
rest
/
api
/
v1
/
uploadchatfiles
from glean import Glean
import os


with Glean(
    api_token=os.getenv("GLEAN_API_TOKEN", ""),
) as g_client:

    res = g_client.client.chat.upload_files(files=[
        {
            "file_name": "example.file",
            "content": open("example.file", "rb"),
        },
    ])

    # Handle response
    print(res)
{
  "files": [
    {
      "id": "FILE_1234",
      "url": "www.google.com",
      "name": "sample.pdf",
      "metadata": {
        "status": "PROCESSING",
        "uploadTime": 123,
        "processedSize": 123,
        "failureReason": "PARSE_FAILED",
        "mimeType": "<string>"
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

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

Query Parameters

timezoneOffset
integer

The offset of the client's timezone in minutes from UTC. e.g. PDT is -420 because it's 7 hours behind UTC.

Body

multipart/form-data

Response

200
application/json

OK

The response is of type object.