Integrate Build Servers with Workspace ONE UEM APIs

Integrate your build server with Workspace ONE UEM to automatically deliver new builds of internal applications to the Workspace ONE UEM (AirWatch) Admin Console.

Current Workspace ONE UEM Plugins

Workspace ONE UEM has a plugin for Jenkins build servers. However, if you use another build system, you can use Workspace ONE UEM APIs to configure your build server to deliver updated application versions to Workspace ONE UEM.

Necessary APIs for Integration

Configure the build server to use specific APIs in the listed order. These APIs upload applications, apply organization groups, assign the applications to smart groups, and publish applications to devices. You can also delete applications to clear old builds from the system.

Reference the Workspace ONE UEM REST API Guide for more details, found on the Resources Portal at My.WorkspaceONE.com.

 

1. Upload Blob– Uploads internal application packages as a single byte stream. The response for this API is a numeric "Blob ID" that you can use in the Internal Application Save API (also called Internal Application Install: Begin Internal Application Install) to save the application to the Workspace ONE UEM Console.

https://host/api/mam/blobs/uploadblob?filename={filename}&organizationgroupid={organizationgroupid}&moduleType=Application

Response Payload

XML

<?xml version="1.0" encoding="UTF-8"?>
<EntityV1Model>
  <Value>1</Value>
  <Id>1</Id>
  <Uuid>string</Uuid>
</EntityV1Model>

 

JSON

{  
   "Value":123,
   "id":1234,
   "uuid":"0d0941b8-1ed4-47e0-8705-4e5953803c83"
}

 

An alternate approach is to upload chunk data of the application.  A chunk of the application will contain the size of the chunk, sequence number, and the byte data. The TransactionId of the chunked data should be passed to the beginInstall API to save the application.

https://host/api/mam/apps/internal/uploadchunk

Request Payload

XML

<InternalAppChunk
xmlns="http://www.air-watch.com/servicemodel/resources">
<TransactionId>String</TransactionId>
    <ChunkData>string</ChunkData>
    <ChunkSequenceNumber>1</ChunkSequenceNumber>
    <TotalApplicationSize>1</TotalApplicationSize>
    <ChunkSize>1</ChunkSize>
</InternalAppChunk>

 

JSON

{  
   "TransactionId":"Text value",
   "ChunkData":"QA==",
   "ChunkSequenceNumber":5,
   "TotalApplicationSize":6,
   "ChunkSize":7
}

 

 

2. Internal Application Install: Begin Internal Application Install (also called Internal Application Save)– Saves the application, which are the blob or chunks of app package that you upload with the UploadBlob API. It can specify the supported model's deployment mode of the application. After the application saves, add assignments to the application using '/internal/{applicationid}/assignments' to begin the installation.

If you are trying to deploy different builds of the same version of the application, the begininstall API takes an additional input field AppVersion

https://host/api/mam/apps/internal/begininstall 

Request Payload

XML

<?xml version="1.0"?>
<InternalAppChunkTranscation
xmlns="http://www.air-watch.com/servicemodel/resources">
<TransactionId>string</TransactionId>
<BlobId>string</BlobId>
<DeviceType>string</DeviceType>
<ApplicationName>string</ApplicationName>
<SupportedModels>
<Model>
<Model>
<ApplicationId>1</ApplicationId>
<ModelId>1</ModelId>
<ModelName>string</ModelName>
</Model>
        </Model>
</SupportedModels>
<PushMode>string</PushMode>
    <Description>string</Description>
    <SupportEmail>string</SupportEmail>
    <SupportPhone>string</SupportPhone>
    <Developer>string</Developer>
    <DeveloperEmail>string</DeveloperEmail>
    <DeveloperPhone>string</DeveloperPhone>
    <AutoUpdateVersion>true</AutoUpdateVersion>
    <LocationGroupId>1</LocationGroupId>
    <EnableProvisioning>true</EnableProvisioning>
    <UploadViaLink>true</UploadViaLink>
    <BundleId>string</BundleId>
    <ActualFileVersion>string</ActualFileVersion>
    <AppVersion>string</AppVersion>
    <FileName>string</FileName>   
<SupportedProcessorArchitecture>string</SupportedProcessorArchitecture>
</InternalAppChunkTranscation>

 

