Lighting Facts REST API documentation

The REST API allows developers to interact with the products list by sending an HTTP request. You can use any HTTP client in any programming language to interact with the API.

Base URL

All URLs referenced in the documentation have the following base:

http://www.lightingfacts.com/api/product

Request format

For POST and PUT requests, the request body must be JSON, with the Content-Type header set to application/json.

Response format:

The response format for all requests is a JSON object. Whether a request succeeded or failed is indicated by the HTTP status code. A 2xx status code indicates success, whereas a 4xx status code indicates failure.

Product Data

This section provide details about the basic structure of a product along with the properties that define the attributes of that product.

Basic format

Storing data through the Lighting Facts REST API is built around a JSON encoding of the object's data.The object is a basic representation of a product. The properties of this object represent the attributes of a product that provide information about a product. The values of these properties are bound by different validations.

For example, if you want to add a new product, your product object could contain:

{
    ModelNumber: 'Test Model Number',
    Brand:  'Test Brand Name',
    Description: 'Test Description'
}

Properties of a product

Name:           SSLProductID    
Type:           integer
Description:    The ID of the actual product    

Name:           BaseProductID   
Type:           integer
Description:    The ID of the original product

Name:           ReplacesProductID   
Type:           integer
Description:    The BaseProductID of the product that is replaced by the current product

Name:           ReplacedByProductID 
Type:           integer
Description:    The BaseProductID of the product that replaces the current product

Name:           IsParent    
Type:           boolean
Description:    If the product is a single product or part of a product family

Name:           ParentID    
Type:           integer
Description:    The ID of the product that acts as a parent to the current product. 
                This applies only to child products in the product family       

Name:           OrganizationID  
Type:           integer
Description:    The ID of the organization manufacturing the product

Name:           Brand
Type:           string
Description:    The name of the brand to which the product is associated.

Name:           ModelNumber
Type:           string
Description:    The unique identifier that describe the model number of the product

Name:           ProductType
Type:           integer
Description:    The ID of the type of the product
Value:          Luminaire = 1,
                Lamp = 2,
                Retrofit Kit = 4

Name:           ProductCategory
Type:           integer
Description:    The ID of the category of the product
Value:          
                Area/Roadway = 1,
                Bollard = 2,
                Canopy = 4,
                Cove = 8,
                Decorative = 16,
                Desk/Task = 32,
                Directional = 64,
                Display Case = 128,
                Downlight = 256,
                Industrial = 512,
                Linear = 1024,
                Parking Garage = 2048,
                Path/Step/Rail = 4096,
                Troffer/ Grid Ceiling = 8192,
                Wallwash = 16384,
                Other = 32768,
                Omnidirectional = 65536

Name:           UseLocation
Type:           array of integers
Description:    A list of multiple use locations of the product
Value:
                Indoor = 1, 
                Outdoor  = 2,
                Refrigerated Case = 4,
                Landscape = 8, 
                Underwater = 16, 
                Hazardous Location = 32,
                Other = 64, 
                Theatrical = 128, 
                Teleconference = 256, 
                Fully Enclosed Luminaires = 512, 

Name:           MountingBase
Type:           array of integers
Description:    A list of multiple mounting base of the product
Value:
                Floor/Ground = 1, 
                Arm/Pole = 4
                Portable = 8, 
                Recessed = 16, 
                Surface = 32, 
                Suspended = 64, 
                Track = 128, 
                Under Cabinet/Shelf = 256, 
                Wall = 512, 
                Other = 1024, 
                Medium Screw (E26/E27) = 2048,
                Candelabra (E12) = 4096, 
                Intermediate (E17) = 8192, 
                Mogul (E39) = 16384, 
                G13 Bipin (e.g., T8) = 32768, 
                G5 Bipin (e.g., T5) = 65536, 
                GU24 = 131072, 
                GU10 = 262144, 
                GU5.3 = 524288, 
                GX or G (Pin-base CFL) = 1048576, 
                Side-prong = 2097152, 
                Post top = 4194304

