Reputation: 35
I am using the sw-api (version": "6.6.9.0) and I am looking for a way to upload media with a bulk operation (in order to transmit several URLs in only one POST)
instead of using
/api/_action/media/d1735379b7a980b88d96727913c090dc/upload?extension=png&fileName=myImage
with body
{
"url": "https://myUrl/myImage.png"
}
which means only 1 URL per POST,
I would like to do this in a bulk
/api/_action/sync
[
{
"entity": "media",
"action": "upsert",
"payload": [
{
"id": "d1735379b7a980b88d96727913c090dc",
"url": "https://myURL/myImage.png",
"fileName": "myImage",
"extension": "png"
}
]
}
]
unfortunately, my approach does not work (Bad request).
Any hint is appreciated.
Upvotes: 0
Views: 6