Skip to main content
Exporting AEMP via our API

Instructions on how to export AEMP service data through our Application Programming Interface.

Breanne Cassidy avatar
Written by Breanne Cassidy
Updated over a week ago

The following code will export AEMP (Association of Equipment Management Professionals) data through our API. The code uses basic HTTP authentication and will return an XML document that follows AEMP 1.2 specification. 

This is intended for a technical audience—ask your developer for assistance.

Sample Code

import urllib.request

import base64

from urllib.error import HTTPError

# Credentials from a machinelink account

username = ''

password = ''

url = 'https://aemp.machinelink.com/fleet'

req = urllib.request.Request(url)

credentials = '{}:{}'.format(username, password)

encoded_credentials = base64.b64encode(credentials.encode())

req.add_header('Authorization', 'Basic {}'.format(encoded_credentials.decode()))

try:

   response = urllib.request.urlopen(req)

   print(response.read().decode())

except HTTPError as e:

   print(e.read())


Sample Response

<?xml version="1.0" encoding="utf-8"?>                                                                                                                                                                                                                                          

<Fleet version="1" snapshotTime="2019-01-28T19:32:17.990514+00:00" xmlns="http://schemas.aemp.org/fleet">

    <Equipment>

        <EquipmentHeader>

            <Make>CATERPILLAR</Make>

            <Model>foo</Model>

            <EquipmentID>bar</EquipmentID>

            <SerialNumber>bat</SerialNumber>

        </EquipmentHeader>

        <Location datetime="2018-01-18T14:40:14.320003+00:00">

            <Latitude>31.6388</Latitude>

            <Longitude>-60.9277</Longitude>

        </Location>

        <CumulativeOperatingHours datetime="2018-01-18T14:40:14.320003+00:00">

            <Hour>PT2H</Hour>

        </CumulativeOperatingHours>

    </Equipment>

    <Equipment>

        <EquipmentHeader>

            <Make>ZEPPELIN</Make>

            <Model>Maxtor 1000</Model>

            <EquipmentID>4</EquipmentID>

            <SerialNumber>100</SerialNumber>

        </EquipmentHeader>

        <Location datetime="2017-06-23T20:38:58+00:00">

            <Latitude>47.6866</Latitude>

            <Longitude>-87.3371</Longitude>

        </Location>

        <CumulativeOperatingHours datetime="2017-06-23T20:38:58+00:00">

            <Hour>PT5H11M24S</Hour>

        </CumulativeOperatingHours>

    </Equipment>

    <Equipment>

        <EquipmentHeader>

            <Make>FORD</Make>

            <Model>F-350</Model>

            <EquipmentID>Super Duty</EquipmentID>

            <SerialNumber>11111111111111111</SerialNumber>

        </EquipmentHeader>

        <Location datetime="2018-01-18T14:39:56.080055+00:00">

            <Latitude>-77.6739</Latitude>

            <Longitude>48.9479</Longitude>

        </Location>

        <Distance datetime="2018-01-18T14:39:56.080055+00:00">

            <OdometerUnits>mile</OdometerUnits>

            <Odometer>0.00</Odometer>

        </Distance>

    </Equipment>

</Fleet>
Did this answer your question?