curl --request POST \
--url https://api.exowpee.com/v1/catalog/products/{product}/images \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'images={
"file": "<string>",
"position": 123
}'import requests
url = "https://api.exowpee.com/v1/catalog/products/{product}/images"
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"images\"\r\n\r\n{\r\n \"file\": \"<string>\",\r\n \"position\": 123\r\n}\r\n-----011000010111000001101001--"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "multipart/form-data"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const form = new FormData();
form.append('images', '{
"file": "<string>",
"position": 123
}');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.exowpee.com/v1/catalog/products/{product}/images', 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.exowpee.com/v1/catalog/products/{product}/images",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"images\"\r\n\r\n{\r\n \"file\": \"<string>\",\r\n \"position\": 123\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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.exowpee.com/v1/catalog/products/{product}/images"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"images\"\r\n\r\n{\r\n \"file\": \"<string>\",\r\n \"position\": 123\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.exowpee.com/v1/catalog/products/{product}/images")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"images\"\r\n\r\n{\r\n \"file\": \"<string>\",\r\n \"position\": 123\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/products/{product}/images")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"images\"\r\n\r\n{\r\n \"file\": \"<string>\",\r\n \"position\": 123\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"handle": "<string>",
"status_counts": {},
"type": "<string>",
"tags": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"title": "<string>",
"description": "<string>",
"is_tracked": true,
"uom_category_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"options": [
"<unknown>"
],
"variants": "<array>",
"images": "<array>",
"category": {},
"organization_id": "<string>"
}{
"message": "<string>",
"errors": {}
}Add product images
Uploads pictures for a product. Note that the files are stored, but the call currently reports an error.
curl --request POST \
--url https://api.exowpee.com/v1/catalog/products/{product}/images \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form 'images={
"file": "<string>",
"position": 123
}'import requests
url = "https://api.exowpee.com/v1/catalog/products/{product}/images"
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"images\"\r\n\r\n{\r\n \"file\": \"<string>\",\r\n \"position\": 123\r\n}\r\n-----011000010111000001101001--"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "multipart/form-data"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const form = new FormData();
form.append('images', '{
"file": "<string>",
"position": 123
}');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.exowpee.com/v1/catalog/products/{product}/images', 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.exowpee.com/v1/catalog/products/{product}/images",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"images\"\r\n\r\n{\r\n \"file\": \"<string>\",\r\n \"position\": 123\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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.exowpee.com/v1/catalog/products/{product}/images"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"images\"\r\n\r\n{\r\n \"file\": \"<string>\",\r\n \"position\": 123\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.exowpee.com/v1/catalog/products/{product}/images")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"images\"\r\n\r\n{\r\n \"file\": \"<string>\",\r\n \"position\": 123\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/catalog/products/{product}/images")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"images\"\r\n\r\n{\r\n \"file\": \"<string>\",\r\n \"position\": 123\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"handle": "<string>",
"status_counts": {},
"type": "<string>",
"tags": "<string>",
"published_at": "2023-11-07T05:31:56Z",
"title": "<string>",
"description": "<string>",
"is_tracked": true,
"uom_category_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"options": [
"<unknown>"
],
"variants": "<array>",
"images": "<array>",
"category": {},
"organization_id": "<string>"
}{
"message": "<string>",
"errors": {}
}product_images.retrieve
Conditions
- The permission needed is product_images.retrieve.
- Each image must be a jpeg, png, jpg, gif or svg file of at most 2048 kilobytes.
- The legacy action answers a server error even after storing the files, because it loads the undefined relation Product::options while building the response.
- Stores each file as one picture of the product.
- The images are stored and stay attached even though the call answers an error.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifier of the product that receives the images (27-character KSUID).
Body
List of pictures to attach to the product. Required.
Show child attributes
Show child attributes
Response
ProductResource
Identifier of the product (27-character KSUID).
Short text identifier of the product, unique within the organization. Built from the title when it was not sent at creation.
Number of variants of the product in each item status (active, draft, archived).
Kind of product: physical, digital or service.
Tags as one text separated by semicolons, or null when none.
Publication date and time in ISO 8601, or null while the product is not published. It is left empty at creation.
Display name of the product.
Free text description; an empty string when none was given.
Whether stock is tracked for the variants of this product. Changing it also changes the tracking of all its variants.
Identifier of the unit-of-measure category that defines the units the product's variants are sold and stocked in (27-character KSUID). It cannot be changed after creation.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).
Options of the product (for example size, colour; stored in lower case), each with its id, name and the list of values used by its variants. Present only when the product's option values are loaded.
Variants of the product. Present only when requested with include=variants.
Pictures of the product. Present only when requested with include=images.
Catalog category of the product, or null when it has none. Present only when requested with include=category.
Identifier of the organization the record belongs to.