Skip to main content
Skip table of contents

app-market/upload-no-replace

Upload an app with confirmation.

POST

Upload an app (an APK or IPA file) to the policy console.

Use this resource to upload an app and—if you upload an APK or IPA file with the same package name already in the policy console—expect a confirmation response from the server.

The confirmation_needed return field is set to false if the upload completed (that is, there was no existing app with the same package name). It is set to true if confirmation is needed to complete the upload.

If you receive a confirmation response, it returns the commit_url field of the syntax for app-market/upload-commit/{packageName}/{platform}/{blobId}; use POST with the commit_url to reply to the response.

Parameters

Parameter
Description
FileRequired. The binary data for the APK or IPA file you want to upload. The APK or IPA must be sent as raw multipart data, not as a URL.

In cURL, for example, use the --data-binary option to send the APK or IPA file:

curl --data-binary @file_name -L -b c.txt -c c.txt \
-X POST POST https://servername/mocana-app-control/rest/app-market/upload-no-replace

where file_name is the path and filename for your APK or IPA file and servername is your policy console server.

filename

Optional. The name to give the APK or IPA file. When you download the secured app from the policy console with GET app-market/{GUID}/apk, or POST app-market/export-for-codesigning, this is the default filename. Unlike most other POST parameters, filename must be appended to the URL in your request.

Example value: com.qwe.superapp.apk

Example request

Request

CODE
curl -v -L -b c.txt -c c.txt -X \
 POST https://bc.qwe.com/mocana-app-control/rest/app-market/upload-no-replace \
 --data-binary @com.adobe.reader.apk

If there’s no app with the same package_name already in the policy console, the response is similar to POST app-market/upload.

If an app with the same package_name has already been uploaded to the policy console, the response looks like this:

Response

CODE
{
  "message": "",
  "status": "OK",
  "upload_info": {
    "app_current": {
      "activity_event_type": 5,
      "apk_url": "https://bc.qwe.com:8443/mocana-app-control/rest/app-market/b373ddb8-22e2-4f92-b110-c24c96da2ad0/apk",
      "app_id": "b373ddb8-22e2-4f92-b110-c24c96da2ad0",
      "app_policies": [{
        "info_url": "https://bc.qwe.com:8443/mocana-app-control/rest/app-policy/6accf784-2247-4753-94fa-3cae49572851",
        "policy_code": "POLICY_CODE_APP_CUSTOMIZATION",
        "policy_data": "{\"app_customization_profile_id\":\"ed792cef-4f55-48d4-9c42-0086e86808a8\"}",
        "policy_icon_url": "https://bc.qwe.com:8443/mocana-app-control/rest/files/33be62e1-25d1-41e3-8169-618395cc4b0c",
        "policy_id": "6accf784-2247-4753-94fa-3cae49572851",
        "policy_name": "App Customization",
        "policy_status": "active"
      }],
      "can_wrap_map_legacy": true,
      "can_wrap_map_next": true,
      "icon_url": "https://bc.qwe.com:8443/mocana-app-control/rest/app-market/b373ddb8-22e2-4f92-b110-c24c96da2ad0/icon",
      "info_url": "https://bc.qwe.com:8443/mocana-app-control/rest/app-market/b373ddb8-22e2-4f92-b110-c24c96da2ad0",
      "is_compass_app": false,
      "is_mocana_app": false,
      "last_modified_at": "2017-07-10 11:30:15.0",
      "last_modified_by": "email01@qwe.com - 127.0.0.1",
      "name": "Adobe Reader",
      "package_name": "com.adobe.reader",
      "package_size": "2087292",
      "platform": "PLATFORM_ANDROID",
      "upload_info": {
        "uploaded_app_size": 2087292,
        "uploaded_as": "com.adobe.reader.apk",
        "uploaded_at": "2017-07-10 11:30:15.0",
        "uploaded_by": "email01@qwe.com - 127.0.0.1"
      },
      "version_code": "40862",
      "version_name": "10.0.2"
    },
    "app_new": {
      "commit_blob_id": "3914e1f6-7599-4e82-a2d7-03c0d91c0852",
      "commit_url": "https://bc.qwe.com:8443/mocana-app-control/rest/app-market/upload-commit/com.adobe.reader/PLATFORM_ANDROID/3914e1f6-7599-4e82-a2d7-03c0d91c0852",
      "identical_installer": true,
      "name": "Adobe Reader",
      "package_name": "com.adobe.reader",
      "version_code": "40862",
      "version_name": "10.0.2"
    },
    "confirmation_needed": true
  }
}

Use POST app-market/upload-commit/{packageName}/{platform}/{blobId} with the commit_url value to reply to the response.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.