NAV -image
bash javascript php python

Introduction

How to use this document

Each data endpoint of Keydeploy is accessible via connection with the API. The API documentation gives reference to connect to each data endpoint with command examples. The API will allow the information to be shared with other enterprise systems such as an ERP. The user of the API will need to construct their commands to read out the information necessary for their business use case.

Assumptions, clarifications, and exceptions

Base URL

https://api.keydeploy.net

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

Your token can be created and issued upon request to support@keydeploy.com

Diagnostics

Endpoint for all information related to hardware diagnostics

Get Diag History

requires authentication

Get all matching diagnostic history events
Limit of 1000 records
**The query parameters startDate or endDate are mutually required, if one is present the other must also be.

Example request:

curl -X GET \
    -G "https://api.keydeploy.net/api/v1/diag/history?machineSerial=ABCDEFG&type=CPU&status=PASSED&startDate=2020-01-01+00%3A00%3A00&endDate=2020-01-01+23%3A59%3A59" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://api.keydeploy.net/api/v1/diag/history"
);

let params = {
    "machineSerial": "ABCDEFG",
    "type": "CPU",
    "status": "PASSED",
    "startDate": "2020-01-01 00:00:00",
    "endDate": "2020-01-01 23:59:59",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.keydeploy.net/api/v1/diag/history',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
        ],
        'query' => [
            'machineSerial'=> 'ABCDEFG',
            'type'=> 'CPU',
            'status'=> 'PASSED',
            'startDate'=> '2020-01-01 00:00:00',
            'endDate'=> '2020-01-01 23:59:59',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.keydeploy.net/api/v1/diag/history'
params = {
  'machineSerial': 'ABCDEFG',
  'type': 'CPU',
  'status': 'PASSED',
  'startDate': '2020-01-01 00:00:00',
  'endDate': '2020-01-01 23:59:59',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200, Success):

{
    "message": "Records pulled successfully",
    "data": {
        "ABCDEFG": [
            {
                "ID": "1",
                "Type": "MEMORY",
                "Status": "STARTED",
                "Date": "2020-01-01 00:00:00"
            },
            {
                "ID": "2",
                "Type": "CPU",
                "Status": "STARTED",
                "Date": "2020-01-01 00:00:00"
            },
            {
                "ID": "3",
                "Type": "STORAGE",
                "Status": "STARTED",
                "Date": "2020-01-01 00:00:00"
            },
            {
                "ID": "4",
                "Type": "CPU",
                "Status": "PASSED",
                "Date": "2020-01-01 23:59:59"
            },
            {
                "ID": "5",
                "Type": "STORAGE",
                "Status": "FAILED",
                "Date": "2020-01-01 23:59:59"
            },
            {
                "ID": "6",
                "Type": "MEMORY",
                "Status": "PASSED",
                "Date": "2020-01-01 23:59:59"
            }
        ]
    }
}

Example response (400, No matching records):

{
    "message": "No records found"
}

Request   

GET api/v1/diag/history

Query Parameters

machineSerial  string optional  
The serial for the given computer you wish to search for.

type  string optional  
Name of a specific diagnostic test type.
Valid values: [ Memory , CPU , Storage ]

status  string optional  
Name of a specific diagnostic test status.
Valid values: [ Started , Passed , Failed ]

startDate  string optional  
The start date for an event date range you wish to search for.

endDate  string optional  
The end date for an event date range you wish to search for.

DPK

All information related to Digital Product Keys

Get DPK Info

requires authentication

Get information for any matching Digital Product Keys for the given search criteria
You must select at least one filter for your search
Limit of 1000 records

Example request:

curl -X GET \
    -G "https://api.keydeploy.net/api/v1/dpk?machineSerial=ABCDEFG&productKeyID=0123456789012&productKey=AAAAA-BBBBB-CCCCC-DDDDD-EEEEE" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://api.keydeploy.net/api/v1/dpk"
);

