VMware Workspace ONE Community
flyjazz
Contributor
Contributor

Airwatch REST API - retrieve RegistrationDate

Hi ,

I used https://as239.awmdm.com/API/mdm/devices/search? Page={page} to retrieve all devices information (in batches), but it does not include the RegistrationDate.

How I could I retrieve the RegistratioDate  for all devices.

Thank you

Reply
0 Kudos
8 Replies
callmegibby
Enthusiast
Enthusiast

Groups and Settings > Reports > List View > Device Inventory. This will tell you the RegistrationDate. 

Reply
0 Kudos
flyjazz
Contributor
Contributor

Thank you , but this is not what I am looking for. I am looking for the REST API call to retrieve Registration Date.

I found :

API URI – https://host/api/system/users/enrolleddevices/search?organizationgroupid=
{organizationgroupid}&organizationgroup={organizationgroup}&platform={platform}&customattributes=
{customattributes}&serialnumber={serialnumber}&seensince={seensince}&seentill={seentill}&enrolledsince=
{enrolledsince}&enrolledtill={enrolledtill}

 https://host/api/system/users/enrolleddevices/search

 

Allt the data comes fine except RegistrationDate that comes as 01/01/0001 00:00:00

Reply
0 Kudos
Phil_Helmling
VMware Employee
VMware Employee

By Registration do you mean enrolment? The enrolment date is included in that search in the {enrolledsince} attribute

Reply
0 Kudos
flyjazz
Contributor
Contributor

No RegistrationDate is not EnrollmentDate. They are 2 different fields. RegistrationDate is when Apple registers the device in DEP and Enrollment Date is when the users enroll the device with Airwatch.

This is the API CI call I use to retrieve both dates for a report in Power BI. The RegistrationDate however comes as 0001/01/01 

Search Enrolled Device
Functionality – Retrieves enrolled device details for the query information provided in the request.
HTTP Method – GET
API URI – https://host/api/system/users/enrolleddevices/search?organizationgroupid=
{organizationgroupid}&organizationgroup={organizationgroup}&platform={platform}&customattributes=
{customattributes}&serialnumber={serialnumber}&seensince={seensince}&seentill={seentill}&enrolledsince=
{enrolledsince}&enrolledtill={enrolledtill}
l Exact Match Parameter – platform
l Pattern (Contains) Match Parameter – organizationgroupid, organizationgroup, customattributes, serialnumber,
seensince, seentill, enrolledsince, enrolledtill
Request – N/A

 

<EnrolledDevices xmlns="http://www.air-watch.com/servicemodel/resources">
<EnrolledDeviceInfoList>
<EnrolledDeviceDetails>
<DeviceID>Numeric</DeviceID>
<SerialNumber>String</SerialNumber>
<AssetNumber>String</AssetNumber>
<FriendlyName>String</FriendlyName>
<UserName>String</UserName>
<EnrolledDate>Datetime</EnrolledDate>
<RegistrationDate>Datetime</RegistrationDate>
<LastSeen>Datetime</LastSeen>
<Platform>String</Platform>
<OrganizationGroup>String</OrganizationGroup>
<CustomAttributes>
<CustomAttribute>
<Name>String</Name>
<Application>String</Application>
<Value>String</Value>
</CustomAttribute>
<CustomAttribute>
<Name>String</Name>
<Application>String</Application>
<Value>String</Value>
</CustomAttribute>
</CustomAttributes>
</EnrolledDeviceDetails>
</EnrolledDeviceInfoList>
</EnrolledDevices>

Reply
0 Kudos
fireflux
Contributor
Contributor

Did you find a solution to get the Registration Date? I have a requirement to pull the registration date to CMDB CIs. Everything else I need can be fetched from https://<id>.awmdm.com/API/mdm/devices/search, I just can't find the endpoint address to get registration date.


Reply
0 Kudos
TimHardy
Enthusiast
Enthusiast

Checked on two different environments and both have the same issue you describe, Registration date returned via the enrolleddevicces call is 0001/01/01 for all records.

I know this doesn't really help you but at least you know its a general issue and not specific to your environment. 

Reply
0 Kudos
Phil_Helmling
VMware Employee
VMware Employee

I have asked the PM for APIs to have a look and add it to the list.

Reply
0 Kudos
Phil_Helmling
VMware Employee
VMware Employee

There looks to be two APIs you can use:

  1. https://host/api/system/users/enrolleddevices/search
    which returns
    {
    "EnrolledDeviceInfoList": [
    {
    "DeviceID": 1,
    "SerialNumber": "RZ1G124JZ6W",
    "AssetNumber": "ea856771ba6277bfca16528a79c5ce1f",
    "FriendlyName": "TestUser's iPhone",
    "UserName": "TestUser",
    "EnrolledDate": "04/24/2017",
    "RegistrationDate": "04/24/2017",
    "LastSeen": "04/24/2017",
    "Platform": "Apple",
    "OrganizationGroup": "TestOg",
    "CustomAttributes": [
    {
    "Name": "identity.deviceModel",
    "Value": "TC25",
    "Source": "Device",
    "Application": "com.airwatch.androidagent.identity.xml"
    }
    ]
    }
    ]
    }

  2.  https://host/api/system/users/registereddevices/search
{
"RegisteredDeviceInfoList": [
{
"OrganizationGroup": "TestOg",
"Username": "TestUser",
"FriendlyName": "Testuser's iPhone",
"AssetNumber": "ea856771ba6277bfca16528a79c5ce1f",
"UDID": "9bf5ae7cf74efe385bbe3b18261fd21c",
"RegistrationDate": "04/24/2017",
"SerialNumber": "RZ1G124JZ6W",
"Platform": "Apple",
"CustomAttributes": [
{
"Name": "identity.deviceModel",
"Value": "TC25",
"Source": "Device",
"Application": "com.airwatch.androidagent.identity.xml"
}
]
}
]
}


if neither of these return the correct details, please confirm that the device was registered by DEP into UEM. I think you can see the devices listed in the Devices > Lifecycle > Enrollment Status page. If they are showing then please log a support ticket so that we can get this escalated and assigned to the correct engineer.

Reply
0 Kudos