GET
/
file
/
{uuid}
/
content
curl --request GET \
  --url https://geekai.co/api/v1/file/{uuid}/content \
  --header 'Authorization: Bearer <token>'
{
  "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "status": "pending"
}

文件上传成功后,就可以通过文件提取接口获取文件内容了。需要注意的是,极客智坊提供的是文件异步加载,所以需要轮询提取文件内容接口获取文件内容,直到获取到文件内容为止。 轮询时,可以通过响应数据中的status字段判断文件提取状态,status=reading表示文件正在读取中,status=done表示文件读取完成,此时可以通过content字段值获取文件内容,如果status=failed,则表示文件读取失败。

cURL 请求示例

curl --location --request GET 'https://geekai.co/api/v1/file/27f9ab4d-137b-4bb3-bcca-ea28f2f89e95/content' \

--header 'Authorization: Bearer {YOUR_GEEKAI_API_KEY}' 

Postman 请求响应示例

Authorizations

Authorization
string
header
required

JWT认证token

Path Parameters

uuid
string
required

文件唯一标识符

Response

200
application/json
成功响应
uuid
string
required

文件ID

status
enum<string>
required

文件处理状态

Available options:
pending,
reading,
processing,
failed,
done