Product Images & Files

Add Product File

post /sites/{siteid}/products/{productid}/files

The 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.

PARAMETERS
siteid
integer
path
REQUIRED
productid
integer
path
REQUIRED
REQUEST BODY
object
posthttps://api.mysitoo.com/v2/accounts/1500/sites/1/products/14/files.json
{
"resourceid": "message.txt",
"filedata": "SGVsbG8gV29ybGQh"
}
RESPONSE JSON
true
HTTP Status Code Summary
200Returns true
400Bad Request. Invalid syntax, missing required argument or invalid request.
401Unauthorized. Authorization failed.
404Resource not found. The url is invalid.
429Too Many Requests.
500Internal Server Error.

Get Product Files

get /sites/{siteid}/products/{productid}/files

A file is typically an associated .pdf-file or similar.

PARAMETERS
siteid
integer
path
REQUIRED
productid
integer
path
REQUIRED
start
integer
query

The index of the item to start from

Default: 0
num
integer
query

The number of items returned

Default: 10
fields
array (string)
query

Comma separated list of fields to return. Use this to query only the fields you are using. Default is all fields in resource.

Example: /sites/{siteid}/products/{productid}/files?fields=resourceid,datecreated
RETURNS

Returns an envelope with items of type resource for a product.

gethttps://api.mysitoo.com/v2/accounts/1500/sites/1/products/14/files.json?num=2
RESPONSE JSON
{
"totalcount": 1,
"items": [
{
"resourceid": "ProductSheet.pdf",
"mimetype": "application/pdf",
"filesize": 160948,
"datecreated": 1352898291
}
]
}
HTTP Status Code Summary
200Returns an envelope with items of type resource for a product.
400Bad Request. Invalid syntax, missing required argument or invalid request.
401Unauthorized. Authorization failed.
404Resource not found. The url is invalid.
429Too Many Requests.
500Internal 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.

PARAMETERS
siteid
integer
path
REQUIRED
productid
integer
path
REQUIRED
fileid
integer
path
REQUIRED
RETURNS

Returns an item of type resource.

gethttps://api.mysitoo.com/v2/accounts/1500/sites/1/products/14/files/1.json
RESPONSE JSON
{
"resourceid": "message.txt",
"mimetype": "text/plain",
"filesize": 12,
"datecreated": 1550669772
}
HTTP Status Code Summary
200Returns an item of type resource.
400Bad Request. Invalid syntax, missing required argument or invalid request.
401Unauthorized. Authorization failed.
404Resource not found. The url is invalid.
429Too Many Requests.
500Internal 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.

PARAMETERS
siteid
integer
path
REQUIRED
productid
integer
path
REQUIRED
fileid
integer
path
REQUIRED
deletehttps://api.mysitoo.com/v2/accounts/1500/sites/1/products/14/files/1.json
RESPONSE JSON
true
HTTP Status Code Summary
200Returns true
400Bad Request. Invalid syntax, missing required argument or invalid request.
401Unauthorized. Authorization failed.
404Resource not found. The url is invalid.
429Too Many Requests.
500Internal Server Error.

Add Product Image

post /sites/{siteid}/products/{productid}/images

The 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.

PARAMETERS
siteid
integer
path
REQUIRED
productid
integer
path
REQUIRED
REQUEST BODY
object
posthttps://api.mysitoo.com/v2/accounts/1500/sites/1/products/14/images.json
{
"resourceid": "message.gif",
"filedata": "R0lGODlhHwAJAPABAAAAAP///yH5BAAAAAAALAAAAAAfAAkAAAItjI+pi3AOYgyuJTnp07ZvU1WaCF5mSWFpRnIfJ0Lni8Jbi8/hrWJQr2IIh4gCADs="
}
RESPONSE JSON
true
HTTP Status Code Summary
200Returns true
400Bad Request. Invalid syntax, missing required argument or invalid request.
401Unauthorized. Authorization failed.
404Resource not found. The url is invalid.
429Too Many Requests.
500Internal Server Error.

Get Product Images

get /sites/{siteid}/products/{productid}/images
PARAMETERS
siteid
integer
path
REQUIRED
productid
integer
path
REQUIRED
start
integer
query

The index of the item to start from

Default: 0
num
integer
query

The number of items returned

Default: 10
fields
array (string)
query

Comma separated list of fields to return. Use this to query only the fields you are using. Default is all fields in resource.

Example: /sites/{siteid}/products/{productid}/images?fields=resourceid,datecreated
RETURNS

Returns an envelope with items of type resource for a product.

gethttps://api.mysitoo.com/v2/accounts/1500/sites/1/products/14/images.json?num=2
RESPONSE JSON
{
"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
200Returns an envelope with items of type resource for a product.
400Bad Request. Invalid syntax, missing required argument or invalid request.
401Unauthorized. Authorization failed.
404Resource not found. The url is invalid.
429Too Many Requests.
500Internal 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.

PARAMETERS
siteid
integer
path
REQUIRED
productid
integer
path
REQUIRED
imageid
integer
path
REQUIRED
RETURNS

Returns an item of type resource.

gethttps://api.mysitoo.com/v2/accounts/1500/sites/1/products/14/images/1.json
RESPONSE JSON
{
"resourceid": "product1_2.jpg",
"mimetype": "image/jpeg",
"width": 441,
"height": 290,
"filesize": 33197,
"datecreated": 1352898291
}
HTTP Status Code Summary
200Returns an item of type resource.
400Bad Request. Invalid syntax, missing required argument or invalid request.
401Unauthorized. Authorization failed.
404Resource not found. The url is invalid.
429Too Many Requests.
500Internal 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.

PARAMETERS
siteid
integer
path
REQUIRED
productid
integer
path
REQUIRED
imageid
integer
path
REQUIRED
deletehttps://api.mysitoo.com/v2/accounts/1500/sites/1/products/14/images/1.json
RESPONSE JSON
true
HTTP Status Code Summary
200Returns true
400Bad Request. Invalid syntax, missing required argument or invalid request.
401Unauthorized. Authorization failed.
404Resource not found. The url is invalid.
429Too Many Requests.
500Internal Server Error.

Objects

resource
object

A resource is an uploaded file.

PROPERTIES
resourceid
string

ID for the file as a relative URL (typically the filename).

mimetype
string
READ ONLY

Mime-type for the file.

width
integer
READ ONLY

Width of image in pixels (only applies to images).

height
integer
READ ONLY

Height of image in pixels (only applies to images).

filesize
integer
READ ONLY

Filesize on disk in bytes for file.

datecreated
READ ONLY

Timestamp for the date that the file was created.

timestamp
integer

Number of seconds since the Unix Epoch.