With the /colours endpoint user can manage the database colours.

GET /api/Colours/List Get all configured colours
Request Example
    /api/Colours/List
            
Response Example

a list of colours is returned
    [
        {
            "Id": "string",
            "Name": "string",
            "ExistingName": "string",
            "Code": "string",
            "ExistingCode": "string",
            "Manufacturer": "string",
            "Red": 0,
            "Green": 0,
            "Blue": 0,
            "HtmlColour": "string",
            "Active": true,
            "DefaultColorProfileId": "string",
            "ColourType": "string",
            "ColourTypePriceSKU": "string",
            "NeedleIndex": 0
        },
        {...}
    ]
            
GET /api/Colours/Get Get all configured colours by code(s)
Request Example
    /api/Colours/Get?id=colourId&name=colourName&code=colourCode
            Use id parameter to get colour by id or
            Use name parameter to get colour by name
            Use name parameter to get colour by code
                
Response Example
Response Example
    {
        "Id": "string",
        "Name": "string",
        "ExistingName": "string",
        "Code": "string",
        "ExistingCode": "string",
        "Manufacturer": "string",
        "Red": 0,
        "Green": 0,
        "Blue": 0,
        "HtmlColour": "string",
        "Active": true,
        "DefaultColorProfileId": "string",
        "ColourType": "string",
        "ColourTypePriceSKU": "string",
        "NeedleIndex": 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
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 response will be returned with status code 201
Otherwise an error with code and message will be returned with status code 409
           
            
PUT /api/Colours/Update Update a colour
Request Example
/api/Colours/Update?id=colourId&name=colourName&code=colourCode
            Use id parameter to update colour by id or
            Use name parameter to update colour by name or
            Use name parameter to update colour by code
            
Model Request Example
All fields 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?id=colourId&name=colourName&code=colourCode
            Use id parameter to delete colour by id or
            Use name parameter to delete colour by name or
            Use name parameter to delete colour by code
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