Blob-Endpunkte
Blob Delete Objects
Diese Dokumentation bietet einen umfassenden Überblick über den DELETE /v1/objects-Endpoint der SquareCloud Blob API.
DELETE
/
v1
/
objects
Blob Delete Objects
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"
}
Der API-Schlüssel für Ihr Konto. Sie finden ihn in Ihren Kontoeinstellungen.
Der Name des zu löschenden Objekts. Der Objektname muss folgendem Muster entsprechen:
a to z, A to Z, 0 to 9, and _.{ "object": "ID/prefix/name1_ltq7b2sw-de6241.jpeg" }
Antwort
Gibt an, ob der Aufruf erfolgreich war. “success” bei Erfolg, “error” bei Misserfolg.
{
"status": "success"
}
Fehlerbehebung
- Statuscode 400
- Statuscode 401
- Statuscode 404
- Statuscode 429
Objektbezogen
// 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"
}
Nicht autorisiert
// The API key is missing or invalid. Set a valid key in the Authorization header.
{
"status": "error",
"code": "ACCESS_DENIED"
}
Nicht gefunden
// The object you are trying to delete does not exist.
{
"status": "error",
"code": "OBJECT_NOT_FOUND"
}
Rate-Limit erreicht
// Delete rate limit reached (max 1 delete per second).
{
"status": "error",
"code": "RATELIMIT"
}
⌘I
Blob Delete Objects
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"
}

