L'API d'inventaire de CSC LED

Branchez-vous dès aujourd'hui et accédez aux données de produits en temps réel pour votre site Web.

Générer votre jeton d'accès


Avant d'utiliser l'API ci-dessous, vous devrez générer votre jeton d'accès à l'aide de l'adresse courriel et du mot de passe enregistrés auprès de CSC LED.
Si vous n'êtes pas encore inscrit auprès de CSC LED pour accéder à notre API, veuillez communiquer avec info@csc-led.com et demander l'accès à l'API d'inventaire.
Une fois votre identifiant et votre mot de passe en main, l'étape suivante consiste à générer votre jeton d'accès en envoyant une requête POST à 'https://api.dev2024site.com/api/v1/token' avec l'adresse courriel et le mot de passe enregistrés pour l'accès à l'API, avec grant type = password.
Voici quelques exemples pour générer votre jeton d'accès :
var client = new RestClient("https://api.dev2024site.com/api/v1/token");
    client.Timeout = -1;
    var request = new RestRequest(Method.POST);
    request.AddHeader("Content-Type", "text/plain");
    request.AddParameter("text/plain", "grant_type=password&username=youremail@domain.com&password=password",  ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);
    Console.WriteLine(response.Content);
Si vos identifiants sont corrects, vous recevrez une réponse JSON avec un code de réponse 200 (OK) (comme illustré ci-dessous).
{
    "access_token": "123456789-0123456-cB9GVU9PNCGosw0edOKNPF-9wmGdPwaOvaoR2ehdazR_2Xr_ZxySf2e2oDxiMGeMtGUGRYXjaCWVjinmKrdOxQj6k2Gcr4Bts-g55GOG3s1iLNVSf0wb2_ZApi4WuIBQddUIuJ9v8kYnUoHqap95XO1zCe4xzxQNebQrwss5AHpwRANI1deVaZWPS3dX6s0-5gHdKoO1utFRZAvl36b7HBUjsejWcq1HLZv2dwsjx8xX8M885B7qrfjRO305",  // updated access_token
    "token_type": "bearer",
    "expires_in": 3599,
    "refresh_token": "12345678-99ae-4aa6-a278-7aa1c36721c9",  // new refresh_token
    "userName": "youremail@gmail.com",
    "issued": "Mon, 22 Jan 2024 11:26:59 GMT",
    "expires": "Mon, 22 Jan 2024 12:26:59 GMT"
}
Si vos renseignements sont incorrects ou périmés, vous recevrez une erreur avec le statut 400 (Bad request), comme illustré ci-dessous.
{
    "error": "invalid_grant",
    "error_description": "Either email or password is incorrect"
}

Actualiser votre jeton d'accès


Pour actualiser votre jeton d'accès, vous devrez envoyer votre access_token comme « Authorization » dans l'en-tête de votre requête avec le refresh_token courant, et définir grant_type à refresh_token comme paramètres du corps de la requête.
Par conséquent, les paramètres du corps de votre requête POST devraient maintenant contenir
grant_type=refresh_token&refresh_token=123456890-7ae6-4717-94ed-634550d75c62
au lieu de
grant_type=password&username=youremail@domain.com&password=password
Exemple :
var client = new RestClient("https://api.dev2024site.com/api/v1/token");
  client.Timeout = -1; 
  var request = new RestRequest(Method.POST);
  request.AddHeader("Content-Type", "text/plain");
  request.AddParameter("text/plain", "grant_type=refresh_token&refresh_token=123456890-7ae6-4717-94ed-634550d75c62",ParameterType.RequestBody); 
  IRestResponse response = client.Execute(request); 
  Console.WriteLine(response.Content);
