Upload Package

post

/mobile/tools/1.0/import/package/upload

Uploads a package file. After the upload completes successfully, use the POST /moble/tools/1.0/import/package/install operation to install the package.

Request

Supported Media Types
  • multipart/form-data
Form Parameters
file
Type: file
Required: true
The package file to upload.

Response

Supported Media Types
  • application/json
200 Response
The package file was uploaded, and the package details were returned in the response, including the artifact ID, which you use to identify the package when you install it.
Body
Package upload request.
Root Schema : packageUpload
Type: object
Package upload request.
Nested Schema : packageImport
Type: object
Information about the package that was uploaded or installed.
Nested Schema : artifact
Type: object
The artifact information.
Nested Schema : importReport
Type: object
Import results.
Nested Schema : packageGet
Type: object
The package representation for GET requests.
Nested Schema : policyArray
Type: array
Minimum Number of Items: 0
Unique Items Required: true
An array of policy elements.
Nested Schema : policyValidationReport
Type: object
The result of validation of the properties file with policies.
Nested Schema : dependencies
Type: object
Information about the asset and its dependencies.
Nested Schema : checklistRecordArray
Type: array
Minimum Number of Items: 0
Unique Items Required: true
An array of checklist report records.
Nested Schema : apiDependencyArray
Type: array
Minimum Number of Items: 0
Unique Items Required: true
An array of APIs as dependencies.
Nested Schema : collectionDependencyArray
Type: array
Minimum Number of Items: 0
Unique Items Required: true
An array of storage collections as dependencies.
Nested Schema : connectorDependencyArray
Type: array
Minimum Number of Items: 0
Unique Items Required: true
An array of connectors as dependencies.
Nested Schema : implDependencyArray
Type: array
Minimum Number of Items: 0
Unique Items Required: true
An array of API implementations as dependencies.
Nested Schema : mbeDependencyArray
Type: array
Minimum Number of Items: 0
Unique Items Required: true
An array of backends as dependencies.
Nested Schema : packageDependencyArray
Type: array
Minimum Number of Items: 0
Unique Items Required: true
An array of packages as dependencies.
Nested Schema : roleArray
Type: array
Minimum Number of Items: 0
Unique Items Required: true
An array of role elements.
Nested Schema : unresolvedDependencyArray
Type: array
Minimum Number of Items: 0
Unique Items Required: true
An array of unresolved dependencies for a custom API implementation.
Nested Schema : apiDependency
Type: object
API as a dependency.
Nested Schema : apiShort
Type: object
The short API definition representation.
Nested Schema : apiDependency-allOf[1]
Nested Schema : assetGet
Type: object
The asset representation for GET requests.
Nested Schema : apiShort-allOf[1]
Nested Schema : assetUpdate
Type: object
The asset representation for PUT requests.
Nested Schema : assetIdEtag
Type: object
The asset ID and entity tag (ETag) values.
Nested Schema : trash
Type: object
Indicator of whether the asset is in the trash.
Nested Schema : assetGet-allOf[3]
Nested Schema : entityLinksArray
Type: array
Minimum Number of Items: 0
An array of links for an entity's metadata.
Nested Schema : items
Type: object
Link to the entity's metadata.
Nested Schema : icon
Type: object
Information about the icon that's associated with the API or connector.
Nested Schema : assetShort
Type: object
Asset information (short form).
Nested Schema : assetShortQualifiedArray
Type: array
Minimum Number of Items: 0
Unique Items Required: true
An array of qualified assets.
Nested Schema : assetShortQualified
Type: object
An asset's information in qualified short form, which includes type and qualifiers.
Nested Schema : assetQualifiers
Type: object
Asset type name and qualifiers.
Nested Schema : collectionDependency
Type: object
Storage collection as a dependency.
Nested Schema : mosCollectionGet
Type: object
The storage collection representation for GET requests.
Nested Schema : collectionDependency-allOf[2]
Nested Schema : mosCollectionGet-allOf[1]
Nested Schema : connectorDependency
Type: object
Connector as a dependency.
Nested Schema : connectorGet
Type: object
The connector representation for GET requests.
Nested Schema : connectorDependency-allOf[2]
Nested Schema : connectorShort
Type: object
The short connector definition representation.
Nested Schema : connectorGet-allOf[1]
Nested Schema : connectorBase
Type: object
Base connector properties.
Nested Schema : connectorGetRest
Type: object
REST connector get payload.
Nested Schema : connectorUpdateSoap
Type: object
SOAP connector update payload.
Nested Schema : connectorUpdateDatabase
Type: object
MOB DB connector update payload.
Nested Schema : connectorUpdateIcsRest
Type: object
ICS REST connector update payload.
Nested Schema : connectorUpdateIcsSoap
Type: object
ICS SOAP connector update payload.
Nested Schema : connectorUpdateRest
Type: object
REST connector update payload.
Nested Schema : connectorGetRest-allOf[1]
Nested Schema : restRuleArray
Type: array
Minimum Number of Items: 0
An array of REST rules.
Nested Schema : securityPolicyArray
Type: array
Minimum Number of Items: 0
An array of security policy elements.
Nested Schema : restRule
Type: object
REST connector rule definition.
Nested Schema : defaultParameters
Type: array
Minimum Number of Items: 0
Unique Items Required: true
Nested Schema : methods
Type: array
Minimum Number of Items: 0
Unique Items Required: true
Nested Schema : restParameter
Type: object
REST connector rule default parameter.
Nested Schema : securityPolicy
Type: object
Connector OWSM security policy.
Nested Schema : securityPolicyOverrideArray
Type: array
Minimum Number of Items: 0
An array of security-policy override elements.
Nested Schema : securityPolicyOverride
Type: object
Security policy override property.
Nested Schema : connectorDescriptorInfo
Type: object
Connector descriptor information.
Nested Schema : connectorCreateSoap
Type: object
SOAP connector creation payload.
Nested Schema : connectorUpdateSoap-allOf[1]
Nested Schema : operations
Type: array
Nested Schema : items
Type: object
Nested Schema : connectorCreateDatabase
Type: object
REST connector creation payload.
Nested Schema : connectorUpdateDatabase-allOf[1]
Nested Schema : dbConnectorMetadata
Type: object
Database connector metadata model.
Nested Schema : calls
Type: array
Minimum Number of Items: 0
Nested Schema : tableInfo
Type: object
Database connector table/view metadata.
Nested Schema : allColumns
Type: array
Minimum Number of Items: 0
Nested Schema : primaryKeys
Type: array
Minimum Number of Items: 0
Nested Schema : requiredColumns
Type: array
Minimum Number of Items: 0
Nested Schema : selectedColumns
Type: array
Minimum Number of Items: 0
Nested Schema : tableNameInfo
Type: object
Database connector table/view name/type metadata.
Nested Schema : connectorUpdateIcsRest-allOf[1]
Nested Schema : icsConnectionReference
Type: object
ICS configuration. This holds state about an ICS instance that should persist across connector sessions.
Nested Schema : integration
Type: object
ICS integration flow metadata.
Nested Schema : connectorUpdateIcsSoap-allOf[1]
Nested Schema : implDependency
Type: object
API implementation as a dependency.
Nested Schema : apiImplementationGet
Type: object
The API implementation service details.
Nested Schema : implDependency-allOf[2]
Nested Schema : apiImplementationGet-allOf[1]
Nested Schema : artifactArray
Type: array
Minimum Number of Items: 0
An array of artifact information.
Nested Schema : mbeDependency
Type: object
Backend as a dependency.
Nested Schema : mobilebackendGet
Type: object
The backend representation for GET requests.
Nested Schema : mbeDependency-allOf[2]
Nested Schema : mobilebackendShortGet
Type: object
The backend representation for GET requests.
Nested Schema : mobilebackendGet-allOf[1]
Nested Schema : mobilebackendOAuthKeys
Type: object
The client keys (client_id/client_secret) that are required for backend access using OAuth.
Nested Schema : mobilebackendBasicAuthKeys
Type: object
The mobile backend ID that's required for backend access when you use Basic access authorization.
Nested Schema : mobilebackendShortGet-allOf[3]
Nested Schema : mobilebackendRoleAccess
Type: object
The backend's role-access details.
Nested Schema : stringArray
Type: array
Minimum Number of Items: 0
An array of string values.
Nested Schema : localizedMessage
Type: object
Localized error message for generic purposes.
Nested Schema : params
Type: array
Minimum Number of Items: 0
Nested Schema : packageDependency
Type: object
Package as a dependency.
Nested Schema : roleGet
Type: object
The role representation.
Nested Schema : unresolvedDependency
Type: object
Unresolved dependency for the custom API implementation.
Nested Schema : checklistRecord
Type: object
An asset's checklist/import result.
Nested Schema : localizedMessageArray
Type: array
Minimum Number of Items: 0
An array of localized messages.
Nested Schema : packageGet-allOf[1]
Nested Schema : policy
Type: object
Policy object representation.
Nested Schema : validationResults
Type: array
Minimum Number of Items: 0
Nested Schema : properties
Type: object

