Automate Single Tasks using the Appdome REST API

This Knowledge Base article outlines how you can use the Appdome REST API to automate building your mobile app, in order to automate deployment and continuous integration and continuous delivery (CI/CD) workflows.

We hope you find this knowledge base useful and enjoy using Appdome!

Appdome-DEV REST API

Appdome-DEV also offers a step by step access to the steps of building an app on Appdome, from Upload to Building, Adding Context and Signing the app.

This article details the technical specifications of these API requests.

Prerequisites for Using the Appdome-DEV REST API

In order to use Appdome’s REST API, you’ll need:

How to Build in a Team

You can run any command for any app and Fusion Set in any of your Teams. Just add a URL encoded parameter with your Team API Key (make sure to use a Fusion Set API Key from your Team and not personal account). For example:

https://fusion.appdome.com/api/v1/<SINGLE_TASK_API_COMMAND>?team_id=<TEAM_API_KEY>

The Task requests generally are sequential so each task uses an identifier from a previous task to complete. For instance, the Upload task returns an Application ID, that is then sent to the Build Task.

Uploading Apps using the Appdome-DEV REST API

URLhttps://fusion.appdome.com/api/v1/upload
MethodPOST
Content-Typemultipart/form-data
HeadersAuthorization:
Payloadfile: file multipart content
API DescriptionIt allows you to upload an app to Appdome.
CURL Example
curl -X POST -H "Authorization:dkG90pp9LPsXUC_pPWO0qA" https://fusion.appdome.com/api/v1/upload -F "file=@/path/to/file.apk"

App Team:

curl -X POST -H "Authorization:dkG90pp9LPsXUC_pPWO0qA" "https://fusion.appdome.com/api/v1/upload?team_id=33392-23232-1451-987" -F "file=@/path/to/file.apk"
Response Format
{
    "app": {
        "id": Application ID,
        "account_id": Application Account ID,
        "user_id": Application User ID,
        "creation_time": Unix Time,
        "pack_name": App File Name,
        "pack_size": Size in Bytes,
        "pack_type": apk/ipa/aab,
        "pack_bundle_identifier": App Bundle ID,
        "pack_bundle_version": App Bundle Version,
        "pack_bundle_display_name": App Display Name,
        "pack_bundle_build_number": App Build Number,
        "pack_app_store_description": App Store Description If exist,
        "status": active/error
    } 
}

Building Apps using the Appdome-DEV REST API

After uploading your app and getting the Application ID, you can now build it using an existing Fusion Set.

URLhttps://fusion.appdome.com/api/v1/tasks
MethodPOST
Content-Typemultipart/form-data
HeadersAuthorization:
Payload Format(in form format:)

-F app_id=<Application ID> //(from the Upload task response)
-F fusion_set_id=<Your_Fusion_set_API_Key>
-F action=fuse
-F 'overrides={<overrides, or empty JSON>}' //(see details below)
-F plugin_good_private_certs_content=@<path/to/single/file> //(optional)
API DescriptionIt allows you to fuse a mobile app.
CURL Example
curl -X POST -H "Authorization: dkG90pp9LPsXUC_pPWO0qA" -F app_id=pl5ZsekOBadRbbZHDGMYUw -F fusion_set_id=vpRwZCDTBW2IfmOFpvHpxA -F action=fuse -F 'overrides={"user_agent":true, "user_agent_value":"Mozilla 5.5"}' -H 'content-type: multipart/form-data' https://fusion.appdome.com/api/v1/tasks
Response Format
{ "task_id": ID of the created fuse task }

When you have to renew your API Token to complete builds:

  • curl -X POST -H “Authorization:$TOKEN” https://fusion.appdome.com/api/v1/refreshApiToken

The available overrides for the Build task are:

KeyName in AppdomeValueNotes
user_agentUser Agent CustomizationBooleanMust use with user_agent_value
user_agent_valueUser-Agent HeaderString
plugin_good_probe_urlPre-Authentication URLString of up to 1024 charactersOnly if BlackBerry PreAuth is turned on in Fusion Set
plugin_good_app_versionGD Entitlement VersionString of up to 250 characters
plugin_good_app_idGD Entitlement IDString of up to 128 characters
extended_logsExtended LogsBooleanOnly if enabled for the user.
extended_logs_gesture_via_httpTap to upload logs(iOS)/ Shake to upload logs(Android)BooleanMust use with extended_logs.
extended_logs_gesture_via_external_appTap to email logs(iOS)/ Shake to email logs(Android)BooleanMust use with extended_logs.
anti_pharming_url_listURL ListArray of StringsOnly if URL Whitelisting is turned on in Fusion Set