Si votre demande d'actualisation du jeton réussit, vous recevrez un access_token et un refresh_token mis à jour. Utilisez-les pour récupérer des données de notre API ou pour actualiser votre jeton.
Si votre requête réussit, vous recevrez la réponse ci-dessous :
{
  "access_token": "123456789-0123456-cB9GVU9PNCGosw0edOKNPF-9wmGdPwaOvaoR2ehdazR_2Xr_ZxySf2e2oDxiMGeMtGUGRYXjaCWVjinmKrdOxQj6k2Gcr4Bts-g55GOG3s1iLNVSf0wb2_ZApi4WuIBQddUIuJ9v8kYnUoHqap95XO1zCe4xzxQNebQrwss5AHpwRANI1deVaZWPS3dX6s0-5gHdKoO1utFRZAvl36b7HBUjsejWcq1HLZv2dwsjx8xX8M885B7qrfjRO305",  // updated access_token
  "token_type": "bearer",
  "expires_in": 3599,
  "refresh_token": "12345678-99ae-4aa6-a278-7aa1c36721c9",  // new refresh_token
  "userName": "youremail@gmail.com",
  "issued": "Mon, 22 Jan 2024 11:26:59 GMT",
  "expires": "Mon, 22 Jan 2024 12:26:59 GMT"
}
Si le jeton d'actualisation fourni n'était pas correct, vous recevrez l'erreur ci-dessous.
{
 "error": "invalid_grant"
}
Si votre access_token ou votre refresh_token a expiré ou si vos droits d'accès à l'API ont été révoqués, vous recevrez l'erreur suivante :
{
    "Message": "Authorization has been denied for this request."
}
Le jeton d'actualisation expire après 2 heures, tandis que le jeton d'accès expire après 1 heure. Vous devez conserver votre refresh_token afin d'actualiser l'access_token et de pouvoir générer un nouvel access_token et un nouveau refresh_token. Si votre jeton d'actualisation expire, vous devrez en demander un nouveau à l'aide de l'adresse courriel et du mot de passe enregistrés pour l'API, comme expliqué précédemment.

Appeler notre API d'inventaire


APIDescription
GET api/v1.1/inventory/getInventoryList?pageNumber={pageNumber}&pageSize={pageSize}Retrieve the full inventory list with all v1.1 fields, including Emergency Lighting updates.
GET api/v1.1/inventory/get?productNumber={productNumber}Look up an individual product by product number and receive the expanded v1.1 field set.

Remarque : Ces points de terminaison reflètent la plus récente version de notre API d'inventaire. Si vous utilisez encore une version antérieure, les champs nouvellement ajoutés peuvent ne pas apparaître dans vos réponses. Veuillez mettre à jour votre intégration pour assurer une compatibilité complète avec les fonctionnalités actuelles de l'API.

Quel inventaire est disponible?

Tous les produits CSC LED affichés sur notre site Web sont disponibles par l'entremise de cette API. Cela comprend les produits en liquidation, en fin de vie ou même inactifs. Si vous ne souhaitez pas inclure ces produits sur votre site Web, filtrez-les à l'aide des champs Clearance et Lifecycle Status inclus dans l'API.

Paramètres d'inventaire

Renseignements d'inventaire disponibles pour votre site Web.

