Light Mode
Attach Image
POST
/products/{product}/imagesLast modified: 16 days ago
This endpoint allows you to add up to 10 images to a specific product by passing the product
as a path parameter.
:::tip[Note]
- You can only send one image per request.
- You can attach an image to a product either via URL link or by uploading an image.
:::
Request
Path Params
product
integer
required
The Product ID. List of Product ID can be found here.
Body Params multipart/form-data
photo
file
required
A specific location or directory on a computer's file system that indicates the file's location.
Example:
@"Users/Images/profile.png"
default
integer
optional
Set the image as default
Example:
1
sort
number
optional
Sorting order of the image
Example:
1
alt
string
optional
Alternative text to appear when the image doesn't load properly.
Example:
Alt Text
Request samples
Responses
Attached Successfully(201)
Not Found(404)
Error Validation(422)
Attached Successfully
HTTP Code: 201
Content Type : JSONapplication/json
Data Schema
No schema defined
Example
Example
{
"status": 201,
"success": true,
"data": {
"id": 713368802,
"image": {
"original": {
"url": "https://cdn.salla.sa/bYQEn/9oJoUzXfR8zzXAwAlTRHNIl1xBsuFpgcXdPnkAXd.png",
"width": 0,
"height": 0
},
"standard_resolution": {
"url": "https://cdn.salla.sa/bYQEn/9oJoUzXfR8zzXAwAlTRHNIl1xBsuFpgcXdPnkAXd.png",
"width": 0,
"height": 0
},
"low_resolution": {
"url": "https://cdn.salla.sa/bYQEn/9oJoUzXfR8zzXAwAlTRHNIl1xBsuFpgcXdPnkAXd.png",
"width": 0,
"height": 0
},
"thumbnail": {
"url": "https://cdn.salla.sa/bYQEn/9oJoUzXfR8zzXAwAlTRHNIl1xBsuFpgcXdPnkAXd.png",
"width": 0,
"height": 0
}
},
"sort": 5,
"default": true,
"alt_seo": "image",
"video_url": "",
"type": "image"
}
}
Last modified: 16 days ago