Skip to main content
DELETE
/
imgs
Delete N images
curl --request DELETE \
  --url https://api.wesog.com/imgs \
  --header 'API-Key: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
[
  {
    "id": "<string>"
  }
]
'
import requests

url = "https://api.wesog.com/imgs"

payload = [{ "id": "<string>" }]
headers = {
"API-Key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.delete(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'DELETE',
headers: {'API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([{id: '<string>'}])
};

fetch('https://api.wesog.com/imgs', 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.wesog.com/imgs",
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([
[
'id' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"API-Key: <api-key>",
"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://api.wesog.com/imgs"

payload := strings.NewReader("[\n {\n \"id\": \"<string>\"\n }\n]")

req, _ := http.NewRequest("DELETE", url, payload)

req.Header.Add("API-Key", "<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.delete("https://api.wesog.com/imgs")
.header("API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"id\": \"<string>\"\n }\n]")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.wesog.com/imgs")

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

request = Net::HTTP::Delete.new(url)
request["API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"id\": \"<string>\"\n }\n]"

response = http.request(request)
puts response.read_body
{
  "num_total": 123,
  "num_good": 123,
  "num_bad": 123,
  "is_started": true,
  "is_finished": true,
  "all_good": true,
  "do_wait": true,
  "do_urgent": true,
  "do_strict": true,
  "idle_ms": 123,
  "exec_ms": 123,
  "created_at": "<string>",
  "started_at": "<string>",
  "finished_at": "<string>",
  "errors": [
    {
      "id": 123,
      "msg": "<string>"
    }
  ]
}
{
"operation_id": 123,
"n_total": 123,
"msg": "<string>"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}

Authorizations

API-Key
string
header
required

Query Parameters

wait
boolean
default:false

Wait for completion?

urgent
boolean
default:false

Enqueue at head of queue if True

strict
boolean
default:false

Use strict mode if True

Body

application/json
id
string
required

Response

images successfully deleted

Output of:

  • a synchronous (blocking) operation. POST /imgs?wait=true
  • operation status. GET ops/<op_id>
method
enum<string>
required

Operation type based on the HTTP method.

Available options:
add,
upd,
del,
multiple
resource
enum<string>
required

Resource type involved in the operation.

Available options:
video,
image,
celebs
num_total
integer
required

Total of elements.

num_good
integer
required

Number of correctly processed elements.

num_bad
integer
required

Number of failed processed elements.

is_started
boolean
required

Boolean indicating if the operation has started.

is_finished
boolean
required

Boolean indicating if the operations has finished.

all_good
boolean | null
required

Boolean indicating that there is no failed elements yet.

do_wait
boolean
required

Boolean for know if have to wait or not.

do_urgent
boolean
required

Boolean for know if it is an urgent operation.

do_strict
boolean
required

Boolean for know if is required strict operations over DB.

idle_ms
number
required

Duration (milliseconds) between the operation has been created and has started.

exec_ms
number
required

Duration (milliseconds) between the operation has been started and has finished.

created_at
string
required

Creation datetime.

started_at
string
required

Start datetime.

finished_at
string
required

Finalization datetime.

errors
OpError · object[]
required

List of errors that occurred during processing the operation.