Upload Product Image
curl --request POST \
--url https://uat-api.clinkbill.com/api/product/image/upload \
--header 'Content-Type: multipart/form-data' \
--header 'X-API-KEY: <api-key>' \
--header 'X-Timestamp: <x-timestamp>' \
--form file='@example-file'HttpResponse<String> response = Unirest.post("https://uat-api.clinkbill.com/api/product/image/upload")
.header("X-Timestamp", "<x-timestamp>")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "multipart/form-data")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();import requests
url = "https://uat-api.clinkbill.com/api/product/image/upload"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {
"X-Timestamp": "<x-timestamp>",
"X-API-KEY": "<api-key>"
}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {
method: 'POST',
headers: {'X-Timestamp': '<x-timestamp>', 'X-API-KEY': '<api-key>'}
};
options.body = form;
fetch('https://uat-api.clinkbill.com/api/product/image/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": 200,
"msg": "success",
"data": {
"url": "<string>",
"fileName": "<string>",
"ossId": "<string>"
}
}"<string>"Product
上传产品图片
Upload a product image as multipart form data. The file must be an image and must not exceed 5 MB.
POST
/
product
/
image
/
upload
Upload Product Image
curl --request POST \
--url https://uat-api.clinkbill.com/api/product/image/upload \
--header 'Content-Type: multipart/form-data' \
--header 'X-API-KEY: <api-key>' \
--header 'X-Timestamp: <x-timestamp>' \
--form file='@example-file'HttpResponse<String> response = Unirest.post("https://uat-api.clinkbill.com/api/product/image/upload")
.header("X-Timestamp", "<x-timestamp>")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "multipart/form-data")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();import requests
url = "https://uat-api.clinkbill.com/api/product/image/upload"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {
"X-Timestamp": "<x-timestamp>",
"X-API-KEY": "<api-key>"
}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {
method: 'POST',
headers: {'X-Timestamp': '<x-timestamp>', 'X-API-KEY': '<api-key>'}
};
options.body = form;
fetch('https://uat-api.clinkbill.com/api/product/image/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": 200,
"msg": "success",
"data": {
"url": "<string>",
"fileName": "<string>",
"ossId": "<string>"
}
}"<string>"授权
Your secret API key obtained from the Clink dashboard (Developers section)
请求头
Current timestamp in milliseconds since Unix epoch (required for request signing)
示例:
"1783513683000"
请求体
multipart/form-data
Multipart request body for uploading a product image.
Product image file. Supported extensions are jpg, jpeg, png, gif, and webp.