Name:           SubCategory
Type:           array of integers
Description:    A list of multiple subcategories of the product
Value:          
                Accent/Spot = 1
                Flood = 2
                Other = 4
                Square or Rectangular = 8
                Round = 16
                High Bay = 32
                Low Bay = 64
                Path = 128
                Step = 256
                Rail = 512
                1x2 = 1024
                2x2 = 2048
                2x4 = 4096
                4x4 = 8192
                G = 16384
                PAR = 32768
                R = 65536
                BR = 131072
                AR = 262144
                MR = 524288
                T = 1048576
                A = 2097152
                K = 4194304
                E = 8388608
                ED = 16777216
                Small Pendant = 33554432
                Large Pendant = 67108864
                Marker Light = 134217728
                Porch Light = 268435456
                Sconce = 536870912
                Vanity Light = 1073741824
                Aimable = 2147483648
                Aisle = 4294967296
                Strip Light = 8589934592
                Dock Light = 17179869184
                Direct = 34359738368
                Direct/Indirect = 68719476736
                Indirect = 137438953472
                Slot Light = 274877906944
                Wraparound = 549755813888
                Adjustable = 1099511627776
                Perimeter Slot = 2199023255552
                B = 4398046511104
                C = 8796093022208
                Clear Lens = 17592186044416
                Frosted Lens = 35184372088832
                CA = 70368744177664
                DC = 140737488355328
                F = 281474976710656
                BA = 562949953421312
                ER = 1125899906842624
                BX = 2251799813685248
                BT = 4503599627370496
                P = 9007199254740992
                PS = 18014398509481984
                S = 36028797018963968

