With the /colours endpoint user can manage the database colours.
GET
/api/Colours/GetColours
Get all configured colours
Request Example
/api/Colours/GetColours/?code=1000 code is optional parameter.
Response Example
Response Example without passing code (all colours returned) or passing comma separated codes (all matching colours returned) a list of colours is returned [ { "Id": 0, "Manufacturer": "string", "Active": true, "Red": 0, "Green": 0, "Blue": 0, "Name": "string", "Code": "string", "Source": "string", "DefaultColorProfileId": 0, "ColourType": "string", "ColourTypePriceSKU": "string", "CompanyId": 0 } ] Response Example with passing a code a colour if found is returned or null { "Id": 0, "Manufacturer": "string", "Active": true, "Red": 0, "Green": 0, "Blue": 0, "Name": "string", "Code": "string", "Source": "string", "DefaultColorProfileId": 0, "ColourType": "string", "ColourTypePriceSKU": "string", "CompanyId": 0 }
GET
/api/Colours/GetColoursByCode
Get all configured colours by code(s)
Request Example
/api/Colours/GetColoursByCode/?codes=1000,1001 codes is required parameter.
Response Example
Response Example a list of colours is returned [ { "Id": 0, "Manufacturer": "string", "Active": true, "Red": 0, "Green": 0, "Blue": 0, "Name": "string", "Code": "string", "Source": "string", "DefaultColorProfileId": 0, "ColourType": "string", "ColourTypePriceSKU": "string", "CompanyId": 0 } ]
GET
/api/Colours/GetColoursByType
Get all configured colours by type(s)
Request Example
/api/Colours/GetColoursByType/?types=Glow,Material types is a required parameter.
Response Example
Response Example a list of colours is returned [ { "Id": 0, "Manufacturer": "string", "Active": true, "Red": 0, "Green": 0, "Blue": 0, "Name": "string", "Code": "string", "Source": "string", "DefaultColorProfileId": 0, "ColourType": "string", "ColourTypePriceSKU": "string", "CompanyId": 0 } ]
GET
/api/Colours/GetColoreelSwatches
Get all swatches for a coloreel library
Request Example
/api/Colours/GetColoreelSwatches/?libraryName=Coloreel Small libraryName is optional parameter. If not passed response will include all swatches for all available libraries
Response Example
Response Example (with libraryName=Coloreel Small) a list of coloreel library's swatches is returned [ { "Preview": "< domain >/api/Coloreel/Cached/Coloreel%20Small_%234C2121.png", "Name": "#4C2121", "Type": "Solid", "EffectID": "28540ebd-259b-4845-9a47-1a9164859750", "Library": "Coloreel Small" }, { "Preview": "< domain >/api/Coloreel/Cached/Coloreel%20Small_%234D2020.png", "Name": "#4D2020", "Type": "Solid", "EffectID": "84088c13-5854-4957-9bc1-636e49f0ea9c", "Library": "Coloreel Small" }, { "Preview": "< domain >/api/Coloreel/Cached/Coloreel%20Small_%234E2020.png", "Name": "#4E2020", "Type": "Solid", "EffectID": "96d0e3cb-e227-4316-9fc8-7eeb90bcbf79", "Library": "Coloreel Small" }, . . . { "Preview": "< domain >/api/Coloreel/Cached/Coloreel%20Small_%23FFFFFF.png", "Name": "#FFFFFF", "Type": "Solid", "EffectID": "49f373a5-af3d-45c5-8a31-d815f66dd035", "Library": "Coloreel Small" } ]
POST
/api/Colours/Create
Create a colour
Model Request Example
{ "Name": "string", "Code": "string", "Manufacturer": "string", "Red":0, "Green":0, "Blue":0, "Source": "string", "ColourType":"string" [ColourType, if provided, should match an existing in the database colour type name] }
Response Example
If the operation is successful an empty response will be returned with status code 201 Otherwise an error with code and message will be returned with status code 409
PATCH
/api/Colours/Update
Update a colour
Request Example
/api/Colours/Update?NameOrCode=code NameOrCode is required parameter in order to identify the colour to update.
Model Request Example
Only provided attributes are updated Please have in mind that providing a new name or new code may affect other entities that pointed to the existing colour { "Name": "string", "Code": "string", "Manufacturer": "string", "Red":0, "Green":0, "Blue":0, "Source": "string", "ColourType":"string" //- Optional [ColourType, if provided, should match an existing in the database colour type name] }
Response Example
If the operation is successful an empty response will be returned with status code 200 Otherwise an error with code and message will be returned with status code 409
DELETE
/api/Colours/Delete
Deactivate a colour
Request Example
/api/Colours/Delete?NameOrCode=1000 NameOrCode parameter is required in order to identify the colour to deactivate Please have in mind that deactivation may affect other entities that pointed to the existing colour
Response Example
If the operation is successful an empty response will be returned with status code 200 Otherwise an error with code and message will be returned with status code 409