JSON

{  
   "TransactionId":"string",
   "BlobId":"string",
   "DeviceType":"string",
   "ApplicationName":"string",
   "SupportedModels":{  
      "Model":[  
         {  
            "ApplicationId":0,
            "ModelId":0,
            "ModelName":"string"
         }
      ]
   },
   "PushMode":"string",
   "Description":"string",
   "SupportEmail":"string",
   "SupportPhone":"string",
   "Developer":"string",
   "DeveloperEmail":"string",
   "DeveloperPhone":"string",
   "AutoUpdateVersion":true,
   "LocationGroupId":0,
   "EnableProvisioning":true,
   "UploadViaLink":true,
   "BundleId":"string",
   "ActualFileVersion":"string",
   "AppVersion":"string",
   "FileName":"string",
   "SupportedProcessorArchitecture":"string"
}

 

 

3. Search Organization Group– Searches for organization group details with the parameters provided in the URL.

http://host/api/system/groups/search?name={name}&type={type}&groupid={groupid}&orderby={orderby}&page={page}&pagesize={pagesize}&sortorder={sortorder}

Response Payload

XML

<OrganizationGroupPagedSearchResult
    xmlns="http://www.air-watch.com/webapi/resources">
    <OrganizationGroups>
        <LocationGroupModel>
            <Id>1</Id>
            <Uuid>string</Uuid>
            <Name>string</Name>
            <GroupId>string</GroupId>
            <LocationGroupType>string</LocationGroupType>
            <Country>string</Country>
            <Locale>string</Locale>
            <AddDefaultLocation>string</AddDefaultLocation>
            <CreatedOn>string</CreatedOn>
            <LgLevel>1</LgLevel>
            <Users>string</Users>
            <Admins>string</Admins>
            <Devices>string</Devices>
            <ConcurrencyId>string</ConcurrencyId>
        </LocationGroupModel>
    </OrganizationGroups>
    <AdditionalInfo>
        <Links>
            <Links
                xmlns="http://www.air-watch.com/webapi/resources">
                <Rel>string</Rel>
                <Href>string</Href>
                <Title>string</Title>
            </Links>
        </Links>
        <Id>1</Id>
        <Uuid>string</Uuid>
    </AdditionalInfo>
    <TotalResults>1</TotalResults>
</OrganizationGroupPagedSearchResult>

 

JSON

