You can use the content API to fetch digital swatches of all of your (PBR) materials.
Fetch materials by product
api/v2/{account}/products/{code}/material/{name.extension}?feature={feature}:{option}
- name.extension: specify your filename and an extension (jpg, png or webp)
Example
api/v2/1234/products/SC841151-5/material/yourfilename.jpg?size=500&crop=(200,200,300,300)&version=6&feature=UPHOLSTERY:LUXE%20CHENILLE%20DARK%20AND%20STORMY
Pre sets
If not specified otherwise, materials will be fetched using the below pre sets.
- Resolution: 1K
- Size: 64 x 64 px
- Position: Top Left Corner
Specify resolution, size and position in your API call
Add the below parameters to specify resolution, size and position:
api/v2/{account}/products/{code}/material/{name.extension}?feature={feature}:{option}?size=xxx&crop=(x,y,width,height)
Note: All values are specified in pixels.
Example:
api/v2/1234/materials/598f3ae4-a683-4fd3-bf90-643ca94ba967/image/yourfilename.jpg?feature={feature}:{option}&size=200&crop=(0,0,100,100)
Use ID to fetch swatches
Use the following API call to fetch a material using our pre sets:
api/v2/{accountNumber}/materials/{id}/image/{name.extension}
- id: is the "Key" that can be found in the Portal under a material page in the Material Library
Example:
api/v2/1234/materials/598f3ae4-a683-4fd3-bf90-643ca94ba967/image/yourfilename.jpg