Adding Context to Apps using the Appdome-DEV REST API

After Building your app, you can add context with the pre-configured settings of your selected Fusion Set in the previous step.

URLhttps://fusion.appdome.com/api/v1/tasks
MethodPOST
Content-Typemultipart/form-data
HeadersAuthorization:
Payload Format(in form format:)

-F parent_task_id=<Task ID> //(from the Upload task response)
-F action=context
-F 'overrides={<overrides, or empty JSON>}' //(see details below)
-F icon_overlay_content=@<path/to/single/file>
-F app_customization_application_icon=@<path/to/single/file>
-F app_customization_application_files=@<path/to/single/file>
API DescriptionIt allows you to add context to a mobile app.
CURL Example
curl -X POST -H "Authorization: dkG90pp9LPsXUC_pPWO0qA" -F parent_task_id=lix-X4WwvH6joI9DqjdlnQ -F action=context -F 'overrides={}' -H 'content-type: multipart/form-data' https://fusion.appdome.com/api/v1/tasks
Response Format
{ "task_id": ID of the created fuse task }

The available overrides for the Context task are:

KeyName in AppdomeValueNotes
icon_overlayAdd FaviconBooleanMust use with icon_overlay_scale, icon_overlay_position, icon_overlay_filename

Must also add Form data icon_overlay_content with an icon file (see above)

icon_overlay_scaleScaleNumber between 20 and 50
icon_overlay_positionFavicon Position‘Top Right’, ‘Top Left’, ‘Bottom Right’, ‘Bottom Left’
customize_url_enablePrivate URLBooleanMust use with customize_url_value, customize_url_key.
customize_url_valuePrivate URL ValueString
should_copy_url_to_clipboardCopy URL to ClipboardBooleanMust use with  customize_url_enable.
customize_url_keyPrivate URL IdentifierString
app_customization_pack_bundle_versionApp VersionString
app_customization_pack_bundle_identifierApp Bundle IDString
app_customization_pack_bundle_display_nameApp Display NameString
app_customization_pack_bundle_build_numberApp Version CodeNumber
app_customization_key_value_listCustom ValuesJSONLifeCycle, Context

Signing Apps using the Appdome-DEV REST API

Using the Appdome REST API, You can sign your app in three ways:

  1. Automatic Signing (Android, iOS) – If you saved your signing credentials in the Fusion Set, you can use this command to sign the app automatically, and receive a signed binary.
  2. Private Singing (Android, iOS) – If you want to seal the app, download a non-signed binary and sign it locally.
  3. Auto-DEV private Signing (Android, iOS) – The app is sealed and wrapped in a signing script, which you can run to automatically sign the app locally (without uploading the certificates to the platform).

The API request for all the signing tasks are identical, only the action needs to be changed.

  • For Automatic Signing use sign
  • For Private Signing use seal
  • For Auto-DEV Private Signing use sign_script
  • NOTE: When signing Android with Private Signing or Auto-DEV Signing, please add the certificate SHA-1 fingerprint as an override: overrides={"signing_sha1_fingerprint":""}

Example:
‘overrides={“signing_sha1_fingerprint”:”6B:D1:79:F9:5F:7B:BE:64:A3:A5:DC:59:B6:62:E8:67:4F:44:0D:54″}’
or
‘overrides={“signing_sha1_fingerprint”:”6BD179F95F7BBE64A3A5DC59B662E8674F440D54″}’

  • NOTE: When signing iOS, always add the Form data -F provisioning_profile=@<path/to/file>
    For multiple provisioning profiles, add the above line for each profile.
URLhttps://fusion.appdome.com/api/v1/tasks
MethodPOST
Content-Typemultipart/form-data
HeadersAuthorization:
Payload Format(in form format:)

-F parent_task_id=<Task ID> //(from the Upload task response)
-F action=sign //OR
-F action=seal //OR
-F action=sign_script

//For Android:

-F signing_keystore=@<path to file>
-F overrides={"signing_keystore_password": "<password>","signing_keystore_alias": "<alias>", "signing_keystore_key_password": "<password>" }//(see more details below)

//For iOS

-F signing_p12_content=@<path to file>
-F overrides={"signing_p12_password": "<password>"}
-F provisioning_profile=@<path/to/file> 
-F provisioning_profile=@<path/to/additional file> // (optional)  
API DescriptionAllows you to sign a mobile app.
CURL Example Sign
curl -X POST -H "Authorization: dkG90pp9LPsXUC_pPWO0qA" -F parent_task_id=lix-X4WwvH6joI9DqjdlnQ -F action=sign -F signing_keystore=@<path to file> overrides={"signing_keystore_password": "<password>","signing_keystore_alias": "<alias>", "signing_keystore_key_password": "<password>" } -F -H 'content-type: multipart/form-data' https://fusion.appdome.com/api/v1/tasks  
CURL Example

