Skip to main content
PUT
/
imgs
/
{image_id}
Replace 1 image
curl --request PUT \
  --url https://api.wesog.com/imgs/{image_id} \
  --header 'API-Key: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "src": "<string>",
  "src_path": "<string>",
  "url_img_watermark": "<string>",
  "url_img_thumbnail": "<string>",
  "title": "<string>",
  "headline": "<string>",
  "caption": "<string>",
  "alt_text": "<string>",
  "ai_generated": true,
  "model_release": true,
  "property_release": true,
  "nsfw": true,
  "status": "<string>",
  "date": "<string>",
  "location": "<string>",
  "city": "<string>",
  "country": "<string>",
  "event": "<string>",
  "author": "<string>",
  "provider": "<string>",
  "shot": "<string>",
  "scene": "<string>",
  "technique": "<string>",
  "medium": "<string>",
  "keywords": [
    "<string>"
  ],
  "categories": [
    "<string>"
  ],
  "collections": [
    "<string>"
  ]
}
'
import requests

url = "https://api.wesog.com/imgs/{image_id}"

payload = {
"src": "<string>",
"src_path": "<string>",
"url_img_watermark": "<string>",
"url_img_thumbnail": "<string>",
"title": "<string>",
"headline": "<string>",
"caption": "<string>",
"alt_text": "<string>",
"ai_generated": True,
"model_release": True,
"property_release": True,
"nsfw": True,
"status": "<string>",
"date": "<string>",
"location": "<string>",
"city": "<string>",
"country": "<string>",
"event": "<string>",
"author": "<string>",
"provider": "<string>",
"shot": "<string>",
"scene": "<string>",
"technique": "<string>",
"medium": "<string>",
"keywords": ["<string>"],
"categories": ["<string>"],
"collections": ["<string>"]
}
headers = {
"API-Key": "<api-key>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'PUT',
headers: {'API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
src: '<string>',
src_path: '<string>',
url_img_watermark: '<string>',
url_img_thumbnail: '<string>',
title: '<string>',
headline: '<string>',
caption: '<string>',
alt_text: '<string>',
ai_generated: true,
model_release: true,
property_release: true,
nsfw: true,
status: '<string>',
date: '<string>',
location: '<string>',
city: '<string>',
country: '<string>',
event: '<string>',
author: '<string>',
provider: '<string>',
shot: '<string>',
scene: '<string>',
technique: '<string>',
medium: '<string>',
keywords: ['<string>'],
categories: ['<string>'],
collections: ['<string>']
})
};

fetch('https://api.wesog.com/imgs/{image_id}', 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/{image_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'src' => '<string>',
'src_path' => '<string>',
'url_img_watermark' => '<string>',
'url_img_thumbnail' => '<string>',
'title' => '<string>',
'headline' => '<string>',
'caption' => '<string>',
'alt_text' => '<string>',
'ai_generated' => true,
'model_release' => true,
'property_release' => true,
'nsfw' => true,
'status' => '<string>',
'date' => '<string>',
'location' => '<string>',
'city' => '<string>',
'country' => '<string>',
'event' => '<string>',
'author' => '<string>',
'provider' => '<string>',
'shot' => '<string>',
'scene' => '<string>',
'technique' => '<string>',
'medium' => '<string>',
'keywords' => [
'<string>'
],
'categories' => [
'<string>'
],
'collections' => [
'<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/{image_id}"

payload := strings.NewReader("{\n \"src\": \"<string>\",\n \"src_path\": \"<string>\",\n \"url_img_watermark\": \"<string>\",\n \"url_img_thumbnail\": \"<string>\",\n \"title\": \"<string>\",\n \"headline\": \"<string>\",\n \"caption\": \"<string>\",\n \"alt_text\": \"<string>\",\n \"ai_generated\": true,\n \"model_release\": true,\n \"property_release\": true,\n \"nsfw\": true,\n \"status\": \"<string>\",\n \"date\": \"<string>\",\n \"location\": \"<string>\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"event\": \"<string>\",\n \"author\": \"<string>\",\n \"provider\": \"<string>\",\n \"shot\": \"<string>\",\n \"scene\": \"<string>\",\n \"technique\": \"<string>\",\n \"medium\": \"<string>\",\n \"keywords\": [\n \"<string>\"\n ],\n \"categories\": [\n \"<string>\"\n ],\n \"collections\": [\n \"<string>\"\n ]\n}")

req, _ := http.NewRequest("PUT", 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.put("https://api.wesog.com/imgs/{image_id}")
.header("API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"src\": \"<string>\",\n \"src_path\": \"<string>\",\n \"url_img_watermark\": \"<string>\",\n \"url_img_thumbnail\": \"<string>\",\n \"title\": \"<string>\",\n \"headline\": \"<string>\",\n \"caption\": \"<string>\",\n \"alt_text\": \"<string>\",\n \"ai_generated\": true,\n \"model_release\": true,\n \"property_release\": true,\n \"nsfw\": true,\n \"status\": \"<string>\",\n \"date\": \"<string>\",\n \"location\": \"<string>\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"event\": \"<string>\",\n \"author\": \"<string>\",\n \"provider\": \"<string>\",\n \"shot\": \"<string>\",\n \"scene\": \"<string>\",\n \"technique\": \"<string>\",\n \"medium\": \"<string>\",\n \"keywords\": [\n \"<string>\"\n ],\n \"categories\": [\n \"<string>\"\n ],\n \"collections\": [\n \"<string>\"\n ]\n}")
.asString();
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Put.new(url)
request["API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"src\": \"<string>\",\n \"src_path\": \"<string>\",\n \"url_img_watermark\": \"<string>\",\n \"url_img_thumbnail\": \"<string>\",\n \"title\": \"<string>\",\n \"headline\": \"<string>\",\n \"caption\": \"<string>\",\n \"alt_text\": \"<string>\",\n \"ai_generated\": true,\n \"model_release\": true,\n \"property_release\": true,\n \"nsfw\": true,\n \"status\": \"<string>\",\n \"date\": \"<string>\",\n \"location\": \"<string>\",\n \"city\": \"<string>\",\n \"country\": \"<string>\",\n \"event\": \"<string>\",\n \"author\": \"<string>\",\n \"provider\": \"<string>\",\n \"shot\": \"<string>\",\n \"scene\": \"<string>\",\n \"technique\": \"<string>\",\n \"medium\": \"<string>\",\n \"keywords\": [\n \"<string>\"\n ],\n \"categories\": [\n \"<string>\"\n ],\n \"collections\": [\n \"<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

lang
string
default:es

en|es|pt|fr|ru

Body

application/json
src
string | null
src_path
string | null
url_img_watermark
string | null
url_img_thumbnail
string | null
title
string | null
headline
string | null
caption
string | null
alt_text
string | null
ai_generated
boolean | null
model_release
boolean | null
property_release
boolean | null
nsfw
boolean | null
status
string | null
date
string | null
location
string | null
city
string | null
country
string | null
event
string | null
author
string | null
provider
string | null
shot
string | null
scene
string | null
technique
string | null
medium
string | null
keywords
string[] | null
categories
string[] | null
collections
string[] | null

Response

image successfully replaced

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.