Links

Buckets

post
https://api-v2.acrcloud.com
/api/buckets
Create a bucket
Curl
Python
PHP
Nodejs
curl --location --request POST 'https://api-v2.acrcloud.com/api/buckets' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer token' \
--header 'Content-Type: application/json' \
--data-raw '{
"name":"avbucket",
"type":"File",
"labels":["Music", "Video"],
"net_type":1,
"region":"ap-southeast-1"
}'
import requests
url = "https://api-v2.acrcloud.com/api/buckets"
data={"name":"avbucket",
"type":"File",
"labels":["Music", "Video"],
"net_type":1,
"region":"ap-southeast-1"
}
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer token'
}
response = requests.post(url, headers=headers, json=data)
print(response.text)
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api-v2.acrcloud.com/api/buckets',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('name' => 'testbucket','region' => 'ap-southeast-1','type' => 'File'),
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
'Authorization: Bearer token'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios');
var data = JSON.stringify({"name":"avbucket","type":"File","labels":["Music","Video"],"net_type":1,"region":"ap-southeast-1"});
var config = {
method: 'post',
url: 'https://api-v2.acrcloud.com/api/buckets',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer token',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
get
https://api-v2.acrcloud.com
/api/buckets
List Buckets
Curl
Python
PHP
Nodejs
equest GET 'https://api-v2.acrcloud.com/api/buckets?region=eu-west-1' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer token'
import requests
url = "https://api-v2.acrcloud.com/api/buckets?region=eu-west-1"
payload={}
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer token'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api-v2.acrcloud.com/api/buckets?region=eu-west-1',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
'Authorization: Bearer token'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var data = qs.stringify({
});
var config = {
method: 'get',
url: 'https://api-v2.acrcloud.com/api/buckets?region=eu-west-1',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer token'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
get
https://api-v2.acrcloud.com
/api/buckets/:id
Get a bucket
Curl
Python
PHP
Nodejs
curl --request GET 'https://api-v2.acrcloud.com/api/buckets/8881' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer your_access_token'
import requests
url = "https://api-v2.acrcloud.com/api/buckets/966"
payload={}
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer your_access_token'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api-v2.acrcloud.com/api/buckets/966',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
'Authorization: Bearer your_access_token'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var axios = require('axios');
var config = {
method: 'get',
url: 'https://api-v2.acrcloud.com/api/buckets/966',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer your_access_token'
}
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
var axios = require('axios');
var config = {
method: 'get',
url: 'https://api-v2.acrcloud.com/api/buckets/966',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer your_access_token'
}
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
put
https://api-v2.acrcloud.com
/api/buckets/:id
Update a bucket
Curl
curl --location --request PUT 'https://api-v2.acrcloud.com/api/buckets/8881' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer token' \
--header 'Content-Type: application/json' \
--data-raw '{"name":"bucket-music"}'
delete
https://api-v2.acrcloud.com
/api/buckets/:id
Delete the bucket