Examples

The following example shows how to use cURL to upload a package that you had exported. After you upload the package, use the POST /mobile/tools/1.0/import/package/install operation to install it. For more information about cURL, see Use cURL.

curl -i -X POST --form file=@package-mcs_examples_sync_salesplus.zip -H "Authorization: Bearer $TOKEN" "$BASE_URL/mobile/tools/1.0/import/package/upload"

Example of Response Header

The following shows an example of the response headers:

200 OK
Content-Length: 5122
Content-Type: application/json
Date: Wed, 28 Jun 2017 20:00:11 GMT

Example of Response Body

The following example shows the contents of the response body in JSON format. Note that you can use the artifact JSON object in the request body for the install operation.

{
    "policies": null,
    "importResults": {
        "records": [
            {
                "assetId": "fd11a5739507b3bb2a371b45b0eda6c7",
                "assetType": "Role",
                "resultCode": "CREATED",
                "resolvedTo": null,
                "messages": []
            },
            {
                "assetId": "d66b5c81-2531-46c8-bda7-f4cc8e83ce2e",
                "assetType": "APIImplementation",
                "resultCode": "CREATED",
                "resolvedTo": null,
                "messages": []
            },
            {
                "assetId": "fd42ebc04bff72fdd9adf34fd3732c12",
                "assetType": "Role",
                "resultCode": "CREATED",
                "resolvedTo": null,
                "messages": []
            },
            {
                "assetId": "4c5cc3c5-c3e4-47f9-a87a-f7b88aa2e7c7",
                "assetType": "StorageCollection",
                "resultCode": "CREATED",
                "resolvedTo": null,
                "messages": []
            },
            {
                "assetId": "9a8d49ad-fa9b-43b7-88a0-1dd401039e47",
                "assetType": "API",
                "resultCode": "CREATED",
                "resolvedTo": null,
                "messages": []
            },
            {
                "assetId": "7cc615fa-bc6e-4e0f-a599-73c264d5249a",
                "assetType": "MobileBackend",
                "resultCode": "CREATED",
                "resolvedTo": null,
                "messages": []
            }
        ],
        "dependencies": {
            "mobilebackends": [
                {
                    "id": "7cc615fa-bc6e-4e0f-a599-73c264d5249a",
                    "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": "2017-07-11T20:10:42.348Z",
                    "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": "9a8d49ad-fa9b-43b7-88a0-1dd401039e47",
                    "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": "d66b5c81-2531-46c8-bda7-f4cc8e83ce2e",
                            "name": "mcs_examples_sync_salesplus",
                            "version": "1.0.0",
                            "type": "APIImplementation"
                        }
                    ],
                    "implementation": {
                        "id": "d66b5c81-2531-46c8-bda7-f4cc8e83ce2e",
                        "name": "mcs_examples_sync_salesplus",
                        "version": "1.0.0"
                    },
                    "roles": []
                }
            ],
            "implementations": [
                {
                    "id": "d66b5c81-2531-46c8-bda7-f4cc8e83ce2e",
                    "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": "c2822b7f-ba4e-4693-a7f5-2c7cf91dcdd4",
                            "properties": {
                                "customcode.api.implementation.artifact": "true"
                            },
                            "downloadLink": null
                        }
                    ],
                    "api": null,
                    "uses": []
                }
            ],
            "connectors": [],
            "collections": [
                {
                    "id": "4c5cc3c5-c3e4-47f9-a87a-f7b88aa2e7c7",
                    "name": "images",
                    "version": "1.0",
                    "desc": "Customer and technician photos",
                    "links": [],
                    "published": false,
                    "inTrash": false,
                    "actionComment": null,
                    "etag": "0",
                    "createdOn": "2017-07-11T20:10:41.563Z",
                    "modifiedOn": "2017-07-11T20:37:49.911Z",
                    "modifiedBy": "jdoe",
                    "deletedOn": null,
                    "deletedBy": null,
                    "userIsolated": false,
                    "syncControl": true,
                    "guid": "OW2V7PVFUNAZDDQLLFFUVA24PQ",
                    "roles": [
                        {
                            "id": "fd42ebc04bff72fdd9adf34fd3732c12",
                            "name": "manager",
                            "version": "1.0",
                            "desc": "Company manager",
                            "links": [],
                            "published": true,
                            "inTrash": false,
                            "actionComment": null,
                            "etag": "0",
                            "createdOn": null,
                            "modifiedOn": null,
                            "modifiedBy": null,
                            "deletedOn": null,
                            "deletedBy": null
                        },
                        {
                            "id": "fd11a5739507b3bb2a371b45b0eda6c7",
                            "name": "customer",
                            "version": "1.0",
                            "desc": "Client application user",
                            "links": [],
                            "published": true,
                            "inTrash": false,
                            "actionComment": null,
                            "etag": "0",
                            "createdOn": null,
                            "modifiedOn": null,
                            "modifiedBy": null,
                            "deletedOn": null,
                            "deletedBy": null
                        }
                    ]
                }
            ],
            "unresolvedDependencies": [],
            "roles": [
                {
                    "id": "fd11a5739507b3bb2a371b45b0eda6c7",
                    "name": "customer",
                    "version": "1.0",
                    "desc": "Client application user",
                    "links": [],
                    "published": true,
                    "inTrash": false,
                    "actionComment": null,
                    "etag": "0",
                    "createdOn": null,
                    "modifiedOn": null,
                    "modifiedBy": null,
                    "deletedOn": null,
                    "deletedBy": null
                },
                {
                    "id": "fd42ebc04bff72fdd9adf34fd3732c12",
                    "name": "manager",
                    "version": "1.0",
                    "desc": "Company manager",
                    "links": [],
                    "published": true,
                    "inTrash": false,
                    "actionComment": null,
                    "etag": "0",
                    "createdOn": null,
                    "modifiedOn": null,
                    "modifiedBy": null,
                    "deletedOn": null,
                    "deletedBy": null
                }
            ],
            "packages": [],
            "clients": []
        }
    },
    "status": "SUCCESS",
    "policyValidationReport": null,
    "artifact": {
        "name": "package-salesPlusPackage.zip",
        "id": "5132ec5c-5fa2-4487-bcde-3854cffef086",
        "properties": {
            "is.package": "true"
        },
        "downloadLink": "/mobile/tools/1.0/artifacts/5132ec5c-5fa2-4487-bcde-3854cffef086"
    },
    "package": {
        "id": null,
        "name": "salesPlusPackage",
        "version": "1.0",
        "desc": null,
        "links": [],
        "published": null,
        "inTrash": null,
        "actionComment": null,
        "etag": null,
        "createdOn": null,
        "modifiedOn": null,
        "modifiedBy": null,
        "deletedOn": null,
        "deletedBy": null,
        "packageType": null,
        "documentation": "Using Export Package REST API",
        "systemVersion": "17.3.1.0.0.170711.0502",
        "formatVersion": 6
    }
}