Private Sign

curl -X POST -H "Authorization: dkG90pp9LPsXUC_pPWO0qA" -F parent_task_id=lix-X4WwvH6joI9DqjdlnQ -F action=seal -F 'overrides={"signing_sha1_fingerprint":"6B:D1:79:F9:5F:7B:BE:64:A3:A5:DC:59:B6:62:E8:67:4F:44:0D:54"}' -H 'content-type: multipart/form-data' https://fusion.appdome.com/api/v1/tasks 
Response Format{ "task_id": ID of the created fuse task }

Available overrides for the Signing Task:

KeyName in AppdomeValueNotes
signing_keystore_use_google_signingUse Google Play App SigningBooleanMust use with signing_keystore_google_signing_sha1_key
signing_keystore_google_signing_sha1_keyApp Signing Certificate SHA-1 or SHA-256String

Getting the Status of a Task

You can send a GET request to check the status of a task (of the same user). The Task ID is sent in the URL:

URLhttps://fusion.appdome.com/api/v1/tasks/<task_id>/status
MethodGET
HeadersAuthorization:
API DescriptionAllows you to get the status of a task by ID
CURL Example
curl -X GET -H "Authorization: dkG90pp9LPsXUC_pPWO0qA"  https://fusion.appdome.com/api/v1/tasks/lix-X4WwvH6joI9DqjdlnQ/status
Response Format
{ "status": Current Task Status}

Download and Deploy Apps using the Appdome-DEV REST API

Once your app is signed or sealed, you can download your enterprise-ready app using the Download GET request. The Task ID is sent in the URL:

URLhttps://fusion.appdome.com/api/v1/tasks/<task_id>/output
MethodGET
HeadersAuthorization:
API DescriptionAllows you to get the download an Appdome-built app.
CURL Example
OUTPUT_PATH=`echo ` && curl -X GET -H "Authorization: dkG90pp9LPsXUC_pPWO0qA" https://fusion.appdome.com/api/v1/tasks/lix-X4WwvH6joI9DqjdlnQ/output --output $OUTPUT_PATH
Response FormatBinary file

If you used Automatic Singing, you can also automatically deploy the app using the API. First, make sure you configure the automatic deployment parameters in the Deploy page on the Platform.

To send a deployment request for any type of deployment, other the Apple’s Appstore, use this API request:

URLhttps://fusion.appdome.com/api/v1/tasks
MethodPOST
Content-Typeapplication/json
HeadersAuthorization:
Payload Format{
"parent_task_id": Fusion Task ID,
"action": "deploy"
}
API DescriptionAllows you to deploy an Appdome-build (Automatically signed) mobile app
CURL Example
curl -X POST -H "Authorization: dkG90pp9LPsXUC_pPWO0qA" -d '{"parent_task_id": "lix-X4WwvH6joI9DqjdlnQ", "action": "deploy"}' -H 'content-type: application/json' https://fusion.appdome.com/api/v1/tasks 
Response Format

The JSON response from the relevant store

To deploy your app to Apple’s Appstore, due to Apple’s requirements, you can download a script that will perform this from your Mac, using this API. The Task ID is sent in the URL:

URLhttps://fusion.appdome.com/api/v1/tasks/<task_id>/deploy_script
MethodGET
Content-Typeapplication/json
HeadersAuthorization:
API DescriptionIt allows you to download a script for deploying apps to the Appstore.
CURL Example
curl -X GET -H "Authorization: dkG90pp9LPsXUC_pPWO0qA" -H 'content-type: application/json' https://fusion.appdome.com/api/v1/tasks/lix-X4WwvH6joI9DqjdlnQ/deploy_script 
Response Format A bash script for deploying an app to the App Store.

How Do I Learn More

Check out Appdome Platform, or learn more about Appdome-DEV REST API and Appdome-DEV.

You can also use our API requests Postman Collection.

If you have any questions, please send them our way at support@appdome.com or via the chat window on the Appdome platform.

Thank you!

Thanks for visiting Appdome! Our mission is to make mobile integration easy. We hope we’re living up to the mission with your project. If you don’t already have an account, you can sign up for free.

Avita Flit

Have a question?

Ask an expert

AvitaMaking your security project a success!