Install Package

post

/mobile/tools/1.0/import/package/install

Installs the uploaded package file that's identified by the artifact ID and name in the request body.

Note that when you import (upload) the package, you can copy the artifact object from the upload response body to use in the request body for this operation.

Request

Supported Media Types
Body ()
Root Schema : Request Body for Package Installation
Type: object
Title: Request Body for Package Installation
Artifact information about the package to install.
Match All
Show Source
Nested Schema : artifact
Type: object
The artifact information.
Show Source
Nested Schema : properties
Type: object
Additional Properties Allowed
Show Source

Response

Supported Media Types

200 Response

The package file was installed.
Body ()
Information about the package that was uploaded or installed.
Root Schema : packageImport
Type: object
Information about the package that was uploaded or installed.
Show Source
Nested Schema : importReport
Type: object
Import results.
Show Source
Nested Schema : packageGet
Type: object
The package representation for GET requests.
Match All
Show Source
Nested Schema : policyArray
Type: array
Minimum Number of Items: 0
Unique Items Required: true
An array of policy elements.
Show Source
Nested Schema : policyValidationReport
Type: object
The result of validation of the properties file with policies.
Show Source
Nested Schema : dependencies
Type: object
Information about the asset and its dependencies.
Show Source
Nested Schema : checklistRecordArray
Type: array
Minimum Number of Items: 0
Unique Items Required: true
An array of checklist report records.
Show Source
Nested Schema : apiDependencyArray
Type: array
Minimum Number of Items: 0
Unique Items Required: true
An array of APIs as dependencies.
Show Source
Nested Schema : collectionDependencyArray
Type: array
Minimum Number of Items: 0
Unique Items Required: true
An array of storage collections as dependencies.
Show Source
Nested Schema : connectorDependencyArray
Type: array
Minimum Number of Items: 0
Unique Items Required: true
An array of connectors as dependencies.
Show Source
Nested Schema : implDependencyArray
Type: array
Minimum Number of Items: 0
Unique Items Required: true
An array of API implementations as dependencies.
Show Source
Nested Schema : mbeDependencyArray
Type: array
Minimum Number of Items: 0
Unique Items Required: true
An array of backends as dependencies.
Show Source
Nested Schema : packageDependencyArray
Type: array
Minimum Number of Items: 0
Unique Items Required: true
An array of packages as dependencies.
Show Source
Nested Schema : roleArray
Type: array
Minimum Number of Items: 0
Unique Items Required: true
An array of role elements.
Show Source
Nested Schema : unresolvedDependencyArray
Type: array
Minimum Number of Items: 0
Unique Items Required: true
An array of unresolved dependencies for a custom API implementation.
Show Source
Nested Schema : apiDependency
Type: object
API as a dependency.
Match All
Show Source
Nested Schema : apiShort
Type: object
The short API definition representation.
Match All
Show Source
Nested Schema : apiDependency-allOf[1]
Type: object
Show Source
Nested Schema : assetGet
Type: object
The asset representation for GET requests.
Match All
Show Source
Nested Schema : apiShort-allOf[1]
Type: object
Show Source
Nested Schema : assetUpdate
Type: object
The asset representation for PUT requests.
Show Source
Nested Schema : assetIdEtag
Type: object
The asset ID and entity tag (ETag) values.
Show Source
Nested Schema : trash
Type: object
Indicator of whether the asset is in the trash.
Show Source
Nested Schema : assetGet-allOf[3]
Type: object
Show Source
Nested Schema : entityLinksArray
Type: array
Minimum Number of Items: 0
An array of links for an entity's metadata.
Show Source
Nested Schema : items
Type: object
Link to the entity's metadata.
Show Source
Nested Schema : icon
Type: object
Information about the icon that's associated with the API or connector.
Show Source
Nested Schema : assetShort
Type: object
Asset information (short form).
Show Source
Nested Schema : assetShortQualifiedArray
Type: array
Minimum Number of Items: 0
Unique Items Required: true
An array of qualified assets.
Show Source
Nested Schema : assetShortQualified
Type: object
An asset's information in qualified short form, which includes type and qualifiers.
Match All
Show Source
Nested Schema : assetQualifiers
Type: object
Asset type name and qualifiers.
Show Source
  • The asset qualifier. It may contain multiple values separated by commas (`,`).
  • Allowed Values: [ "MobileBackend", "API", "APIImplementation", "Connector", "StorageCollection", "Role" ]