let params = {
    "machineSerial": "ABCDEFG",
    "productKeyID": "0123456789012",
    "productKey": "AAAAA-BBBBB-CCCCC-DDDDD-EEEEE",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.keydeploy.net/api/v1/dpk',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
        ],
        'query' => [
            'machineSerial'=> 'ABCDEFG',
            'productKeyID'=> '0123456789012',
            'productKey'=> 'AAAAA-BBBBB-CCCCC-DDDDD-EEEEE',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.keydeploy.net/api/v1/dpk'
params = {
  'machineSerial': 'ABCDEFG',
  'productKeyID': '0123456789012',
  'productKey': 'AAAAA-BBBBB-CCCCC-DDDDD-EEEEE',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200, Success):

{
    "message": "Records pulled successfully",
    "data": [
        {
            "InstanceID": "1",
            "ProductKeyID": "0123456789012",
            "ProductKey": "AAAAA-BBBBB-CCCCC-DDDDD-EEEEE",
            "MachineSerial": "ABCDEFG",
            "CoaType": "10P",
            "BusinessID": "10001",
            "DateAdded": "2020-01-01 00:00:00"
        }
    ]
}

Example response (400, No matching records):

{
    "message": "No records found"
}

Request   

GET api/v1/dpk

Query Parameters

machineSerial  string optional  
The serial for the given computer you wish to search for.

productKeyID  string optional  
The id number for the given Digital Product Key you wish to search for.

productKey  string optional  
The product key for the given Digital Product Key you wish to search for.

Machines

APIs endpoints and calls for Machines

Get Machine Info

requires authentication

Get all the basic information for a machine You must select at least one filter for your search

Example request:

curl -X GET \
    -G "https://api.keydeploy.net/api/v1/machine?machineSerial=ABCDEFG&assetTag=ASSET123&purchaseOrder=PO123&brand=HP&model=800G3&formFactor=Tower&grade=A%2B&gradeComment=Broken+screen&generalComment=Stickers+on+lid&webcam=Yes&touchscreen=No&wifi=Yes&bluetooth=No&cardreader=Yes&defect=Lid+Damage" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://api.keydeploy.net/api/v1/machine"
);

