Add an image to a vendor's store gallery
POST
/users/{id}/store_media
const url = 'https://acme.mykreezalid.com/api/v1/users/1/store_media';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"url":"https://example.com/gallery-1.jpg","position":0}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://acme.mykreezalid.com/api/v1/users/1/store_media \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "url": "https://example.com/gallery-1.jpg", "position": 0 }'Downloads the image at url and adds it to the gallery of the user’s store, creating the store if the user has none. Available when the store gallery is enabled on your marketplace. Check success in the response.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
integer
User’s unique identifier
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
url
required
Public URL of the image. It must answer with the HTTP status 200.
string format: uri
Example
https://example.com/gallery-1.jpgposition
Position of the image in the gallery
integer
Responses
Section titled “Responses”Whether the image has been added
Media typeapplication/json
object
success
boolean
message
Store media has been added., or why it was not: Invalid URL. The URL does not return a valid response., Error saving store media., Error. No creation. when url is missing
string
Example
{ "success": true, "message": "Store media has been added."}The store gallery is not enabled, no user has this identifier, or the user’s store could not be created.