Dell Asset API Authentication
I'm no great coder but have a reasonable foundation. I'm trying to get warranty details from the Dell Asset API but apparently, it's so easy to access, that they didn't think it was necessary to create documentation. There's a link to documentation which leads to a page that states that there is no documentation for this API.Scouring the web leads me to a couple of approaches. One seems to just use the API key for authentication. Others include both the API key and a clientID. I can't find anything named clientID in the developer portal. I've tried the API_ID but that doesn't appear to work.I also checked Postman to see if there were any useful hints but I'm pretty sure it just led me to further confusion.
I tried posting my question to the Dell Developers' Forum but it's not accepting posts for an unnamed reason. <sigh>
Below is the current iteration of my PHP code. Can someone help a brother out and point out what I'm missing?
Thanks in advance.
<?php
$Url = "https://apigtwb2c.us.dell.com/PROD/sbil/eapi/v5/asset-entitlements?servicetags=C134LR3";
$ch = curl_init($Url);
$api_auth = base64_encode("123456789");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Basic ' . $api_auth,
'content-type: application/json' ]);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
// Execute the cURL request $response = curl_exec($ch);
// Check for cURL errors and handle them if necessary
if (curl_errno($ch)) {
echo 'cURL error: ' . curl_error($ch);
}
// Close the cURL resource curl_close($ch);
// Check if the request was successful
if ($response === false) {
echo 'API request failed';
} else {
// Parse the JSON response
$data = json_decode($response, true);
}
print_r($data);
?>
Posted Jan 18, 2024, 6:58 PM UTC