let params = {
    "machineSerial": "ABCDEFG",
    "assetTag": "ASSET123",
    "purchaseOrder": "PO123",
    "brand": "HP",
    "model": "800G3",
    "formFactor": "Tower",
    "grade": "A+",
    "gradeComment": "Broken screen",
    "generalComment": "Stickers on lid",
    "webcam": "Yes",
    "touchscreen": "No",
    "wifi": "Yes",
    "bluetooth": "No",
    "cardreader": "Yes",
    "defect": "Lid Damage",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.keydeploy.net/api/v1/machine',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
        ],
        'query' => [
            'machineSerial'=> 'ABCDEFG',
            'assetTag'=> 'ASSET123',
            'purchaseOrder'=> 'PO123',
            'brand'=> 'HP',
            'model'=> '800G3',
            'formFactor'=> 'Tower',
            'grade'=> 'A+',
            'gradeComment'=> 'Broken screen',
            'generalComment'=> 'Stickers on lid',
            'webcam'=> 'Yes',
            'touchscreen'=> 'No',
            'wifi'=> 'Yes',
            'bluetooth'=> 'No',
            'cardreader'=> 'Yes',
            'defect'=> 'Lid Damage',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.keydeploy.net/api/v1/machine'
params = {
  'machineSerial': 'ABCDEFG',
  'assetTag': 'ASSET123',
  'purchaseOrder': 'PO123',
  'brand': 'HP',
  'model': '800G3',
  'formFactor': 'Tower',
  'grade': 'A+',
  'gradeComment': 'Broken screen',
  'generalComment': 'Stickers on lid',
  'webcam': 'Yes',
  'touchscreen': 'No',
  'wifi': 'Yes',
  'bluetooth': 'No',
  'cardreader': 'Yes',
  'defect': 'Lid Damage',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200, Success):

{
    "message": "Records pulled successfully",
    "data": {
        "ABCDEFG": {
            "serial": "ABCDEFG",
            "AssetTag": "ASSET123",
            "PurchaseOrder": "PO123",
            "Grade": "A+",
            "GradeComments": "stickers on lid",
            "GeneralComments": "backlit keyboard",
            "Brand": "Hewlett-Packard",
            "Model": "HP EliteBook 8440p",
            "FormFactor": "Laptop",
            "CurrentSpecs": {
                "Processor": "Intel(R) Core(TM) i5 CPU M 540 @ 2.53GHz",
                "Memory": [
                    {
                        "sku": "RAM-SODIMM-2048-DDR3-1333",
                        "serial": "12345"
                    },
                    {
                        "sku": "RAM-SODIMM-2048-DDR3-1333",
                        "serial": "67890"
                    }
                ],
                "Storage": [
                    {
                        "sku": "HDD-SATA-250GB",
                        "serial": "123"
                    },
                    {
                        "sku": "HDD-SATA-16GB",
                        "serial": "456"
                    }
                ],
                "Opticals": [
                    {
                        "sku": "hp CDDVDW TS-L633R"
                    }
                ],
                "VideoCards": [
                    {
                        "sku": "VEN_80EE&DEV_BEEF&SUBSYS_040515AD"
                    }
                ]
            },
            "Webcam": "Yes",
            "Touchscreen": "No",
            "Wifi": "Yes",
            "Bluetooth": "No",
            "Cardreader": "Yes",
            "Defects": [
                "Bad Battery"
            ]
        }
    }
}

Example response (400, No matching records):

{
    "message": "No records found"
}

Request   

GET api/v1/machine

Query Parameters

machineSerial  string optional  
The serial for the given computer you wish to search for.

assetTag  string optional  
Search for a machine with a specific aseet tag.

purchaseOrder  string optional  
Search for all machines with a given purchase order number.

brand  string optional  
Searh for machines with a specific brand/manufacturer.
Allows for partial matching.

model  string optional  
Searh for machines with a specific model.
Allows for partial matching.

formFactor  string optional  
Searh for machines with a specific form factor.
Valid values: [ Laptop, Mini Form Factor, Ultra Small Form Factor, Small Form Factor, Desktop, Tower, All In One]

grade  string optional  
Search for machines with a specifc grade.
Valid values: [ A+, A, B, C, D, F ]

gradeComment  string optional  
Search for any grade comments that include your given string.
Allows for partial matching.

generalComment  string optional  
Search for any general comments that include your given string.
Allows for partial matching.

webcam  string optional  
Search for machines with or without a webcam.
Valid values: [ Yes, No ]

touchscreen  string optional  
Search for machines with or without a touchscreen.
Valid values: [ Yes, No ]

wifi  string optional  
Search for machines with or without a wifi card.
Valid values: [ Yes, No ]

bluetooth  string optional  
Search for machines with or without a bluetooth card.
Valid values: [ Yes, No ]

cardreader  string optional  
Search for machines with or without a cardreader.
Valid values: [ Yes, No ]

defect  string optional  
The name of a specific defect checkpint to search for. Value must be one of the defined defect checkpoints defined in your admin settings.

Get Spec History

requires authentication

Get the spec history events for the specs captured in a machine
**The query parameters startDate or endDate are mutually required, if one is present the other must also be.

Example request:

curl -X GET \
    -G "https://api.keydeploy.net/api/v1/machine/specs/history?machineSerial=ABCDEFG&startDate=2020-01-01+00%3A00%3A00&endDate=2020-01-01+23%3A59%3A59" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://api.keydeploy.net/api/v1/machine/specs/history"
);