NomDescriptionType
AmperageAmperagedecimal
BaseProducts base.string
Battery Amp HoursBattery amp hoursdecimal
Battery CapacityCapacity of the batterystring
Battery Recharge TimeTime required to recharge the batteryinteger
Battery TypeBattery type usedstring
Battery VoltageBattery voltagedecimal
BeamAngleProduct's beam angle.string
CartonHeightThe carton's height in inches.string
CartonLengthThe carton's length in inches.string
CartonWeightThe carton's weight.string
CartonWidthThe carton's width in inches.string
CertificationListedProduct's certifications.string
ColorTemperatureProduct's colour temperature.string
CRIProduct's CRI.string
CSCcULNumberProduct's cUL number.string
CSCDLCNumberProduct's DLC number.string
DepartmentCSC LED's department assignment.string
DimmableProduct's dimmable setting.string
EfficacyProduct's efficacy.string
FinishProduct's finish material.string
FinishColorProduct's finish colour.string
GTINProduct's GTIN.string
HighResolutionPhotosListThe URL paths for the product's high resolution photos.array
HousingProduct's housing material.string
IESFilesListThe URL paths for the product's IES files.array
InitialLumensProduct's initial lumens.string
IPRatingProduct's IP rating.string
IsClearanceIndicates whether the product is classified as clearance.boolean
Lamp Head MaterialMaterial used for the lamp head housingstring
Lamp Head WattsPower per lamp headinteger
Lamp Input VoltageInput voltage for lamp headsstring
LifecycleActiveDateThe date in which CSC LED released the product.string
LifecycleStatusCSC LED's assigned lifecycle status.string
LifeL70Product's Life (L70).string
LowResolutionPhotoURLThe URL path for the product's low resolution photo.string
MarketingMaterialsListThe URL paths for the product's Marketing Material files.array
MasterCartonHeightThe master carton's height in inches.string
MasterCartonLengthThe master carton's length in inches.string
MasterCartonWeightThe master carton's weight in pounds.string
MasterCartonWidthThe master carton's width in inches.string
Max Discharge TimeMaximum discharge timeinteger
MetaDescriptionThe product's meta description as created by CSC LED.string
MetaKeywordsThe product's meta keywords as assigned by CSC LED.string
Miscellaneous1URLThe URL path for the product's miscellaneous file 01.string
Miscellaneous2URLThe URL path for the product's miscellaneous file 02.string
MountingTypeProduct's mounting type.string
Number of Lamp HeadsNumber of individual lamp headsinteger
OperatingTemperatureProduct's operating temperature range in celcius.string
OperationInstructionsURLThe URL path for product's operation instruction file.string
OtherListThe URL paths for the product's files categorized as other.array
PowerCordLengthIncluded power cord length, if applicable.string
PowerFactorProduct's power factor.string
ProductDescriptionShort product description.string
ProductIdOur unique CSC LED product Id.integer
ProductNumberOur unique CSC LED product number.string
ProductSeriesThe CSC LED product series this product belongs to.string
ProductTypeCSC LED's product type classification.string
QtyPerCartonThe number of products within each carton.string
QtyPerMasterCartonThe number of cartons within each master carton.integer
QtyPerSkidThe number of products which can be stored on a single skid.string
SpecSheetFilesListThe URL paths for the product's Spec Sheet files.array
StockImmediateTotal available stock at AB, BC and ON warehouses.integer
StockOnHandTotal available stock at AB, BC and ON warehouses, inclusive of branch transfers.integer
SuggestedTradeSuggested trade unit price.decimal number
TechnicalDocumentsListThe URL paths for the product's Technical Document files.array
THDProduct's THD as percentage.string
Total LumensTotal light output producedinteger
TotalAvailableForSaleTotal available stock at AB, BC and ON warehouses, inclusive of branch transfers and incoming restock orders.integer
TradeSizeThe product's approximate size for website filtering.string
UnitGrossWeightThe product's gross weight.string
UnitHeightThe product's height in inches.string
UnitLengthThe product's length in inches.string
UnitWidthThe product's width in inches.string
UPCProduct's UPC.string
VoltageProduct's voltage.string
WattsProduct's wattage.string
WebsiteDescriptionProduct's full website description.string
WebsiteNameThe name of the product.string
YourPricePrice per unit.decimal number

Journal des modifications de l'API d'inventaire


DateVersionRésumé des mises à jour
9 oct. 2025v1.1
  • Points de terminaison mis à jour vers la v1.1 pour Inventory List et Product Details.
  • Ajout de nouveaux champs d'éclairage d'urgence, y compris les spécifications de batterie et de tête de lampe (voir la liste complète dans la section Paramètres d'inventaire).
  • Le point de terminaison du jeton demeure en v1 (inchangé).
  • Vous devez utiliser la v1.1 pour accéder aux nouveaux champs. La version v1 ne les inclut pas.
1er sept. 2020v1Version initiale de l'API d'inventaire