Upload a file
curl --request POST \
--url https://wisepim.com/api/public/v1/assets/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileimport requests
url = "https://wisepim.com/api/public/v1/assets/upload"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://wisepim.com/api/public/v1/assets/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"filename": "<string>",
"mime_type": "<string>",
"file_size": 123,
"width": 123,
"height": 123,
"url": "<string>",
"thumbnail_url": "<string>",
"alt_text": "<string>",
"source_url": "<string>",
"products": [
{
"product_id": 123,
"position": 123,
"is_main": true
}
],
"products_truncated": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"id": "<string>",
"filename": "<string>",
"mime_type": "<string>",
"file_size": 123,
"width": 123,
"height": 123,
"url": "<string>",
"thumbnail_url": "<string>",
"alt_text": "<string>",
"source_url": "<string>",
"products": [
{
"product_id": 123,
"position": 123,
"is_main": true
}
],
"products_truncated": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>",
"detail": [
{}
]
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}Upload an asset
POST /assets/upload: upload an image or PDF as multipart form data and optionally attach it to a product. Requires assets:write.
POST
/
api
/
public
/
v1
/
assets
/
upload
Upload a file
curl --request POST \
--url https://wisepim.com/api/public/v1/assets/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileimport requests
url = "https://wisepim.com/api/public/v1/assets/upload"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://wisepim.com/api/public/v1/assets/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"filename": "<string>",
"mime_type": "<string>",
"file_size": 123,
"width": 123,
"height": 123,
"url": "<string>",
"thumbnail_url": "<string>",
"alt_text": "<string>",
"source_url": "<string>",
"products": [
{
"product_id": 123,
"position": 123,
"is_main": true
}
],
"products_truncated": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"id": "<string>",
"filename": "<string>",
"mime_type": "<string>",
"file_size": 123,
"width": 123,
"height": 123,
"url": "<string>",
"thumbnail_url": "<string>",
"alt_text": "<string>",
"source_url": "<string>",
"products": [
{
"product_id": 123,
"position": 123,
"is_main": true
}
],
"products_truncated": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>",
"detail": [
{}
]
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}{
"error": "<string>",
"request_id": "<string>",
"code": "<string>"
}Authorizations
Use a project API key from Settings > API Access. Send it as Authorization: Bearer wpk_.... See authentication and scopes for setup and permissions.
Headers
Body
multipart/form-data
Response
OK