let params = {
    "machineSerial": "ABCDEFG",
    "startDate": "2020-01-01 00:00:00",
    "endDate": "2020-01-01 23:59:59",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.keydeploy.net/api/v1/machine/specs/history',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
        ],
        'query' => [
            'machineSerial'=> 'ABCDEFG',
            'startDate'=> '2020-01-01 00:00:00',
            'endDate'=> '2020-01-01 23:59:59',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.keydeploy.net/api/v1/machine/specs/history'
params = {
  'machineSerial': 'ABCDEFG',
  'startDate': '2020-01-01 00:00:00',
  'endDate': '2020-01-01 23:59:59',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200, Success):


{
    "message": "Records pulled successfully",
    "data": {
        "ABCDEFG": [
            {
                "EventID": "2",
                "Date": "2020-01-01 23:59:59",
                "MachineSerial": "ABCDEFG",
                "EventType": "SPEC-CAPTURE",
                "Processor": "Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz",
                "Memory": [
                    {
                        "sku": "RAM-SODIMM-4096-DDR3-1600",
                        "serial": "12345"
                    },
                    {
                        "sku": "RAM-SODIMM-4096-DDR3-1600",
                        "serial": "67890"
                    }
                ],
                "Storage": [
                    {
                        "sku": "HDD-SATA-128GB-SSD",
                        "serial": "123"
                    }
                ],
                "Opticals":  [
                    {
                        "sku": "hp CDDVDW TS-L633R"
                    }
                ],
                "VideoCards": [ [
                    {
                        "sku": "VEN_80EE&DEV_BEEF&SUBSYS_040515AD"
                    }
                ]
            },
            {
                "EventID": "1",
                "Date": "2020-01-01 00:00:00",
                "MachineSerial": "ABCDEFG",
                "EventType": "EDIT",
                "Processor": "Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz",
                "Memory": [
                    {
                        "sku": "RAM-SODIMM-4096-DDR3-1600",
                        "serial": "12345"
                    }
                ],
                "Storage": [],
                "Opticals": [],
                "VideoCards": []
            }
        ]
    }
}

Example response (400, No matching records):

{
    "message": "No records found"
}

Request   

GET api/v1/machine/specs/history

Query Parameters

machineSerial  string optional  
The serial for the given computer you wish to search for.

startDate  string optional  
The start date for an event date range you wish to search for.

endDate  string optional  
The end date for an event date range you wish to search for.

Get History

requires authentication

Get a list of all history events for a given machine serial **The query parameters startDate or endDate are mutually required, if one is present the other must also be.

Example request:

curl -X GET \
    -G "https://api.keydeploy.net/api/v1/machine/history?machineSerial=ABCDEFG&startDate=2020-01-01+00%3A00%3A00&endDate=2020-01-01+23%3A59%3A59&employeeID=101" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://api.keydeploy.net/api/v1/machine/history"
);

let params = {
    "machineSerial": "ABCDEFG",
    "startDate": "2020-01-01 00:00:00",
    "endDate": "2020-01-01 23:59:59",
    "employeeID": "101",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.keydeploy.net/api/v1/machine/history',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
        ],
        'query' => [
            'machineSerial'=> 'ABCDEFG',
            'startDate'=> '2020-01-01 00:00:00',
            'endDate'=> '2020-01-01 23:59:59',
            'employeeID'=> '101',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.keydeploy.net/api/v1/machine/history'
params = {
  'machineSerial': 'ABCDEFG',
  'startDate': '2020-01-01 00:00:00',
  'endDate': '2020-01-01 23:59:59',
  'employeeID': '101',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200, Success):


{ * {
    "message": "Records pulled successfully",
    "data": {
        "ABCDEFG": [
            {
                "EventID": "2",
                "Date": "2020-01-01 23:59:59",
                "Event": "Machine Specs Captured",
                "EventType": "SPEC-CAPTURE",
                "EmployeeID": "22",
                "MachineSerial": "ABCDEFG"
            },
            {
                "EventID": "1",
                "Date": "2020-01-01 00:00:00",
                "Event": "Machine Specs Captured",
                "EventType": "SPEC-CAPTURE",
                "EmployeeID": "11",
                "MachineSerial": "ABCDEFG"
            }
        ]
    }
}

Example response (400, No matching records):

{
    "message": "No records found"
}

Request   

GET api/v1/machine/history

Query Parameters

machineSerial  string optional  
The serial for the given computer you wish to search for.

startDate  string optional  
The start date for an event date range you wish to search for.

endDate  string optional  
The end date for an event date range you wish to search for.

employeeID  string optional  
ID number for the employee attached to the history event.

Get Imaging history

requires authentication

Get a list of the machine imaging history **The query parameters startDate or endDate are mutually required, if one is present the other must also be.

Example request:

curl -X GET \
    -G "https://api.keydeploy.net/api/v1/machine/imaging/history?machineSerial=ABCDEFG&startDate=2020-01-01+00%3A00%3A00&endDate=2020-01-01+23%3A59%3A59" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://api.keydeploy.net/api/v1/machine/imaging/history"
);

let params = {
    "machineSerial": "ABCDEFG",
    "startDate": "2020-01-01 00:00:00",
    "endDate": "2020-01-01 23:59:59",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.keydeploy.net/api/v1/machine/imaging/history',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
        ],
        'query' => [
            'machineSerial'=> 'ABCDEFG',
            'startDate'=> '2020-01-01 00:00:00',
            'endDate'=> '2020-01-01 23:59:59',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.keydeploy.net/api/v1/machine/imaging/history'
params = {
  'machineSerial': 'ABCDEFG',
  'startDate': '2020-01-01 00:00:00',
  'endDate': '2020-01-01 23:59:59',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200, Success):


{{
    "message": "Records pulled successfully",
    "data": {
        "ABCDEFG": [
            {
                "EventID": "2",
                "Date": "2020-01-01 23:59:59",
                "Event": "Sealing Windows To OOBE",
                "WindowsEdition": "Windows 10 Home",
                "MachineSerial": "ABCDEFG"
            },
            {
                "EventID": "1",
                "Date": "2020-01-01 00:00:00",
                "Event": "Booting To Audit Mode",
                "WindowsEdition": "Windows 10 Home",
                "MachineSerial": "ABCDEFG"
            }
        ]
    }
}

Example response (400, No matching records):

{
    "message": "No records found"
}

Request   

GET api/v1/machine/imaging/history

Query Parameters

machineSerial  string optional  
The serial for the given computer you wish to search for.

startDate  string optional  
The start date for an event date range you wish to search for.

endDate  string optional  
The end date for an event date range you wish to search for.

Update Machine Purchase Order

requires authentication

Update the purchase order for a given machine

Example request:

curl -X POST \
    "https://api.keydeploy.net/api/v1/machine/purchaseOrder" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"machineSerial":"ABCDEFG","purchaseOrder":"PO-123"}'
const url = new URL(
    "https://api.keydeploy.net/api/v1/machine/purchaseOrder"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "machineSerial": "ABCDEFG",
    "purchaseOrder": "PO-123"
}

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.keydeploy.net/api/v1/machine/purchaseOrder',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'machineSerial' => 'ABCDEFG',
            'purchaseOrder' => 'PO-123',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.keydeploy.net/api/v1/machine/purchaseOrder'
payload = {
    "machineSerial": "ABCDEFG",
    "purchaseOrder": "PO-123"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200, Success):

{
    "message": "Records updated successfully (1)",
    "data": []
}

Example response (400, Purchase order already set):

{
    "message": "The given serial already has the specified purchase order number, update was not run",
    "data": []
}

Example response (400, No matching machine serial):

{
    "message": "No records found"
}

Request   

POST api/v1/machine/purchaseOrder

Body Parameters

machineSerial  string  
The serial for the given computer you wish to search for.

purchaseOrder  string  
The purchase order to be assigned to the machine.
Maximum of 32 characters

Update Machine Asset Tag

requires authentication

Update the asset tag for a given machine

Example request:

curl -X POST \
    "https://api.keydeploy.net/api/v1/machine/assetTag" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"machineSerial":"ABCDEFG","assetTag":"XYZ-123"}'
const url = new URL(
    "https://api.keydeploy.net/api/v1/machine/assetTag"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "machineSerial": "ABCDEFG",
    "assetTag": "XYZ-123"
}

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.keydeploy.net/api/v1/machine/assetTag',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'machineSerial' => 'ABCDEFG',
            'assetTag' => 'XYZ-123',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.keydeploy.net/api/v1/machine/assetTag'
payload = {
    "machineSerial": "ABCDEFG",
    "assetTag": "XYZ-123"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200, Success):

{
    "message": "Records updated successfully (1)",
    "data": []
}

Example response (400, Asset tag already set):

{
    "message": "The given serial already has the specified asset tag, update was not run",
    "data": []
}

Example response (400, No matching machine serial):

{
    "message": "No records found"
}

Request   

POST api/v1/machine/assetTag

Body Parameters

machineSerial  string  
The serial for the given computer you wish to search for.

assetTag  string  
The asset tag to be assigned to the machine.
Maximum of 64 characters

Scheduled Tasks

View or Add scheduled tasks for a given computer serial

Get Tasks

requires authentication

Get a list of all scheduled tasks
You must select at least one filter for your search
Limit of 1000 records
**The query parameters startDate or endDate are mutually required, if one is present the other must also be.

Example request:

curl -X GET \
    -G "https://api.keydeploy.net/api/v1/task?machineSerial=ABCDEFG&type=Imaging&status=Imaging&startDate=2020-01-01+00%3A00%3A00&endDate=2020-01-01+23%3A59%3A59" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://api.keydeploy.net/api/v1/task"
);

let params = {
    "machineSerial": "ABCDEFG",
    "type": "Imaging",
    "status": "Imaging",
    "startDate": "2020-01-01 00:00:00",
    "endDate": "2020-01-01 23:59:59",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.keydeploy.net/api/v1/task',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
        ],
        'query' => [
            'machineSerial'=> 'ABCDEFG',
            'type'=> 'Imaging',
            'status'=> 'Imaging',
            'startDate'=> '2020-01-01 00:00:00',
            'endDate'=> '2020-01-01 23:59:59',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.keydeploy.net/api/v1/task'
params = {
  'machineSerial': 'ABCDEFG',
  'type': 'Imaging',
  'status': 'Imaging',
  'startDate': '2020-01-01 00:00:00',
  'endDate': '2020-01-01 23:59:59',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200, Success):


{
    "message": "Records pulled successfully",
    "data": [
        {
            "ID": "4",
            "MachineSerial": "ABCDEFG",
            "Status": "COMPLETED",
            "Type": "Diag",
            "Settings": [
                "Hard-Drive"
            ],
            "ScheduledDate": "2020-01-01 00:00:00"
        },
        {
            "ID": "3",
            "MachineSerial": "ABCDEFG",
            "Status": "SCHEDULED",
            "Type": "Specs",
            "Settings": [
                "CaptureSpecs"
            ],
            "ScheduledDate": "2020-01-01 00:00:00"
        },
        {
            "ID": "2",
            "MachineSerial": "ABCDEFG",
            "Status": "CANCELED",
            "Type": "Specs",
            "Settings": [
                "CaptureSpecs"
            ],
            "ScheduledDate": "2020-01-01 00:00:00"
        },
        {
            "ID": "1",
            "MachineSerial": "ABCDEFG",
            "Status": "SCHEDULED",
            "Type": "Wiping",
            "Settings": [
                 "wipe_type":"NIST 800-88 Clear"
            ],
            "ScheduledDate": "2020-01-01 00:00:00"
        }
    ]
}

Example response (400, No matching records):

{
    "message": "No records found"
}

Request   

GET api/v1/task

Query Parameters

machineSerial  string optional  
The serial for the given computer you wish to search for.

type  string optional  
Name of a specific scheduled task type.
Valid values: [ Imaging , Wiping , Specs , Diag ]

status  string optional  
Name of a specific scheduled task status.
Valid values: [ Scheduled , Completed , Error , Canceled ]

startDate  string optional  
The start date for an event date range you wish to search for.

endDate  string optional  
The end date for an event date range you wish to search for.

Schedule a Wiping Task

requires authentication

Schedule a wiping task for a given computer serial

Example request:

curl -X POST \
    "https://api.keydeploy.net/api/v1/task/wiping" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"machineSerial":"ABCDEFG","wipeType":"NIST 800-88 Clear"}'
const url = new URL(
    "https://api.keydeploy.net/api/v1/task/wiping"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "machineSerial": "ABCDEFG",
    "wipeType": "NIST 800-88 Clear"
}

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.keydeploy.net/api/v1/task/wiping',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'machineSerial' => 'ABCDEFG',
            'wipeType' => 'NIST 800-88 Clear',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.keydeploy.net/api/v1/task/wiping'
payload = {
    "machineSerial": "ABCDEFG",
    "wipeType": "NIST 800-88 Clear"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200, Success):

{
    "message": "Task has been successfully scheduled.  Any previously scheduled tasks for the same task type have been canceled.",
    "data": {
        "taskID": "1"
    }
}

Request   

POST api/v1/task/wiping

Body Parameters

machineSerial  string  
The serial for the given computer you wish to schedule a task for.

wipeType  string optional  
The settings for the task you wish to schedule.
Default value is NIST 800-88 Clear
Valid values: [ NIST 800-88 Clear ]

Schedule a Spec Capture Task

requires authentication

Schedule a spec capture task for a given computer serial

Example request:

curl -X POST \
    "https://api.keydeploy.net/api/v1/task/specs" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"machineSerial":"ABCDEFG"}'
