跳转到主要内容
GET
/
v1
/
files
/
{file_id}
/
content
通过ID获取文件对象。
curl --request GET \
  --url https://api.olostep.com/v1/files/{file_id}/content \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.olostep.com/v1/files/{file_id}/content"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.olostep.com/v1/files/{file_id}/content', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.olostep.com/v1/files/{file_id}/content",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.olostep.com/v1/files/{file_id}/content"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.olostep.com/v1/files/{file_id}/content")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.olostep.com/v1/files/{file_id}/content")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "object": "<string>",
  "created": 123,
  "filename": "<string>",
  "bytes": 123,
  "download_url": "<string>",
  "expires_in": 123
}

授权

Authorization
string
header
必填

Bearer身份验证头的格式为Bearer ,其中是你的认证令牌。

路径参数

file_id
string
必填

要下载文件的唯一标识符。

查询参数

expires_in
integer
默认值:600

下载URL过期前的秒数。默认为600秒(10分钟)。

响应

成功响应并返回下载URL。

id
string

文件 ID

object
string

对象类型。此端点为 "file"。

created
integer

创建的纪元时间戳

filename
string

上传文件的文件名

bytes
integer

文件大小(字节)

download_url
string<uri>

用于下载文件的预签名URL。在指定的expires_in时间后过期。

expires_in
integer

下载URL过期前的秒数。