Product Assets (images, pdfs, documents and videos)
Contents
Information
The asset call links an actual file or url to the product. This asset can be an image or a document.
Usage
URL
This call only adds the assets to the product. All assets that are linked remain linked. If you have fluctuation in your assets you can also choose to update all asset links. In this case you have to send a PATCH to the product API. See appendix 1
PUT /api/asset/<key>/
POST /api/asset/
The key for the asset is unique for the product and asset combination. You can however use the same image (identifier) for multiple product, but the asset is unique.
The name in the asset call does not link to the file at the FTP of Cloudsuite. The link to the correct file is made via the field: ident
Requests
Request with local image
{
"key": "unique-identifier",
"name": "This is my name",
"ident": "someimage.png",
"ident_org": "https://someurl.com/someimage.png",
"sequence": 1,
"video_provider": "",
"video_embed": false,
"type": "product_image",
"language": "",
"shop": 1,
"product": {
"key": "10193",
"origin": "CLOUDSUITE"
}
}
Request with external url
{
"key": "unique-identifier",
"name": "things.pdf",
"ident": "https://someurl.com/things.pdf",
"ident_org": "https://someurl.com/things.pdf",
"sequence": 1,
"video_provider": "",
"video_embed": false,
"type": "url",
"language": "nl_NL",
"shop": 1,
"product": {
"key": "10193",
"origin": "CLOUDSUITE"
}
}
Request with video
{
"key": "unique-identifier",
"name": "Some video",
"ident": "dQw4w9WgXcQ",
"ident_org": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"sequence": 1,
"video_provider": "youtube",
"video_embed": true,
"type": "video",
"language": "nl_NL",
"shop": 1,
"product": {
"key": "10193",
"origin": "CLOUDSUITE"
}
}
Fields
Fields | Value | Remarks |
---|---|---|
key | key of the assets. | Can be the produccode combined with the assetname |
name | name of the asset | Optionally used on the product page |
ident | the filename of the image or the URL. | Look at the different methods at Product Assets (images, pdfs, documents and videos) | Mapping imagetypes |
ident_org | The original name / URL ofthe image. | Is only used for reference, will never be shown |
sequence | The sequence of the image on the page | Not applicable for type = product_image |
video_provider | the name of the video provider | youtube, vimeo |
video_embed | true | false | Must the video be embedded on the page? |
type | The type of the image | See Product Assets (images, pdfs, documents and videos) | Mapping imagetypes |
language | the language where the asset must be used, if ommitted, the asset wil always show | This can be used to link a specific asset (pdf manual in a specific language) to a specific language. It will only be shown when the shop is in that language. |
shop | The ID of the shop where the asset must be shown | Get the ID from CloudSuite or use the /api/webshop endpoint |
product->key | The key to the product where the asset must be linked to |
|
product->origin | The origin of the product |
|
Mapping imagetypes
When the files are imported to the FTP of Cloudsuite ensure that the extension (e.g. .jpg / .png / .web / .pdf / .dwg) is always at the end of the filename.
Type of asset | Type | Ident | Ident_org | Video_provider | Video_embed |
---|---|---|---|---|---|
Primary image | product_image | filename including extension. | If the image comes from an external URL, save this in ident_org (archive purposes only) No path is needed | empty | false |
Primary image from external URL | product_image | full url |
| empty | false |
Secondary images | additional_product_image | filename including extension. The ident is case sensitive | If the image comes from an external URL, save this in ident_org (archive purposes only) No path is needed | empty | false |
Secondary images from external URL | additional_product_image | full url |
| empty | false |
PDF / DWG files | url | path of the server followed by the file name (e.g. /static/uploads/pictures/original/manual.pdf) |
| empty | false |
PDF / DWG files from external URL | url | full url |
| empty | false |
External url | url | full url | Empty | empty | false |
Video file | video | YouTube code | Full URL | youtube | vimeo | true |
Product image for in confirmation email | email_product_image | filename | If the image comes from an external URL, save this in ident_org (archive purposes only) | empty | false |
Documentation: https://test.cloudsuite.io/api/#tag/api-greater-asset
Separate linking of asset to a product
Update assets of a product
The assets must exist, only the key is used in this update call
PATCH /api/origin/{origin}/product/{productkey}/
PATCH /api/origin/{origin}/product/{productkey}/
POST /api/origin/{origin}/product/
Request PATCH
{
"assets" : ["assetkey1","assetkey2"]
}
Request PUT / POST
{
....
"assets" : ["assetkey1","assetkey2"]
....
}
Scenarios
More information about asset usage can be found here: Asset scenarios
Related content
© 2024 CloudSuite BV, All rights reserved