const url = new URL(
    "https://api.keydeploy.net/api/v1/task/specs"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "machineSerial": "ABCDEFG"
}

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.keydeploy.net/api/v1/task/specs',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'machineSerial' => 'ABCDEFG',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.keydeploy.net/api/v1/task/specs'
payload = {
    "machineSerial": "ABCDEFG"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200, Success):

{
    "message": "Task has been successfully scheduled.  Any previously scheduled tasks for the same task type have been canceled.",
    "data": {
        "taskID": "1"
    }
}

Request   

POST api/v1/task/specs

Body Parameters

machineSerial  string  
The serial for the given computer you wish to schedule a task for.

Schedule a Imaging Task

requires authentication

Schedule a imaging task for a given computer serial

Example request:

curl -X POST \
    "https://api.keydeploy.net/api/v1/task/imaging" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"machineSerial":"ABCDEFG","imageName":"Windows 10 Home 64-bit","useDPK":true}'
const url = new URL(
    "https://api.keydeploy.net/api/v1/task/imaging"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "machineSerial": "ABCDEFG",
    "imageName": "Windows 10 Home 64-bit",
    "useDPK": true
}

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.keydeploy.net/api/v1/task/imaging',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'machineSerial' => 'ABCDEFG',
            'imageName' => 'Windows 10 Home 64-bit',
            'useDPK' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.keydeploy.net/api/v1/task/imaging'
