Configure Alibaba OSS
curl --request POST \
--url https://api.tornadoapi.io/user/oss \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"endpoint": "<string>",
"bucket": "<string>",
"access_key_id": "<string>",
"access_key_secret": "<string>",
"folder_prefix": "<string>",
"base_folder": "<string>"
}
'import requests
url = "https://api.tornadoapi.io/user/oss"
payload = {
"endpoint": "<string>",
"bucket": "<string>",
"access_key_id": "<string>",
"access_key_secret": "<string>",
"folder_prefix": "<string>",
"base_folder": "<string>"
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
endpoint: '<string>',
bucket: '<string>',
access_key_id: '<string>',
access_key_secret: '<string>',
folder_prefix: '<string>',
base_folder: '<string>'
})
};
fetch('https://api.tornadoapi.io/user/oss', 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.tornadoapi.io/user/oss",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'endpoint' => '<string>',
'bucket' => '<string>',
'access_key_id' => '<string>',
'access_key_secret' => '<string>',
'folder_prefix' => '<string>',
'base_folder' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tornadoapi.io/user/oss"
payload := strings.NewReader("{\n \"endpoint\": \"<string>\",\n \"bucket\": \"<string>\",\n \"access_key_id\": \"<string>\",\n \"access_key_secret\": \"<string>\",\n \"folder_prefix\": \"<string>\",\n \"base_folder\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tornadoapi.io/user/oss")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"endpoint\": \"<string>\",\n \"bucket\": \"<string>\",\n \"access_key_id\": \"<string>\",\n \"access_key_secret\": \"<string>\",\n \"folder_prefix\": \"<string>\",\n \"base_folder\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tornadoapi.io/user/oss")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"endpoint\": \"<string>\",\n \"bucket\": \"<string>\",\n \"access_key_id\": \"<string>\",\n \"access_key_secret\": \"<string>\",\n \"folder_prefix\": \"<string>\",\n \"base_folder\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Alibaba OSS storage configured successfully",
"provider": "oss",
"container_or_bucket": "tornado-downloads",
"folder_prefix": null
}
User
Configure Alibaba OSS
Configure Alibaba Cloud Object Storage Service for your downloads
POST
/
user
/
oss
Configure Alibaba OSS
curl --request POST \
--url https://api.tornadoapi.io/user/oss \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"endpoint": "<string>",
"bucket": "<string>",
"access_key_id": "<string>",
"access_key_secret": "<string>",
"folder_prefix": "<string>",
"base_folder": "<string>"
}
'import requests
url = "https://api.tornadoapi.io/user/oss"
payload = {
"endpoint": "<string>",
"bucket": "<string>",
"access_key_id": "<string>",
"access_key_secret": "<string>",
"folder_prefix": "<string>",
"base_folder": "<string>"
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
endpoint: '<string>',
bucket: '<string>',
access_key_id: '<string>',
access_key_secret: '<string>',
folder_prefix: '<string>',
base_folder: '<string>'
})
};
fetch('https://api.tornadoapi.io/user/oss', 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.tornadoapi.io/user/oss",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'endpoint' => '<string>',
'bucket' => '<string>',
'access_key_id' => '<string>',
'access_key_secret' => '<string>',
'folder_prefix' => '<string>',
'base_folder' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tornadoapi.io/user/oss"
payload := strings.NewReader("{\n \"endpoint\": \"<string>\",\n \"bucket\": \"<string>\",\n \"access_key_id\": \"<string>\",\n \"access_key_secret\": \"<string>\",\n \"folder_prefix\": \"<string>\",\n \"base_folder\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tornadoapi.io/user/oss")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"endpoint\": \"<string>\",\n \"bucket\": \"<string>\",\n \"access_key_id\": \"<string>\",\n \"access_key_secret\": \"<string>\",\n \"folder_prefix\": \"<string>\",\n \"base_folder\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tornadoapi.io/user/oss")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"endpoint\": \"<string>\",\n \"bucket\": \"<string>\",\n \"access_key_id\": \"<string>\",\n \"access_key_secret\": \"<string>\",\n \"folder_prefix\": \"<string>\",\n \"base_folder\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Alibaba OSS storage configured successfully",
"provider": "oss",
"container_or_bucket": "tornado-downloads",
"folder_prefix": null
}
Overview
Set up Alibaba Cloud OSS for uploaded videos. Credentials are verified before saving.Header Parameters
Request Body
Base folder name for uploaded files. Defaults to
videos if not specified. Set to a custom value to change the top-level folder where files are stored (e.g., downloads, media).Response
Examples
curl -X POST "https://api.tornadoapi.io/user/oss" \
-H "x-api-key: sk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"endpoint": "https://oss-cn-hangzhou.aliyuncs.com",
"bucket": "tornado-downloads",
"access_key_id": "LTAI5tXXXXXXXXXXXXXX",
"access_key_secret": "XXXXXXXXXXXXXXXXXXXXXXXXXX"
}'
import requests
response = requests.post(
"https://api.tornadoapi.io/user/oss",
headers={"x-api-key": "sk_your_api_key"},
json={
"endpoint": "https://oss-cn-hangzhou.aliyuncs.com",
"bucket": "tornado-downloads",
"access_key_id": "LTAI5tXXXXXXXXXXXXXX",
"access_key_secret": "XXXXXXXXXXXXXXXXXXXXXXXXXX"
}
)
print(response.json())
{
"message": "Alibaba OSS storage configured successfully",
"provider": "oss",
"container_or_bucket": "tornado-downloads",
"folder_prefix": null
}
Success Response
{
"message": "Alibaba OSS storage configured successfully",
"provider": "oss",
"container_or_bucket": "tornado-downloads",
"folder_prefix": null
}
Error Responses
{
"error": "Credential validation failed: AccessDenied"
}
{
"error": "Credential validation failed: NoSuchBucket"
}
{
"error": "Invalid API Key"
}
{
"error": "OSS storage configuration is temporarily unavailable"
}
OSS Endpoint Regions
| Region | Endpoint |
|---|---|
| China (Hangzhou) | https://oss-cn-hangzhou.aliyuncs.com |
| China (Shanghai) | https://oss-cn-shanghai.aliyuncs.com |
| China (Beijing) | https://oss-cn-beijing.aliyuncs.com |
| Singapore | https://oss-ap-southeast-1.aliyuncs.com |
| US West | https://oss-us-west-1.aliyuncs.com |
| Germany | https://oss-eu-central-1.aliyuncs.com |
Was this page helpful?