Retrieve latest imported snapshot timestamp

This command retrieves the latest imported snapshot timestamp.

API request 

Method GET 

/users/{account_id}/devices/{connector_id}/history/latest_imported

Example

Method GET

https://dk-co.keepit.com/users/5t1sbe-s6zsgx-rtutxq/devices/11ptlk-st7sly-ggba4c/history/latest_imported

Response

Code: 200 OK

Response body:

<backup>
    <root>qd77638f69d92e0f0853fgh631363098cdfd2119b2fdb44d6cbe</root>
    <tstamp>2025-05-12T12:17:53Z</tstamp>
</backup>

PowerShell script

try {
    $username = '<API Token username>'
    $password = '<API Token password>'
    $hostname = 'dk-co.keepit.com'
    $userId = '<Account GUID>'
    $connectorId = '<Connector GUID>'

    $basicauth = [Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes("${username}:${password}"))
    $headers = @{
        "User-Agent"    = "PowerShell-Keepit-API-Agent-1.0"
        "Authorization" = "Basic $basicauth"
    }

    $url = "https://${hostname}/users/${userId}/devices/${connectorId}/history/latest_imported"
    $response = Invoke-WebRequest -UseBasicParsing -Uri $url -Method GET -Headers $headers -TimeoutSec 10 -ErrorAction Stop


    $xmlContent = [xml]$response.Content

    foreach ($node in $xmlContent.backup.ChildNodes) {
        Write-Host "$($node.Name): $($node.InnerText)"

    }

}

catch {
    $line = $_.InvocationInfo.ScriptLineNumber
    Write-Host "Cannot query Keepit API due to: $_"
    Write-Host "at line $line"
}

Script result

root: dd79478f69d92e0f0853f69842cdfd2119b2fdb4447fde98f37ba7be4d1d6cbe
tstamp: 2025-05-12T12:17:53Z