Product Images & Files
Add Product File
post /sites/{siteid}/products/{productid}/filesThe only field that can be set is the resourceid. Optionally you can add a file using the field filedata which needs to be a base64-encoded string.
{ "resourceid": "message.txt", "filedata": "SGVsbG8gV29ybGQh"}
true
HTTP Status Code Summary | |
---|---|
200 | Returns true |
400 | Bad Request. Invalid syntax, missing required argument or invalid request. |
401 | Unauthorized. Authorization failed. |
404 | Resource not found. The url is invalid. |
429 | Too Many Requests. |
500 | Internal Server Error. |
Get Product Files
get /sites/{siteid}/products/{productid}/filesA file is typically an associated .pdf-file or similar.
The index of the item to start from
The number of items returned
Comma separated list of fields to return. Use this to query only the fields you are using. Default is all fields in resource.
{ "totalcount": 1, "items": [ { "resourceid": "ProductSheet.pdf", "mimetype": "application/pdf", "filesize": 160948, "datecreated": 1352898291 } ]}
HTTP Status Code Summary | |
---|---|
200 | Returns an envelope with items of type resource for a product. |
400 | Bad Request. Invalid syntax, missing required argument or invalid request. |
401 | Unauthorized. Authorization failed. |
404 | Resource not found. The url is invalid. |
429 | Too Many Requests. |
500 | Internal Server Error. |
Get Product File
get /sites/{siteid}/products/{productid}/files/{fileid}The fileid is the index of the file in the product's file list.
{ "resourceid": "message.txt", "mimetype": "text/plain", "filesize": 12, "datecreated": 1550669772}
HTTP Status Code Summary | |
---|---|
200 | Returns an item of type resource. |
400 | Bad Request. Invalid syntax, missing required argument or invalid request. |
401 | Unauthorized. Authorization failed. |
404 | Resource not found. The url is invalid. |
429 | Too Many Requests. |
500 | Internal Server Error. |
Delete Product File
delete /sites/{siteid}/products/{productid}/files/{fileid}Note that only the link between the product and the file is removed. Not the file itself.The fileid is the index of the file in the product's file list.
true
HTTP Status Code Summary | |
---|---|
200 | Returns true |
400 | Bad Request. Invalid syntax, missing required argument or invalid request. |
401 | Unauthorized. Authorization failed. |
404 | Resource not found. The url is invalid. |
429 | Too Many Requests. |
500 | Internal Server Error. |
Add Product Image
post /sites/{siteid}/products/{productid}/imagesThe only field that can be set is the resourceid. Optionally you can add an image using the field filedata which needs to be a base64-encoded string.
{ "resourceid": "message.gif", "filedata": "R0lGODlhHwAJAPABAAAAAP///yH5BAAAAAAALAAAAAAfAAkAAAItjI+pi3AOYgyuJTnp07ZvU1WaCF5mSWFpRnIfJ0Lni8Jbi8/hrWJQr2IIh4gCADs="}
true
HTTP Status Code Summary | |
---|---|
200 | Returns true |
400 | Bad Request. Invalid syntax, missing required argument or invalid request. |
401 | Unauthorized. Authorization failed. |
404 | Resource not found. The url is invalid. |
429 | Too Many Requests. |
500 | Internal Server Error. |
Get Product Images
get /sites/{siteid}/products/{productid}/imagesThe index of the item to start from
The number of items returned
Comma separated list of fields to return. Use this to query only the fields you are using. Default is all fields in resource.
{ "totalcount": 3, "items": [ { "resourceid": "product1_1.jpg", "mimetype": "image/jpeg", "width": 441, "height": 290, "filesize": 17635, "datecreated": 1352898291 }, { "resourceid": "product1_2.jpg", "mimetype": "image/jpeg", "width": 441, "height": 290, "filesize": 33197, "datecreated": 1352898291 } ]}
HTTP Status Code Summary | |
---|---|
200 | Returns an envelope with items of type resource for a product. |
400 | Bad Request. Invalid syntax, missing required argument or invalid request. |
401 | Unauthorized. Authorization failed. |
404 | Resource not found. The url is invalid. |
429 | Too Many Requests. |
500 | Internal Server Error. |
Get Product Image
get /sites/{siteid}/products/{productid}/images/{imageid}The imageid is the index of the image among this product's images.
{ "resourceid": "product1_2.jpg", "mimetype": "image/jpeg", "width": 441, "height": 290, "filesize": 33197, "datecreated": 1352898291}
HTTP Status Code Summary | |
---|---|
200 | Returns an item of type resource. |
400 | Bad Request. Invalid syntax, missing required argument or invalid request. |
401 | Unauthorized. Authorization failed. |
404 | Resource not found. The url is invalid. |
429 | Too Many Requests. |
500 | Internal Server Error. |
Delete Product Image
delete /sites/{siteid}/products/{productid}/images/{imageid}Note that only the link between the product and the image is removed. Not the image itself.The imageid is the index of the image in the product's image list.
true
HTTP Status Code Summary | |
---|---|
200 | Returns true |
400 | Bad Request. Invalid syntax, missing required argument or invalid request. |
401 | Unauthorized. Authorization failed. |
404 | Resource not found. The url is invalid. |
429 | Too Many Requests. |
500 | Internal Server Error. |
Objects
resourceobject
A resource is an uploaded file.
ID for the file as a relative URL (typically the filename).
Mime-type for the file.
Width of image in pixels (only applies to images).
Height of image in pixels (only applies to images).
Filesize on disk in bytes for file.
Timestamp for the date that the file was created.
timestampinteger
Number of seconds since the Unix Epoch.