Name:           ProductSize
Type:           integers
Description:    Size of the product
Value:          
                Other = 2
                4 inches = 4
                6 inches = 6
                8 inches = 8
                15 = 15
                16 = 16
                17 = 17
                19 = 19
                20 = 20
                25 = 25
                28 = 28
                30 = 30
                36 = 36
                38 = 38
                40 = 40
                5 (2') = 52
                5 (4') = 54
                70 = 70
                8 (2') = 82
                8 (4') = 84
                111 = 111
                16.5 = 165

Name:           Description
Type:           string
Description:    A brief overview of the product 

Name:           SKU
Type:           string
Description:    A SKU of the product 

Name:           ProductAvailabilityID
Type:           integer
Description:    A ID of the availability status of the product 
Values:         Yes - Standard Stocked Product or In-Stores = 1,
                Yes - Made to Order Product = 2,
                Not yet commercially available = 3,
                No = 4  

Name:           DLCSubmission   
Type:           boolean
Description:    Determines whether the product is being submitted for DLC qualification

Name:           NGLSubmission   
Type:           boolean
Description:    Determines whether the product is being submitted for Next Generation Luminaires competition

Name:           EnergyStar  
Type:           boolean
Description:    Determines whether the product is ENERGY STAR certified

Name:           DLCQualified    
Type:           boolean
Description:    Determines whether the product is DLC qualified

Name:           NextGenerationLuminaireWinner   
Type:           boolean
Description:    Determines whether the product is Next Generation Luminaire Competition Winner

Name:           THD
Type:           integer
Description:    The Total Harmonic Distortion of the product 

Name:           LightOutput
Type:           integer
Description:    Light Output of the product 

Name:           Watts
Type:           integer
Description:    Watts of the product

Name:           LumensPerWatt
Type:           integer
Description:    Lumens per Watt of the product 

Name:           ColorAccuracy
Type:           integer
Description:    Color Accuracy of the product 

Name:           LightColor
Type:           integer
Description:    Light Color of the product 

Name:           InputVoltage
Type:           integer
Description:    Input Voltage of the product 

Name:           InputType
Type:           integer
Description:    Power Type of the product 

Name:           VLEDDCC
Type:           boolean
Description:    if this product incorporates variable LED drive current controls for a purpose other than                   maintaining light output over its lifetime

Name:           HasMultipleLEDSources
Type:           boolean
Description:    Determines where the product uses two or more unique LED light sources

Name:           HasVDCControls
Type:           boolean
Description:    Determines whether the product incorporates variable LED drive current controls over its                    lifetime.

Name:           HasSecondaryOptics
Type:           boolean
Description:    Determines whether the product incorporates any secondary optics with remote phosphor or other              material that will significantly affect the light output and/or color of the LED light source. 
                Do not check this box if the secondary optic was tested with the LED light source in the LM-80 measurements

Name:           PowerFactor
Type:           integer
Description:    Power Factor of the product 

Name:           Duv
Type:           integer
Description:    DUV of the product 

Name:           R9
Type:           integer
Description:    R9 of the product 

Name:           BeamAngle
Type:           integer
Description:    Beam Angle of the product 

Name:           CenterBeamCandlePower
Type:           integer
Description:    Center Beam CandlePower of the product 

Name:           HasDimmingInfo
Type:           boolean
Description:    If the product has dimming information 

Name:           DimmingInformationURL
Type:           integer
Description:    URL for Dimming Information of the product, if any 

Name:           HasWarranty
Type:           boolean
Description:    If the product has warranty 

Name:           WarrantyInformationURL
Type:           integer
Description:    URL for Warranty Information of the product, if any 

Name:           Duv
Type:           integer
Description:    DUV of the product 

Name:           ZLD_0_60
Type:           integer
Description:    Zonal Lumen Density (0-60°) of the product 

Name:           ZLD_60_90
Type:           integer
Description:    Zonal lumen density (60-90°) of the product 

Name:           ZLD_90_120
Type:           integer
Description:    Zonal lumen density (90-120°) of the product 

Name:           ZLD_120_180
Type:           integer
Description:    Zonal lumen density (120-180°) of the product 

Name:           SpacingCriteria_0_180
Type:           integer
Description:    Spacing Criteria (0-180) of the product 

Name:           SpacingCriteria_90_270
Type:           integer
Description:    Spacing Criteria (90-270) of the product 

Name:           ProductInformationURL
Type:           string
Description:    URL for additional information of the product

Name:           LumenMaintenanceClaimed
Type:           boolean
Description:    If the product has Lumen Maintenance Claimed.

Name:           LumenMaintenanceHours
Type:           integer
Description:    Lumen Maintenance Hours of the product.
                This value should only be set when the LumenMaintenanceClaimed is set to 'true'.
Values:         10000, 15000, 25000

Name:           LumenMaintenanceTemperature
Type:           integer
Description:    Lumen Maintenance Temperature of the product 
                This value should only be set when the LumenMaintenanceClaimed is set to 'true'.

Name:           LumenMaintenancePercent
Type:           integer
Description:    Lumen Maintenance Percentage of the product 
                This value should only be set when the LumenMaintenanceClaimed is set to 'true'.

Name:           ParentClaim
Type:           boolean
Description:    Determines if the Lumen Maintenance is claimed for the parent product
                This value should only be set when the LumenMaintenanceClaimed and IsParent is set to 'true'.

Name:           LumenScaled
Type:           boolean
Description:    Determines if the claimed Lumen Maintenance is scaled to all products 
                This value should only be set when the LumenMaintenanceClaimed and IsParent is set to 'true'.

Name:           TestedChild
Type:           integer
Description:    The BaseProductID of the child product in a family that is selected as Tested Product
                This value should only be set when the LumenMaintenanceClaimed and IsParent is set to 'true'.

Name:           TestedLumenMaintenanceHours
Type:           integer
Description:    The Lumen Maintenance Hours for the tested child product 
                This value should only be set when the LumenMaintenanceClaimed and IsParent is set to 'true'.
Values:         10000, 15000, 25000

Name:           TestedLumenMaintenanceTemperature
Type:           integer
Description:    The Lumen Maintenance Temperature for the tested child product 
                This value should only be set when the LumenMaintenanceClaimed and IsParent is set to 'true'.

Name:           TestedLumenMaintenancePercent
Type:           integer
Description:    The Lumen Maintenance Percentage for the tested child product
                This value should only be set when the LumenMaintenanceClaimed and IsParent is set to 'true'.

Methods for Product Management

This section provides the methods that can be used to send different HTTP requests to the products list.

Creating a new product

Creates a new product and stores it in the products list. It automatically assigns a unique id to the submitted product. The action uses a HTTP POST method. If the one or more attribute values fail the validation, then the "ProductStatus" property is set to "Incomplete", else it is set to "Complete". You cannot perform the "Product Submit" action until the "ProductStatus" property is set to "Complete"

Action:

POST    /api/product/
The data to be saved should be sent as a json-encoded array in the POST body. 

Parameters:

Name:           data
Type:           JSON Object
Description:    Contains data of an individual product that is to be saved in the products list
                Please refer to "Product Data" for the basic properties of a product data.
Condition:      - The values of data are bound to specific validations. 
                Note: Please refer to "If the action is not successful" in 'Output' section below if the conditions are not satisfied   

Example

POST /api/product/
POSTbody:   {
                "Brand": "xyz",
                "ModelNumber": "null"
            }

Response

Returns a HTTP code based on the output of the action

If the action is successful - 
    Return Value:
        - 201:  The product is saved in the products list

If the action is not successful-
    Return Value:
        - 401:  You are not authorized to create this product
        - 500:  The server encountered an unexpected condition which prevented it from fulfilling the request

Submitting a product to the products list

Submits the product with the specified id that has successfully passed the validations and was saved. The action uses a HTTP POST method.

Action:

POST /api/product/:id/submit

Parameters:

Name:           id
Type:           integer
Description:    The id of the saved product that is to be submitted in the products list
Condition:      - The value of id should be greater than 0. 
                - There should exist atleast one product with the specified id in the products list. 
                Note: Please refer to "If the action is not successful" in 'Output' section below if the conditions are not satisfied   

Example

POST /api/product/3/submit 

Response

Returns a HTTP code based on the output of the action

If the action is successful - 
    Return Value:
        - 200:  The saved product is submitted in the products list

If the action is not successful-
    Return Value:
        - 400:  The product associated with the specified id is not complete and cannot be submitted
        - 401:  You are not authorized to submit this product
        - 404:  The product with the specified id does not exist in the products list
        - 500:  The server encountered an unexpected condition which prevented it from fulfilling the request

Updating contents of a product in the products list

Updates the data for the product whose id matches the specified id with the new submitted data. The action uses HTTP PUT method. If the updated product has some invalid values, the ProductStatus is set to "Incomplete", else it is set to "Complete".

Action:

PUT /api/product/:id 
The updated data should be sent as a json-encoded array in the POST body.    

Parameters:

Name:           id
Type:           integer
Description:    The id of the product that is to be retrieved from the products list
Condition:      - The value of id should be greater than 0. 
                - There should exist atleast one product with the specified id in the products list. 
                Note: Please refer to "If the action is not successful" in 'Output' section below if the conditions are not satisfied 

Name:           data
Type:           JSON Object
Description:    Contains data of an individual product that is to be submitted in the products list
                Please refer to "Product Data" for the basic properties of product data.
Condition:      - The values of data are bound to specific validations. 
                Note: Please refer to "If the action is not successful" in 'Output' section below if the conditions are not satisfied   

Example

PUT /api/product/3
PUTbody:    {
                "Brand": "xyz",
                "ModelNumber": "890"
            }

Response

Returns a HTTP code based on the output of the action

If the action is successful - 
    Return Value:
        - 200:  The product with the specified id is updated in the products list

If the action is not successful-
    Return Value:
        - 400:  The submitted data has some invalid values and cannot be submitted
        - 404:  The product with the specified id was not found in the products list
        - 500:  The server encountered an unexpected condition which prevented it from fulfilling the request

Deleting a product from the product list

Deletes the product with the specified id from the products list. The action uses a HTTP DELETE method.

Action:

DELETE  /api/product/:id 

Parameters:

Name:           id
Type:           integer
Description:    The id of the product that is to be deleted from the products list
Condition:      - The value of id should be greater than 0. 
                - There should exist atleast one product with the specified id in the products list. 
                Note: Please refer to "If the action is not successful" in 'Output' section below if the conditions are not satisfied   

Example

DELETE /api/product/3

Response

Returns a HTTP code based on the output of the action

If the action is successful - 
    Return Value:
        - 200:  The product with the specified id is deleted from the products list

If the action is not successful-
    Return Value:
        - 400:  The id value was less than or equal to 0 and is invalid
        - 401:  You are not authorized to delete this product
        - 404:  The product with the specified id was not found in the products list
                Note: 404 only occurs if the id is greater than 0.
        - 500:  The server encountered an unexpected condition which prevented it from fulfilling the request

Retrieving a specific product from the products list

Finds the product with the specified id from the products list and returns it. The action uses a HTTP GET method.

Action:

GET /api/product/:id  

Parameters:

Name:           id
Type:           integer
Description:    The id of the product that is to be retrieved from the products list
Condition:      - The value of id should be greater than 0. 
                - There should exist atleast one product with the specified id in the products list. 
                Note: Please refer to "If the action is not successful" in 'Output' section below if the conditions are not satisfied   

Example

GET /api/product/3

Response

Returns a HTTP code based on the output of the action

If the action is successful -
    It returns the data of the specified product along with the HTTP code. 
    Return Value:
        - 200:  The product with the specified id is returned from the products list.

If the action is not successful-
    Return Value:
        - 400:  The id value was less than or equal to 0
        - 401:  You are not authorized to access this product
        - 403:  The specified product does not belong to your organization
        - 404:  The product with the specified id was not found in the products list
                Note: 404 only occurs if the id is greater than 0.
        - 500:  The server encountered an unexpected condition which prevented it from fulfilling the request

Archiving an existing product from the products list

Archives the product associated with the specified id and currently available in the products list. This action uses HTTP POST method.

Action:

POST /api/product/:id/archive  

Parameters:

Name:           id
Type:           integer
Description:    The id of the product that is to be archived in the products list
Condition:      - The value of id should be greater than 0. 
                - There should exist atleast one product with the specified id in the products list. 
                Note: Please refer to "If the action is not successful" in 'Output' section below if the conditions are not satisfied   

Example

POST /api/product/3/archive

Response

Returns a HTTP code based on the output of the action

If the action is successful - 
    Return Value:
        - 200:  The product associated with the specified id is archived.

If the action is not successful-
    Return Value:
        - 400:  The product associated with the specified id is already archived
        - 404:  The product with the specified id does not exist in the products list
        - 500:  The server encountered an unexpected condition which prevented it from fulfilling the request

Get all the family products associated to the specified product in the products list

Returns all the products that are associated to the product with specified id. This action uses HTTP GET method.

Action:

GET /api/product/:id/family  

Parameters:

Name:           id
Type:           integer
Description:    The id of the product in the products list
Condition:      - The value of id should be greater than 0. 
                - There should exist atleast one product with the specified id in the products list. 
                Note: Please refer to "If the action is not successful" in 'Output' section below if the conditions are not satisfied   

Example

GET /api/product/3/family   

Response

Returns a HTTP code based on the output of the action

If the action is successful - 
    Return Value:
        - 200:  Returns a list of all the products that are associated with the specified product id.

If the action is not successful-
    Return Value:
        - 404:  The product with the specified id does not exist in the products list
        - 500:  The server encountered an unexpected condition which prevented it from fulfilling the request

Get all the parent products associated to the specified product in the products list

Returns all the products that are parent and associated to the product with specified id. This action uses HTTP GET method.

Action:

GET /api/product/:id/parent  

Parameters:

Name:           id
Type:           integer
Description:    The id of the product in the products list
Condition:      - The value of id should be greater than 0. 
                - There should exist atleast one product with the specified id in the products list. 
                Note: Please refer to "If the action is not successful" in 'Output' section below if the conditions are not satisfied   

Example

GET /api/product/3/parent

Response

Returns a HTTP code based on the output of the action

If the action is successful - 
    Return Value:
        - 200:  Returns a list of products that are parent to the specified product.

If the action is not successful-
    Return Value:
        - 404:  The product with the specified id does not exist in the products list
        - 500:  The server encountered an unexpected condition which prevented it from fulfilling the request

Get all the child products associated to the specified product in the products list

Returns all the products that are children and associated to the product with specified id. This action uses HTTP GET method.

Action:

GET /api/product/:id/children

Parameters:

Name:           id
Type:           integer
Description:    The id of the product in the products list
Condition:      - The value of id should be greater than 0. 
                - There should exist atleast one product with the specified id in the products list. 
                Note: Please refer to "If the action is not successful" in 'Output' section below if the conditions are not satisfied   

Example

GET /api/product/3/children

Response

Returns a HTTP code based on the output of the action

If the action is successful - 
    Return Value:
        - 200:  Returns a list of products that are children to the specified product.

If the action is not successful-
    Return Value:
        - 404:  The product with the specified id does not exist in the products list
        - 500:  The server encountered an unexpected condition which prevented it from fulfilling the request

Validating a product

Checks whether the saved product is valid or not. Based on the result of the validation, a status code with or without error content is returned. This action uses HTTP GET method.

Action:

GET /api/product/:id/validate

Parameters:

Name:           id
Type:           integer
Description:    The id of the product in the products list
Condition:      - The value of id should be greater than 0. 
                - There should exist atleast one product with the specified id in the products list. 
                Note: Please refer to "If the action is not successful" in 'Output' section below if the conditions are not satisfied   

Example

GET /api/product/3/validate

Response

Returns a HTTP code based on the output of the action

If the action is successful - 
    Return Value:
        - 200:  The product is valid and contains no errors.

If the action is not successful-
    Return Value:
        - 400:  The product is invalid. It also returns a list of errors associated with the product
        - 404:  The product with the specified id does not exist in the products list
        - 500:  The server encountered an unexpected condition which prevented it from fulfilling the request

Validating a product

Checks whether the product is valid or not. Based on the result of the validation, a status code with or without error content is returned. The action uses HTTP POST method.

Action:

POST /api/product/validate
The data to be validated should be sent as a json-encoded array in the POST body.

Parameters:

Name:           data
Type:           JSON Object
Description:    Contains data of an individual product that is to be validated
                Please refer to "Product Data" for the basic properties of a product data.
                Note: Please refer to "If the action is not successful" in 'Output' section below if the conditions are not satisfied   

Example

POST /api/product/validate
POSTbody:   {
                "Brand": "xyz",
                "ModelNumber": "null"
            }

Response

Returns a HTTP code based on the output of the action

If the action is successful - 
    Return Value:
        - 200:  The product is valid and contains no errors.

If the action is not successful-
    Return Value:
        - 400:  The product is invalid. It also returns a list of errors associated with the product
        - 500:  The server encountered an unexpected condition which prevented it from fulfilling the request

Submit a file to a product

Uploads a new documentation file, which is associated to a product saved in the product list. The action uses HTTP POST method. Each action has an associated product ID (SSLProductID) and the category of the documentation.

Action:

POST    /api/product/:id/fileupload/:category
The file to be saved should be sent in the POST body. 

Parameters: Name: id Type: integer Description: The id of the product in the products list Condition: - The value of id should be greater than 0. - There should exist atleast one product with the specified id in the products list. Note: Please refer to "If the action is not successful" in 'Output' section below if the conditions are not satisfied

Name:           category
Type:           string
Description:    The category of the uploaded file
Condition:      - The value of category should be 1 of the specified categories
Categories:     lm79 -                      LM-79 documentation
                lm80 -                      LM-80 documentation
                istmt -                     ISTMT documentation
                tm21 -                      TM-21 documentation     
                calculation-methodology -   Calculation Methodology
                lumen-maintenance -         Lumen Maintenance Documentation

Example

POST /api/product/43423/fileupload/lm79

Response

Returns a HTTP code based on the output of the action

If the action is successful - 
    Return Value:
        - 201:  The product is saved in the products list

If the action is not successful-
    Return Value:
        - 401:  You are not authorized to create this product
        - 500:  The server encountered an unexpected condition which prevented it from fulfilling the request

Deleting a file associated to a product

Deletes a file with the specified File Code. The action uses a HTTP DELETE method. If you delete a 'required' file and try to submit a product, it will fail

Action:

DELETE /api/product/filedelete/:filecode

Parameters:

Name:           filecode
Type:           string
Description:    The File Code of the file
Condition:      The value of id should be a valid File Code.
                There should exist atleast one file with the specified id 
Note: Please refer to "If the action is not successful" in 'Output' section below if the conditions are not satisfied   

Example

DELETE /api/product/filedelete/abCdEfghIjK

Response

Returns a HTTP code based on the output of the action

If the action is successful - 
    Return Value:
        - 200:  The file with the specified File Code is deleted 

If the action is not successful-
    Return Value:
        - 400:  The specified File Code is invalid
        - 401:  You are not authorized to delete this file
        - 404:  The file with the specified File Code was not found
                Note: 404 only occurs if the id is greater than 0.
        - 500:  The server encountered an unexpected condition which prevented it from fulfilling the request