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.

Note: These APIs may change in future versions of UFT Mobile 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 four 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 UFTM server will 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 Set up automatic app packaging and 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.

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 UFTM server. An asset set consists of the four 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"}.
    nameProvide a name for the asset
    passwordThe password for your iOS Developer certificate

Response

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 will be used to sign the Agents apps, and the asset set will be distributed to connected connectors, via 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 four Agents are re-signed with the new assets, and disributed to all connectors connected to the UFT Mobile 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"}.
    nameProvide a name for the asset
    passwordThe password for your iOS Developer certificate

Response:

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 will be removed from the UFT Mobile server, as well as from connectors. Connected devices, that are using the Agents in the deleted asset set, will not be disconnected.

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

Request Body: No body

Response:

200 Success
400 The asset does not exist
500 Server error

Body: No reponse 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:

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:

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:

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 will automatically be signed, and the asset set will be distributed to all connected connectors.

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

Request Body: No body

Response:

200 Success
500 Server error

Body: No reponse 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 will automatically be signed, and the asset set will be distributed to all connected connectors.

Method: PUT rest/v2/connectors/signedAssets

Request Body: No body

Response:

200 Success
500 Server error

Body: No reponse body.

Back to top