Let SuperIT check a device's warranty status from the manufacturer's API using its serial number

Let the SuperIT agent check whether a device is still under warranty, and until when, so engineers know whether to log a manufacturer repair or quote a replacement. For MSPs and IT teams with a manufacturer warranty API key, such as Dell TechDirect.

Runs in Cloud sandbox (PowerShell)
Uses API key credential (client ID and secret stored as custom headers)
Suggested approval None (engineers and admins run it without approval), because it only reads
Category Integrations

Test it with SuperIT before you rely on it

This is an example, not a ready-made action, and it hasn't been tested end to end. The Dell token address, entitlement endpoint and response fields are illustrative; check them against Dell's current TechDirect API documentation. Before you use it, work through it with SuperIT: ask SuperIT to review the script against your environment and requirements, and adjust it together. Then test it, as in Test it. Test in the action editor isn't a dry run: it runs the script for real.

Why use an action instead of asking SuperIT

SuperIT already knows a managed device's serial number, but it has no access to the manufacturer's warranty system: it can't store an API key and can't call arbitrary web APIs, only search the public web. This action holds the client ID and secret encrypted, fetches a token and calls the manufacturer's API in the cloud sandbox, so SuperIT can add the manufacturer's answer when an engineer asks.

For the device's model, serial number or hardware readings, just ask SuperIT in chat.

When to use it

  • "Is this laptop still under warranty?"
  • "The disk in SRV-HV01 is failing. Can we get Dell to replace it?"
  • "When does the warranty on 7XK2M93 end?"

Give the SuperIT agent the device's serial number (the Dell service tag) and it passes it to the action. If you don't have it to hand, ask SuperIT to find it on the device first.

What the action does

  1. Reads the serial input and checks it looks like a service tag.
  2. Requests an access token from the manufacturer with the client ID and secret from the linked credential. This is the OAuth client-credentials flow, done inside the script.
  3. Calls the warranty endpoint for that serial.
  4. Prints the model, ship date and each warranty entitlement with its end date, and says whether the device is covered today.

What it doesn't do:

  • It doesn't open a repair case with the manufacturer. To submit one through a web portal, see Fill in a web form on a vendor portal.
  • It doesn't update your PSA configuration or documentation with the warranty date.
  • It doesn't use SuperIT's OAuth credential type. SuperIT's OAuth credentials work with Microsoft only, so the script fetches its own token.

Before you begin

  • Manufacturer API access. Dell issues warranty API keys through TechDirect. Other manufacturers have their own programmes.
  • A credential. Under Workflows → Credentials, select New, name it Dell TechDirect and choose Custom HTTP headers (under Advanced). Add two rows: client_id with your client ID and client_secret with your secret. The script reads them as CREDENTIAL_DELL_TECHDIRECT_CLIENT_ID and CREDENTIAL_DELL_TECHDIRECT_CLIENT_SECRET. Values are encrypted at rest and never shown again. See Credentials.
  • No authorization policy is needed for a read-only lookup. See Approvals.
  • Your role. Creating an action in chat needs the Admin role. Engineers can build it by hand under Workflows → Actions.

Build it with SuperIT

Create an action called "Look up Dell warranty".
Purpose: check a Dell device's warranty by service tag and say whether it is covered today.
Runtime: PowerShell in the cloud sandbox, using Invoke-RestMethod.
Input: serial (string, required) - Dell service tag.
Credential: "Dell TechDirect" (custom headers client_id and client_secret). Get an OAuth client-credentials token in the script, then call the asset entitlements endpoint.
Read-only. Print model, ship date, each entitlement with start and end date, and "Covered until <date>" or "Out of warranty since <date>".
No authorization policy: engineers and admins only, no approval.

SuperIT drafts the script, validates it and creates the action as a draft. You review it, test it and publish it under Workflows → Actions.

Or build it yourself

Name Type Required Example
serial string Yes 7XK2M93

Set Runtime to PowerShell:

# Goal: look up a Dell service tag's warranty entitlements (read-only) and say whether it is covered today.
$tokenUrl = "https://apigtwb2c.us.dell.com/auth/oauth/v2/token"
$warrantyUrl = "https://apigtwb2c.us.dell.com/PROD/sbil/eapi/v5/asset-entitlements"
$clientId = $env:CREDENTIAL_DELL_TECHDIRECT_CLIENT_ID
$clientSecret = $env:CREDENTIAL_DELL_TECHDIRECT_CLIENT_SECRET

function Invoke-DellWarrantyLookup {
    param([string]$Serial)

    $tag = $Serial.Trim().ToUpper()
    Assert-Inputs -Serial $tag
    $accessToken = Get-DellAccessToken
    $asset = Get-DellAsset -Serial $tag -AccessToken $accessToken
    $entitlements = @(Get-Entitlement -Asset $asset)
    $warrantyEnd = if ($entitlements.Count -gt 0) { $entitlements[-1].end } else { $null }
    $covered = Test-WarrantyCovered -WarrantyEnd $warrantyEnd
    Write-WarrantySummary -Serial $tag -Asset $asset -Entitlements $entitlements -WarrantyEnd $warrantyEnd -Covered $covered
    # $script: so the runner can still read $result after this function returns.
    $script:result = @{
        serial       = $tag
        model        = $asset.productLineDescription
        covered      = $covered
        warranty_end = $warrantyEnd
        entitlements = $entitlements
    }
}