Nested Schema : collectionDependency
Type: object
Storage collection as a dependency.
Match All
Show Source
Nested Schema : mosCollectionGet
Type: object
The storage collection representation for GET requests.
Match All
Show Source
Nested Schema : collectionDependency-allOf[2]
Type: object
Show Source
Nested Schema : mosCollectionGet-allOf[1]
Type: object
Show Source
Nested Schema : connectorDependency
Type: object
Connector as a dependency.
Match All
Show Source
Nested Schema : connectorGet
Type: object
The connector representation for GET requests.
Match All
Show Source
Nested Schema : connectorDependency-allOf[2]
Type: object
Show Source
Nested Schema : connectorShort
Type: object
The short connector definition representation.
Match All
Show Source
Nested Schema : connectorGet-allOf[1]
Match One
Show Source
Nested Schema : connectorBase
Type: object
Base connector properties.
Show Source
  • The connector API base path in the format `/mobile/connector/{name}/{path}`.
  • Allowed Values: [ "REST", "SOAP", "DATABASE", "ICS", "FA" ]
  • icon
    Information about the icon that's associated with the API or connector.
Nested Schema : connectorGetRest
Type: object
REST connector get payload.
Match All
Show Source
Nested Schema : connectorUpdateSoap
Type: object
SOAP connector update payload.
Match All
Show Source
Nested Schema : connectorUpdateDatabase
Type: object
MOB DB connector update payload.
Match All
Show Source
Nested Schema : connectorUpdateIcsRest
Type: object
ICS REST connector update payload.
Match All
Show Source
Nested Schema : connectorUpdateIcsSoap
Type: object
ICS SOAP connector update payload.
Match All
Show Source
Nested Schema : connectorUpdateRest
Type: object
REST connector update payload.
Show Source
Nested Schema : connectorGetRest-allOf[1]
Type: object
Show Source
Nested Schema : restRuleArray
Type: array
Minimum Number of Items: 0
An array of REST rules.
Show Source
Nested Schema : securityPolicyArray
Type: array
Minimum Number of Items: 0
An array of security policy elements.
Show Source
Nested Schema : restRule
Type: object
REST connector rule definition.
Show Source
Nested Schema : defaultParameters
Type: array
Minimum Number of Items: 0
Unique Items Required: true
Show Source
Nested Schema : methods
Type: array
Minimum Number of Items: 0
Unique Items Required: true
Show Source
  • Allowed Values: [ "GET", "POST", "PUT", "DELETE", "HEAD", "TRACE", "OPTIONS", "PATCH" ]
Nested Schema : restParameter
Type: object
REST connector rule default parameter.
Show Source
Nested Schema : securityPolicy
Type: object
Connector OWSM security policy.
Show Source
Nested Schema : securityPolicyOverrideArray
Type: array
Minimum Number of Items: 0
An array of security-policy override elements.
Show Source
Nested Schema : securityPolicyOverride
Type: object
Security policy override property.
Show Source
Nested Schema : connectorDescriptorInfo
Type: object
Connector descriptor information.
Show Source
Nested Schema : connectorCreateSoap
Type: object
SOAP connector creation payload.
Show Source
Nested Schema : connectorUpdateSoap-allOf[1]
Type: object
Show Source
Nested Schema : operations
Type: array
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : connectorCreateDatabase
Type: object
REST connector creation payload.
Show Source
Nested Schema : connectorUpdateDatabase-allOf[1]
Type: object
Show Source
Nested Schema : dbConnectorMetadata
Type: object
Database connector metadata model.
Show Source
Nested Schema : calls
Type: array
Minimum Number of Items: 0
Show Source
Nested Schema : tableInfo
Type: object
Database connector table/view metadata.
Show Source
Nested Schema : allColumns
Type: array
Minimum Number of Items: 0
Show Source
Nested Schema : primaryKeys
Type: array
Minimum Number of Items: 0
Show Source
Nested Schema : requiredColumns
Type: array
Minimum Number of Items: 0
Show Source
Nested Schema : selectedColumns
Type: array
Minimum Number of Items: 0
Show Source
Nested Schema : tableNameInfo
Type: object
Database connector table/view name/type metadata.
Show Source
Nested Schema : connectorUpdateIcsRest-allOf[1]
Type: object
Show Source
Nested Schema : icsConnectionReference
Type: object
ICS configuration. This holds state about an ICS instance that should persist across connector sessions.
Show Source
Nested Schema : integration
Type: object
ICS integration flow metadata.
Show Source
Nested Schema : connectorUpdateIcsSoap-allOf[1]
Type: object
Show Source
Nested Schema : implDependency
Type: object
API implementation as a dependency.
Match All
Show Source
Nested Schema : apiImplementationGet
Type: object
The API implementation service details.
Match All
Show Source
Nested Schema : implDependency-allOf[2]
Type: object
Show Source
Nested Schema : apiImplementationGet-allOf[1]
Type: object
Show Source
Nested Schema : artifactArray
Type: array
Minimum Number of Items: 0
An array of artifact information.
Show Source
Nested Schema : artifact
Type: object
The artifact information.
Show Source
Nested Schema : properties
Type: object
Additional Properties Allowed
Show Source
Nested Schema : mbeDependency
Type: object
Backend as a dependency.
Match All
Show Source
Nested Schema : mobilebackendGet
Type: object
The backend representation for GET requests.
Match All
Show Source
Nested Schema : mbeDependency-allOf[2]
Type: object
Show Source
Nested Schema : mobilebackendShortGet
Type: object
The backend representation for GET requests.
Match All
Show Source
Nested Schema : mobilebackendGet-allOf[1]
Type: object
Show Source
  • Analytics application ID resolved from the policy. If a new analytics application creation was requested on the backend creation and this attribute is null, then the application wasn't created. In this case you can check if it already exists, retry, or create one with another name and/or timezone, and then link it to the backend.
  • assetShort
    Asset information (short form).
  • localizedMessage
    Localized error message for generic purposes.