payload = {
    "machineSerial": "ABCDEFG",
    "imageName": "Windows 10 Home 64-bit",
    "useDPK": true
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200, Success):

{
    "message": "Task has been successfully scheduled.  Any previously scheduled tasks for the same task type have been canceled.",
    "data": {
        "taskID": "1"
    }
}

Request   

POST api/v1/task/imaging

Body Parameters

machineSerial  string  
The serial for the given computer you wish to schedule a task for.

imageName  string  
The name of the captured image you wish to install.
**The specified image name must match one of your captured image names

useDPK  boolean optional  
Specify whether to use a Digital Product Key during imaging.
Default value is TRUE.

Schedule a Diag Task

requires authentication

Schedule a diagnostics task for a given computer serial

Example request:

curl -X POST \
    "https://api.keydeploy.net/api/v1/task/diag" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"machineSerial":"ABCDEFG","testType":"Memory"}'
const url = new URL(
    "https://api.keydeploy.net/api/v1/task/diag"
);

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "machineSerial": "ABCDEFG",
    "testType": "Memory"
}

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://api.keydeploy.net/api/v1/task/diag',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'machineSerial' => 'ABCDEFG',
            'testType' => 'Memory',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.keydeploy.net/api/v1/task/diag'
payload = {
    "machineSerial": "ABCDEFG",
    "testType": "Memory"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200, Success):