function Assert-Inputs {
    param([string]$Serial)
    if ($Serial -notmatch '^[A-Z0-9]{5,12}$') { throw "'$Serial' doesn't look like a service tag." }
    if (-not $clientId -or -not $clientSecret) {
        throw "The 'Dell TechDirect' credential is missing client_id or client_secret."
    }
}

function Get-DellAccessToken {
    $body = @{ grant_type = "client_credentials"; client_id = $clientId; client_secret = $clientSecret }
    try {
        $response = Invoke-RestMethod -Method Post -Uri $tokenUrl -TimeoutSec 30 `
            -ContentType "application/x-www-form-urlencoded" -Body $body
    } catch {
        throw "Failed to get a Dell access token: $($_.Exception.Message)"
    }
    return $response.access_token
}

function Get-DellAsset {
    param([string]$Serial, [string]$AccessToken)
    try {
        $assets = @(Invoke-RestMethod -Uri "$($warrantyUrl)?servicetags=$([uri]::EscapeDataString($Serial))" `
            -Headers @{ Authorization = "Bearer $AccessToken" } -TimeoutSec 30)
    } catch {
        throw "Failed to get Dell warranty for '$Serial': $($_.Exception.Message)"
    }
    if ($assets.Count -eq 0 -or $null -eq $assets[0] -or $assets[0].invalid) {
        throw "Dell doesn't recognise service tag $Serial."
    }
    return $assets[0]
}

function Get-Entitlement {
    param($Asset)
    # Sorted by end date, so the last entry is the latest cover.
    return @($Asset.entitlements | Where-Object { $_ } | ForEach-Object {
        [ordered]@{
            service = $_.serviceLevelDescription
            start   = Format-Date $_.startDate
            end     = Format-Date $_.endDate
        }
    } | Sort-Object -Property { $_.end })
}

function Test-WarrantyCovered {
    param([string]$WarrantyEnd)
    $today = [datetime]::UtcNow.ToString('yyyy-MM-dd')
    return [bool]($WarrantyEnd -and [string]::CompareOrdinal($WarrantyEnd, $today) -ge 0)
}

function Format-Date {
    param($Value)
    # Invoke-RestMethod turns ISO timestamps into [datetime] objects.
    if ($Value -is [datetime]) { return $Value.ToUniversalTime().ToString('yyyy-MM-dd') }
    $text = "$Value"
    if ($text.Length -gt 10) { return $text.Substring(0, 10) }
    return $text
}

function Write-WarrantySummary {
    param([string]$Serial, $Asset, [object[]]$Entitlements, [string]$WarrantyEnd, [bool]$Covered)
    Write-Output "=== DELL WARRANTY ==="
    Write-Output "Service tag : $Serial"
    Write-Output "Model       : $($Asset.productLineDescription)"
    Write-Output "Shipped     : $(Format-Date $Asset.shipDate)"
    foreach ($e in $Entitlements) { Write-Output "- $($e.service): $($e.start) to $($e.end)" }
    if ($Covered) {
        Write-Output "Covered until $WarrantyEnd."
    } else {
        Write-Output "Out of warranty since $(if ($WarrantyEnd) { $WarrantyEnd } else { 'unknown' })."
    }
}

Invoke-DellWarrantyLookup -Serial $ctx.inputs.serial

Test it

  1. Save the draft and select Test.
  2. Test is not a dry run: it skips authorization and approvals and uses the real credential and network access. This action only reads, so testing is safe. Test runs aren't billed.
  3. Test with a service tag you know is in warranty, one that's out of warranty, and one made-up tag.
  4. Compare the dates with the manufacturer's support website.
  5. Select Publish.

Use it

  • In chat: an engineer working a hardware ticket asks "Is this device under warranty? Its service tag is 7XK2M93." SuperIT runs the action with that serial.
  • In a hardware fault investigation: SuperIT can recommend the action when a ticket describes failing hardware. The investigation only recommends it: an engineer runs it, or Run automatically does if the action has an authorization policy, and the warranty answer appears in the run's output, not in the investigation's findings.
  • Fleet check: change the input to a string[] of serials, and the script to loop over them, to list devices whose warranty ends in the next 90 days.

Variations

  • Lenovo and other manufacturers: most have their own warranty API. Check the manufacturer's API documentation for the address and how it authenticates, and store the key with Other (custom header) or Custom HTTP headers.
  • Manufacturer without an API: use a Playwright action to type the serial into the manufacturer's public warranty page and read the result.
  • Write it back: add a second action that updates the warranty date on the PSA configuration item, with its own approval.