Nested Schema : mobilebackendOAuthKeys
Type: object
The client keys (client_id/client_secret) that are required for backend access using OAuth.
Show Source
Nested Schema : mobilebackendBasicAuthKeys
Type: object
The mobile backend ID that's required for backend access when you use Basic access authorization.
Show Source
Nested Schema : mobilebackendShortGet-allOf[3]
Type: object
Show Source
Nested Schema : mobilebackendRoleAccess
Type: object
The backend's role-access details.
Show Source
Nested Schema : stringArray
Type: array
Minimum Number of Items: 0
An array of string values.
Show Source
Nested Schema : localizedMessage
Type: object
Localized error message for generic purposes.
Show Source
Nested Schema : params
Type: array
Minimum Number of Items: 0
Show Source
Nested Schema : packageDependency
Type: object
Package as a dependency.
Match All
Show Source
Nested Schema : roleGet
Type: object
The role representation.
Match All
Show Source
Nested Schema : unresolvedDependency
Type: object
Unresolved dependency for the custom API implementation.
Show Source
Nested Schema : checklistRecord
Type: object
An asset's checklist/import result.
Show Source
Nested Schema : localizedMessageArray
Type: array
Minimum Number of Items: 0
An array of localized messages.
Show Source
Nested Schema : packageGet-allOf[1]
Type: object
Show Source
Nested Schema : policy
Type: object
Policy object representation.
Show Source
Nested Schema : validationResults
Type: array
Minimum Number of Items: 0
Show Source

Examples

The following example shows how to install an imported package using cURL. Before you call this operation, you must first upload the package by sending a POST /mobile/tools/1.0/import/package/upload request. For more information about cURL, see Use cURL.

curl -i -X POST -d @body.json -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" "$BASE_URL/mobile/tools/1.0/import/package/install"

Example of Request Body

You can use the artifact object from the response body for your POST /mobile/tools/1.0/import/package/upload request to form the request body, as shown here.

{  
   "artifact":{  
      "name":"package-mcs_examples_sync_salesplus.zip",
      "id":"04c56716-ab47-4ad0-997d-541d904f99ef",
      "properties":{  
         "is.package":"true"
      },
      "downloadLink":"/mobile/tools/1.0/artifacts/04c56716-ab47-4ad0-997d-541d904f99ef"
   }
}

Example of Response Header

The following shows an example of the response headers:

200 OK
Date: Wed, 28 Jun 2017 20:00:11 GMT
Content-length: 4413
Content-type: application/json

Example of Response Body

The following example shows the contents of the response body in JSON format:

{
    "policies": [
        {
            "name": "*.custom/mcs_examples_sync_salesplus(1.0).Routing_BindApiToImpl",
            "value": "mcs_examples_sync_salesplus(1.0.0)",
            "desc": null
        }
    ],
    "importResults": {
        "records": [
            {
                "assetId": "284efd91-e0bd-4459-be6c-e57618b649a4",
                "assetType": "MobileBackend",
                "resultCode": "CREATED",
                "resolvedTo": null,
                "messages": []
            },
            {
                "assetId": "b5684f31-3984-46dc-8e6f-68712d63c224",
                "assetType": "APIImplementation",
                "resultCode": "CREATED",
                "resolvedTo": null,
                "messages": []
            },
            {
                "assetId": "d406905a-b2b1-4b9e-a220-5b0b8a49ed39",
                "assetType": "API",
                "resultCode": "CREATED",
                "resolvedTo": null,
                "messages": []
            }
        ],
        "dependencies": {
            "mobilebackends": [
                {
                    "id": "284efd91-e0bd-4459-be6c-e57618b649a4",
                    "name": "mcs_examples_sync_salesplus",
                    "version": "1.0",
                    "qualifier": "self",
                    "desc": "MBE for the SalesPlus app which demonstrates several of the MCS Sync Client SDK features.",
                    "links": [],
                    "published": false,
                    "inTrash": false,
                    "actionComment": null,
                    "etag": "0",
                    "createdOn": "2016-09-13T03:20:24.878Z",
                    "modifiedOn": "2016-09-15T04:15:14.724Z",
                    "modifiedBy": "jdoe",
                    "deletedOn": null,
                    "deletedBy": null,
                    "clientId": null,
                    "clientSecret": null,
                    "basicAuthBackendId": null,
                    "oauth": true,
                    "basicAuth": true,
                    "inactive": false,
                    "roleAccess": {
                        "enabled": false,
                        "roles": []
                    },
                    "includes": [],
                    "roles": []
                }
            ],
            "apis": [
                {
                    "id": "d406905a-b2b1-4b9e-a220-5b0b8a49ed39",
                    "namespace": "custom",
                    "name": "mcs_examples_sync_salesplus",
                    "version": "1.0",
                    "desc": "Supports the SalesPlus app which demonstrates several of the MCS Sync Client SDK features.",
                    "links": [],
                    "published": false,
                    "inTrash": false,
                    "actionComment": null,
                    "etag": "0",
                    "createdOn": "2016-09-13T03:08:21.030Z",
                    "modifiedOn": "2016-12-21T16:52:17.155Z",
                    "modifiedBy": "jdoe",
                    "deletedOn": null,
                    "deletedBy": null,
                    "title": "REST API for the SalesPlus App",
                    "basePath": "/mobile/custom/mcs_examples_sync_salesplus",
                    "icon": null,
                    "category": "CUSTOM",
                    "hasBusinessObjects": false,
                    "mock": null,
                    "implementations": [
                        {
                            "id": "b5684f31-3984-46dc-8e6f-68712d63c224",
                            "name": "mcs_examples_sync_salesplus",
                            "version": "1.0.0",
                            "type": "APIImplementation"
                        }
                    ],
                    "implementation": {
                        "id": "b5684f31-3984-46dc-8e6f-68712d63c224",
                        "name": "mcs_examples_sync_salesplus",
                        "version": "1.0.0"
                    },
                    "roles": []
                }
            ],
            "implementations": [
                {
                    "id": "b5684f31-3984-46dc-8e6f-68712d63c224",
                    "name": "mcs_examples_sync_salesplus",
                    "version": "1.0.0",
                    "desc": "Custom API for MCS SalesPlus example app",
                    "links": [],
                    "published": false,
                    "inTrash": false,
                    "actionComment": null,
                    "etag": "0",
                    "createdOn": "2016-09-15T04:05:33.880Z",
                    "modifiedOn": "2016-12-21T17:16:25.640Z",
                    "modifiedBy": "jdoe",
                    "deletedOn": null,
                    "deletedBy": null,
                    "artifacts": [
                        {
                            "name": "impl 2.zip",
                            "id": "dd6430a5-e4ed-458d-a008-2eeae28864a6",
                            "properties": {
                                "customcode.api.implementation.artifact": "true"
                            },
                            "downloadLink": null
                        }
                    ],
                    "api": null,
                    "uses": []
                }
            ],
            "connectors": [],
            "collections": [],
            "unresolvedDependencies": [],
            "roles": [],
            "packages": [],
            "clients": []
        }
    },
    "status": "SUCCESS",
    "policyValidationReport": {
        "valid": true,
        "validationResults": [
            {
                "message": "We successfully uploaded the policies properties file but it failed the validation check. The format error could be due to a corrupted header or the policies file could've been generated from an earlier version of MCS. Ask your mobile cloud administrator to export the policies file from the Administration tab so you can check the file and verify its contents.",
                "messageId": "MOBILE-58176",
                "level": "WARNING"
            }
        ]
    },
    "package": {
        "id": "25f48bf7-bcc2-4e28-aeac-28069323d96e",
        "name": "mcs_examples_sync_salesplus",
        "version": "16.4.5",
        "desc": null,
        "links": [],
        "published": false,
        "inTrash": false,
        "actionComment": null,
        "etag": "0",
        "createdOn": "2017-07-07T01:06:06.221Z",
        "modifiedOn": "2017-07-07T01:06:06.221Z",
        "modifiedBy": "uimcs",
        "deletedOn": null,
        "deletedBy": null,
        "packageType": "IMPORT",
        "documentation": "MBE and REST API for the SalesPlus app in the SDK's examples.zip. SalesPlus is a mobile app that displays and maintains contacts. It also displays reminders. You can use this app both online and offline. If you make changes to your contact info while you're offline, the app syncs with the server automatically when your device goes online. \nThis mobile app demonstrates several of the MCS Sync Client SDK features. It also provides end-to-end example code for building a mobile app that continues to work when the device is offline, including code that detects and handles conflicts between changes on the server and changes made in an offline device.",
        "systemVersion": "16.4.5-201611092203",
        "formatVersion": 0
    }
}