{
    "message": "Task has been successfully scheduled.  Any previously scheduled tasks for the same task type have been canceled.",
    "data": {
        "taskID": "1"
    }
}

Request   

POST api/v1/task/diag

Body Parameters

machineSerial  string  
The serial for the given computer you wish to schedule a task for.

testType  string  
Specify which diagnostic tests to run.
Default value is Full.
Valid values: [ Full , Memory , Hard-Drive ]

Storage Drive

Get information related to storage drives / hard drives

Get Wiping History

requires authentication

Get the storage drive wiping history events for a given computer serial or hard drive serial.
Limit of 1000 records
**The query parameters startDate or endDate are mutually required, if one is present the other must also be.

Example request:

curl -X GET \
    -G "https://api.keydeploy.net/api/v1/storageDrive/wiping?machineSerial=ABCDEFG&storageDriveSerial=0123456789&startDate=2020-01-01+00%3A00%3A00&endDate=2020-01-01+23%3A59%3A59" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://api.keydeploy.net/api/v1/storageDrive/wiping"
);

let params = {
    "machineSerial": "ABCDEFG",
    "storageDriveSerial": "0123456789",
    "startDate": "2020-01-01 00:00:00",
    "endDate": "2020-01-01 23:59:59",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://api.keydeploy.net/api/v1/storageDrive/wiping',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Accept' => 'application/json',
        ],
        'query' => [
            'machineSerial'=> 'ABCDEFG',
            'storageDriveSerial'=> '0123456789',
            'startDate'=> '2020-01-01 00:00:00',
            'endDate'=> '2020-01-01 23:59:59',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://api.keydeploy.net/api/v1/storageDrive/wiping'
params = {
  'machineSerial': 'ABCDEFG',
  'storageDriveSerial': '0123456789',
  'startDate': '2020-01-01 00:00:00',
  'endDate': '2020-01-01 23:59:59',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200, Success):


{
     "message": "Records pulled successfully"
     "data": {
         "Serial": "0123456789",
         "SKU": "HDD-SATA-500GB",
         "Capacity": "500",
         "MachineSerial": "ABCDEFG",
         "WipeEvents": {
             "NIST 800-88 Clear": [
                 {
                     "ID": "1",
                     "Date": "2020-01-01 00:00:00",
                     "Status": "STARTED"
                 },
                 {
                     "ID": "2",
                     "Date": "2020-01-01 00:01:00",
                     "Status": "COMPLETED"
                 }
             ]
         }
     }
 }

Example response (400, No matching records):

{
    "message": "No records found"
}

Request   

GET api/v1/storageDrive/wiping

Query Parameters

machineSerial  string optional  
The serial for the given computer you wish to search for.

storageDriveSerial  string optional  
The serial for the given storage drive / hard drive you wish to search for.

startDate  string optional  
The start date for an event date range you wish to search for.

endDate  string optional  
The end date for an event date range you wish to search for.