{  
   "OrganizationGroups":[  
      {  
         "Id":1,
         "Uuid":"8a609fbe-e68a-4bd8-893d-a10df33c83bb",
         "Name":"Text value",
         "GroupId":"Text value",
         "LocationGroupType":"Text value",
         "Country":"Text value",
         "Locale":"Text value",
         "AddDefaultLocation":"Text value",
         "CreatedOn":"Text value",
         "LgLevel":8,
         "Users":"Text value",
         "Admins":"Text value",
         "Devices":"Text value",
         "ConcurrencyId":"Text value"
      }
   ],
   "AdditionalInfo":{  
      "Links":[  

      ],
      "id":1234,
      "uuid":"10595346-6eb3-4eb0-921b-a38826f90b93"
   },
   "TotalResults":1

 

 

4. Search Smart Groups– Searches for smart groups using given query information. Workspace ONE UEM assigns applications to devices that are grouped into smart groups.

 https://host/api/mdm/smartgroups/search?name={name}&organizationgroupid={organizationgroupid}&managedbyorganizationgroupid={managedbyorganizationgroupid}&modifiedfrom={modifiedfrom}&modifiedtill={modifiedtill}&page={page}&pagesize={pagesize}&orderby={orderby}&sortorder={sortorder}

Response Payload

XML

<SmartGroupSearchResult
    xmlns="http://www.air-watch.com/servicemodel/resources">
    <SmartGroups
        xmlns="http://www.air-watch.com/servicemodel/resources">
        <Name>string</Name>
        <SmartGroupID>1</SmartGroupID>
        <SmartGroupUuid>string</SmartGroupUuid>
        <CriteriaType>string</CriteriaType>
        <ManagedByOrganizationGroupId>string</ManagedByOrganizationGroupId>
        <ManagedByOrganizationGroupUuid>string</ManagedByOrganizationGroupUuid>
        <ManagedByOrganizationGroupName>string</ManagedByOrganizationGroupName>
        <Devices>1</Devices>
        <Assignments>1</Assignments>
        <Exclusions>1</Exclusions>
        <OrganizationGroups>
            <OrganizationGroups>
                <Name>string</Name>
                <Id>string</Id>
                <Uuid>string</Uuid>
            </OrganizationGroups>
        </OrganizationGroups>
        <UserGroups>
            <UserGroups>
                <Name>string</Name>
                <Id>string</Id>
            </UserGroups>
        </UserGroups>
        <Tags>
            <Tags>
                <Id>string</Id>
                <Name>string</Name>
            </Tags>
        </Tags>
        <Ownerships>
            <Ownerships>string</Ownerships>
        </Ownerships>
        <Platforms>
            <Platforms>string</Platforms>
        </Platforms>
        <Models>
            <Models>string</Models>
        </Models>
        <OperatingSystems>
            <OperatingSystems>
                <DeviceType>string</DeviceType>
                <Operator>string</Operator>
                <Value>string</Value>
            </OperatingSystems>
        </OperatingSystems>
        <UserAdditions>
            <UserAdditions>
                <Id>string</Id>
                <Name>string</Name>
            </UserAdditions>
        </UserAdditions>
        <DeviceAdditions>
            <DeviceAdditions>
                <Id>string</Id>
                <Name>string</Name>
                <Model>string</Model>
                <OSVersion>string</OSVersion>
                <Username>string</Username>
                <Platform>string</Platform>
                <Ownership>string</Ownership>
            </DeviceAdditions>
        </DeviceAdditions>
        <UserExclusions>
            <UserExclusions>
                <Id>string</Id>
                <Name>string</Name>
            </UserExclusions>
        </UserExclusions>
        <DeviceExclusions>
            <DeviceExclusions>
                <Id>string</Id>
                <Name>string</Name>
                <Model>string</Model>
                <OSVersion>string</OSVersion>
                <Username>string</Username>
                <Platform>string</Platform>
                <Ownership>string</Ownership>
            </DeviceExclusions>
        </DeviceExclusions>
        <UserGroupExclusions>
            <UserGroupExclusions>
                <Name>string</Name>
                <Id>string</Id>
            </UserGroupExclusions>
        </UserGroupExclusions>
    </SmartGroups>
    <Page>1</Page>
    <PageSize>1</PageSize>
    <Total>1</Total>
</SmartGroupSearchResult>

 

JSON

{  
   "SmartGroups":[  
      {  
         "Name":"All Devices",
         "SmartGroupID":1,
         "SmartGroupUuid":"15529a89-bb69-493d-9cab-90883dc012a2",
         "CriteriaType":"All",
         "ManagedByOrganizationGroupId":"1",
         "ManagedByOrganizationGroupUuid":"e8eb6624-f52c-4e1a-b575-720f53da3947",
         "ManagedByOrganizationGroupName":"Organization Group Name",
         "Devices":4,
         "Assignments":5,
         "Exclusions":6,
         "OrganizationGroups":[  
            {  
               "Name":"Organization Group Name",
               "Id":"576",
               "Uuid":"5F926C4A-DA3D-4490-9478-A8792DBD249A"
            }
         ],
         "UserGroups":[  
            {  
               "Name":"User Group Name",
               "Id":"123"
            }
         ],
         "Tags":[  
            {  
               "Id":"123",
               "Name":"Software"
            }
         ],
         "Ownerships":[  
            "Text value"
         ],
         "Platforms":[  
            "Text value"
         ],
         "Models":[  
            "Text value"
         ],
         "OperatingSystems":[  
            {  
               "DeviceType":"Android",
               "Operator":"GreaterThan",
               "Value":"Android 2.2.1"
            }
         ],
         "UserAdditions":[  
            {  
               "Id":"512",
               "Name":"TestUser"
            }
         ],
         "DeviceAdditions":[  
            {  
               "Id":"123",
               "Name":"test Windows 8.1 Windows Desktop 6.3.9600 KXW1",
               "Model":"Android",
               "OSVersion":"8.0.0",
               "Username":"awuser",
               "Platform":"Android",
               "Ownership":"C"
            }
         ],
         "UserExclusions":[  
            {  

            }
         ],
         "DeviceExclusions":[  
            {  

            }
         ],
         "UserGroupExclusions":[  
            {  

            }
         ]
      }
   ],
   "Page":1,
   "PageSize":2,
   "Total":3
}

 

 

5. Assign Smart Group to an Internal Application– Assigns a smart group to an internal application and triggers install action if the ‘PushMode’ is Auto.

https://host/api/mam/apps/internal/{applicationid}/assignments (HTTP Method Used – POST; Supported methods: POST, PUT)

Request Payload

XML

<?xml version="1.0"?>
<AppAssignments
    xmlns="http://www.air-watch.com/webapi/resources">
    <SmartGroupIds>
        <SmartGroupIds>1</SmartGroupIds>
    </SmartGroupIds>
    <DeploymentParameters>
        <PushMode>string</PushMode>
        <EffectiveDate>1970-01-01T00:00:00.001Z</EffectiveDate>
        <RemoveOnUnEnroll>true</RemoveOnUnEnroll>
        <ApplicationBackup>true</ApplicationBackup>
        <AutoUpdateDevicesWithPreviousVersion>true</AutoUpdateDevicesWithPreviousVersion>
        <AdaptiveManagement>true</AdaptiveManagement>
        <ApplicationTransformIds>
            <ApplicationTransformIds>1</ApplicationTransformIds>
        </ApplicationTransformIds>
        <AllowManagement>true</AllowManagement>
        <MacOsDesiredStateManagement>true</MacOsDesiredStateManagement>
        <RequiresApproval>true</RequiresApproval>
        <Uuid>string</Uuid>
    </DeploymentParameters>
    <Uuid>string</Uuid>
</AppAssignments>

 

JSON

{  
   "SmartGroupIds":[  
      1
   ],
   "DeploymentParameters":{  
      "PushMode":"Auto",
      "EffectiveDate":"2018-08-24T15:13:07.3221219-04:00",
      "RemoveOnUnEnroll":true,
      "ApplicationBackup":true,
      "AutoUpdateDevicesWithPreviousVersion":true,
      "AdaptiveManagement":true,
      "ApplicationTransformIds":[  
         1
      ],
      "AllowManagement":true,
      "MacOsDesiredStateManagement":true,
      "RequiresApproval":true,
      "uuid":"4588fa2e-abe3-45e8-8570-a0a1faee2c9f"
   },
   "uuid":"f45d2824-3533-4c77-b249-07e56a90aa22"
}

No Response Payload

 

6. Retrieve Assigned Devices (Internal Application)– Lists devices that are have assignments for the internal application.

https://host/api/mam/apps/internal/applicationid/devices

Response Payload

XML

<?xml version="1.0"?>
<DeviceList>
  <DeviceId>1</DeviceId>
  <Page>1</Page>
  <PageSize>1</PageSize>
  <Total>1</Total>
</DeviceList>

 

JSON

{  
   "DeviceId":[  
      1
   ],
   "Page":1,
   "PageSize":2,
   "Total":3
}

 

 

7. Install Internal Application on Device– Installs an application on devices. Run this API for every device retrieved in the Retrieve Assigned Devices (Internal Application) API if the application is made available 'on-demand' (devices that have automatic assignment will receive the install trigger immediately after assignment API gets called) .

https://host/api/mam/apps/internal/{applicationid}/install

Response Payload

XML

<DeviceInfo
    xmlns="http://www.air-watch.com/servicemodel/resources">
    <DeviceId>1</DeviceId>
    <Udid>string</Udid>
    <SerialNumber>string</SerialNumber>
    <MacAddress>string</MacAddress>
</DeviceInfo>

 

JSON


{  
   "DeviceId":1,
   "Udid":"6bf0f04c73681fbecfc3eb4f13cbf05b",
   "SerialNumber":"LGH871c18f631a",
   "MacAddress":"0x848506B900BA"
}

 

 

8. Delete Internal Application (Optional)– Deletes an internal application that it identifies with the application ID from the console. Run this API to clean up old builds.

https://host/api/mam/apps/Internal/{Applicationid}

 

Other Languages: 日本語

Have more questions? Submit a request

0 Comments

Article is closed for comments.