APIs for signing iOS Agents

This topic describes how to use API calls to automatically sign the Agent apps with more than one Apple Account. You can then use different iOS accounts for different devices. This topic is relevant only for UFT Digital Lab.

Note: These APIs may change in future versions of Digital Lab and break backward compatibility.

Overview

Using the API, you create an asset set by uploading your provisioning profile and iOS certificate. After the set is created, the Agent apps are automatically re-signed with the files that you uploaded, and the asset set is distributed to all connected connectors. The asset set contains the newly signed Agent apps and a list of the UDIDs. After a new or updated asset set is distributed to connectors, any devices that are not connected to the UFT Digital Lab server try connecting again with the newly distributed Agents.

Prerequisites

Make sure that you have set up automatic app packaging and signing services for iOS. For details, see Automatic signing services

Back to top

Log in

The first REST API request in a session must be a log in request. For details, see Login in the REST API documentation.

Use the x-hp4msecret and cookie from the login response header for the subsequent API requests.

Back to top

Create asset set

This creates an asset set on the Digital Lab server. An asset set consists of the signed Agent apps, and a list of devices on which the apps can be installed (taken from the provisioning profile used to sign the Agents). To update an existing asset set, call Update an asset set.

Method: POST /rest/v2/assets

Request Body: Multipart

  • file application/octet-stream zip file containing your iOS Developer certificate and matching provisioning profile. The teamID of the certificate and provisioning profile must be the same.
  • assetDetails application/json {"name":"name","password":"123456"}.
    KeyDetails
    nameProvide a name for the asset
    passwordThe password for your iOS Developer certificate

Response

Status Details
200 Success
400 Bad request. Name already exists, invalid certificate or provisioning profile
500 Server error

Body (Example):

{

"name":"name",

"teamId":"xxx",

"certificateExpirationDate":"xxxx",

"udid":[

"udid1",

"udid2"

],

“signingId”:”dddd-ddd”

}

The uploaded files are used to sign the Agents apps, and the asset set is distributed to connected connectors, using automatic API calls. The signing ID can be used to identify the status of the signing and distribution of the apps to connectors.

Back to top

Update an asset set

Change the certificate and provisioning profile for an asset set. When you change an asset set, the Agents are re-signed with the new assets, and distributed to all connectors connected to the Digital Lab server.

Method: PUT /rest/v2/assets

Request Body: Multipart

  • file application/octet-stream zip file containing your iOS Developer certificate and matching provisioning profile. The teamID of the certificate and provisioning profile must be the same.
  • assetDetails application/json {"name":"name","password":"123456"}.
    KeyDetails
    nameProvide a name for the asset
    passwordThe password for your iOS Developer certificate

Response:

Status Details
200 Success
400 Bad request. Cannot find the asset by name, invalid certificate or provisioning profile
500 Server error

Body (Example):

{

"name":"name",

"teamId":"xxx",

"certificateExpirationDate":"xxxx",

"udid":[

"udid1",

"udid2"

],

“signingId”:”dddd-ddd”

}

Back to top

Delete an asset set

Delete an asset set if you no longer require it. The asset set is removed from the Digital Lab server, as well as from connectors. Connected devices, that are using the Agents in the deleted asset set, are not disconnected.

Method: DELETE /rest/v2/assets/{name}

Request Body: No body

Response:

Status Details
200 Success
400 The asset does not exist
500 Server error

Body: No response body.

Back to top

Get details of all asset sets

Retrieve the name, teamID, certificate expiry date, and the list of device UDIDs for all asset sets.

Method: GET /rest/v2/assets

Request Body: No body.

Response:

Status Details
200 Success
500 Server error

Body (Example):

[

{

"name":"name",

"teamId":"xxx",

"ExpirationDate":"xxxx",

"udids":[

"udid1",

"udid2"

]

}

{

"name":"name2",

"teamId":"xyz",

"ExpirationDate":"xxxx",

"udids":[

"udid3",

"udid4"

]

}

Back to top

Get UDIDs from all asset sets

Retrieve the list of all unique device IDs (UDIDs) from all asset sets.

Method: GET /rest/v2/assets/udid

Request Body: No body.

Response:

Status Details
200 Success
500 Server error

Body (Example):

["udid1","udid2","udid3","udid4"]

Back to top

Get signing and distribution status

Get the status of an asset set by its signingId. The signingId is in the response body when creating or updating an asset set. There are four states: Idle, signing, distributed, ended.

Method: GET /rest/signing/{signingId}/status/

Request Body: No body.

Response:

Status Details
200 Success
500 Server error

Body (Example):

{"messageCode":0,

"message":"0",

"signingId":"xxxx",

"state":"DISTRIBUTING"}

Back to top

Distribute signed assets to a specific connector

This API does not need to be called manually. After you create or update an asset set, the Agents in that asset set are automatically signed, and the asset set is distributed to all connected connectors.

Method: PUT rest/v2/connectors/{connectorId}/signedAssets

Request Body: No body

Response:

Status Details
200 Success
500 Server error

Body: No response body.

Back to top

Distribute newly signed Agents

Distribute asset sets to all connectors when re-signing the Agent apps, either after creating a new asset set, or updating an existing one. This API does not need to be called manually. After you create or update an asset set, the Agents in that asset set are automatically signed, and the asset set is distributed to all connected connectors.

Method: PUT rest/v2/connectors/signedAssets

Request Body: No body

Response:

Status Details
200 Success
500 Server error

Body: No response body.

Back to top