Blob エンドポイント
Blob オブジェクトの削除
このドキュメントは、SquareCloud Blob API の DELETE /v1/objects エンドポイントの包括的な概要を提供します。
DELETE
/
v1
/
objects
Blob オブジェクトの削除
curl --request DELETE \
--url https://blob.squarecloud.app/v1/objects \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"object": "<string>"
}
'import requests
url = "https://blob.squarecloud.app/v1/objects"
payload = { "object": "<string>" }
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({object: '<string>'})
};
fetch('https://blob.squarecloud.app/v1/objects', 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://blob.squarecloud.app/v1/objects",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'object' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$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://blob.squarecloud.app/v1/objects"
payload := strings.NewReader("{\n \"object\": \"<string>\"\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.delete("https://blob.squarecloud.app/v1/objects")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"object\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://blob.squarecloud.app/v1/objects")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"object\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success"
}
削除するオブジェクトの名前。オブジェクト名は次のパターンに従う必要があります:
a to z, A to Z, 0 to 9, and _。{ "object": "ID/prefix/name1_ltq7b2sw-de6241.jpeg" }
レスポンス
呼び出しが成功したかどうかを示します。成功の場合は “success”、そうでない場合は “error” です。
{
"status": "success"
}
トラブルシューティング
- 400 ステータスコード
- 401 ステータスコード
- 404 ステータスコード
- 429 ステータスコード
オブジェクト関連
// The request body is missing or is not a valid JSON object.
{
"status": "error",
"code": "INVALID_BODY"
}
// The provided object name is invalid.
{
"status": "error",
"code": "INVALID_OBJECT"
}
// The request to delete the objects failed. Please try again.
{
"status": "error",
"code": "FAILED_DELETE"
}
認証エラー
// The API key is missing or invalid. Set a valid key in the Authorization header.
{
"status": "error",
"code": "ACCESS_DENIED"
}
見つかりません
// The object you are trying to delete does not exist.
{
"status": "error",
"code": "OBJECT_NOT_FOUND"
}
レート制限
// Delete rate limit reached (max 1 delete per second).
{
"status": "error",
"code": "RATELIMIT"
}
⌘I
Blob オブジェクトの削除
curl --request DELETE \
--url https://blob.squarecloud.app/v1/objects \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"object": "<string>"
}
'import requests
url = "https://blob.squarecloud.app/v1/objects"
payload = { "object": "<string>" }
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({object: '<string>'})
};
fetch('https://blob.squarecloud.app/v1/objects', 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://blob.squarecloud.app/v1/objects",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'object' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);
$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://blob.squarecloud.app/v1/objects"
payload := strings.NewReader("{\n \"object\": \"<string>\"\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.delete("https://blob.squarecloud.app/v1/objects")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"object\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://blob.squarecloud.app/v1/objects")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"object\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success"
}

