Export Package

post

/mobile/tools/1.0/export/package

Creates a package with the specified assets.

Note that the simplest way to create the request body is to retrieve the package dependencies by sending a POST /mobile/tools/1.0/assets/packageDependencies request for a backend or custom API's asset ID, and then using the response body for the dependencies object in this request.

After the request completes successfully, use the downloadLink from the response body to get the package's ZIP file.

Request

Supported Media Types
  • application/json
Header Parameters
If-Match
Type: string
The request completes successfully only if the ETag of the corresponding asset matches the value of this HTTP request header. To force overwrite, pass the value `*`.
Body Parameter
Root Schema : Request Body for Package Export
Type: object
Title: Request Body for Package Export
The package's definition and the assets to include in the package.
Nested Schema : dependencies
Type: object
Information about the asset and its dependencies.
Nested Schema : package
Type: object
The package's definition.
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 : artifact
Type: object
The artifact information.
Nested Schema : properties
Type: object
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 : packageGet
Type: object
The package representation for GET requests.
Nested Schema : packageGet-allOf[1]
Nested Schema : roleGet
Type: object
The role representation.
Nested Schema : unresolvedDependency
Type: object
Unresolved dependency for the custom API implementation.

Response

Supported Media Types
  • application/json
200 Response
The package was created. The response shows the package-artifact details and a link to download the binary (ZIP) file.
Body
The artifact information.
Root Schema : artifact
Type: object
The artifact information.
Nested Schema : properties
Type: object
400 Response
The operation failed based on the state of the dependencies that were passed in the request.
Body
Root Schema : error
Type: object
Nested Schema : errorDetails
Type: object
412 Response
The operation failed based on the `If-Match` condition. Typically, this is the result of concurrent modification detection. It also can be the result of improper values specified in the request headers.
Body
Root Schema : error
Type: object
Nested Schema : errorDetails
Type: object

Examples

The following example shows how to create and export a package using cURL. For more information about cURL, see Use cURL.

curl -i -X POST -d @body.json -H "Content-Type: application/json; charset=utf-8" -H "Authorization: Bearer $TOKEN" "$BASE_URL/mobile/tools/1.0/export/package"

Example of Request Body

The following shows an example of the request body. Note that the contents of the dependencies object was copied from the response body that was returned by a POST /mobile/tools/1.0/assets/packageDependencies request using the backend???s ID.

{
  "package":{
    "name":"salesPlusPackage",
    "version":"1.0",
    "documentation":"Using Export Package REST API"
  },
  "dependencies":{
    "mobilebackends":[
      {
        "id":"1f7eee54-5f6d-4123-b4b7-5413912510ce",
        "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":"2",
        "createdOn":"2016-09-13T03:20:24.878Z",
        "modifiedOn":"2017-07-11T20:10:42.348Z",
        "modifiedBy":"jdoe",
        "deletedOn":null,
        "deletedBy":null,
        "clientId":"3c78fddef1244ab8bad1b2c20b8e7a15",
        "clientSecret":"7711932a-7288-4b65-9e8e-0b486f6aaf72",
        "basicAuthBackendId":"faf550b1-24f0-4b40-9c58-6751e7047b22",
        "oauth":true,
        "basicAuth":true,
        "inactive":false,
        "roleAccess":{
          "enabled":false,
          "roles":[

          ]
        },
        "includes":[
          {
            "id":"f9da3b1f-cfa8-439e-be80-819a4455a24c",
            "name":"mcs_examples_sync_salesplus",
            "version":"1.0",
            "type":"API"
          },
          {
            "id":"4566a5a1-1981-475f-8a70-053f0a409bcf",
            "name":"images",
            "version":"1.0",
            "type":"StorageCollection"
          }
        ],
        "roles":[

        ]
      }
    ],
    "apis":[
      {
        "id":"f9da3b1f-cfa8-439e-be80-819a4455a24c",
        "namespace":"custom",
        "name":"mcs_examples_sync_salesplus",
        "version":"1.0",
        "qualifier":"implements",
        "desc":"Supports the SalesPlus app which demonstrates several of the MCS Sync Client SDK features.",
        "links":[
          ...
        ],
        "published":false,
        "inTrash":false,
        "actionComment":null,
        "etag":"1",
        "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":false,
        "implementations":[
          {
            "id":"1138d50b-cd03-42dc-8d2b-7e2c28e613dc",
            "name":"mcs_examples_sync_salesplus",
            "version":"1.0.0",
            "type":"APIImplementation"
          }
        ],
        "implementation":{
          "id":"1138d50b-cd03-42dc-8d2b-7e2c28e613dc",
          "name":"mcs_examples_sync_salesplus",
          "version":"1.0.0"
        },
        "roles":[

        ]
      }
    ],
    "implementations":[
      {
        "id":"1138d50b-cd03-42dc-8d2b-7e2c28e613dc",
        "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":"1",
        "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":"c0bd8762-9f66-4233-bd9b-c91831d902cf",
            "properties":{
              "customcode.api.implementation.artifact":"true"
            },
            "downloadLink":"/mobile/tools/1.0/artifacts/c0bd8762-9f66-4233-bd9b-c91831d902cf"
          }
        ],
        "api":{
          "id":"f9da3b1f-cfa8-439e-be80-819a4455a24c",
          "namespace":"custom",
          "name":"mcs_examples_sync_salesplus",
          "version":"1.0",
          "type":"API"
        },
        "uses":[

        ]
      }
    ],
    "connectors":[

    ],
    "collections":[
      {
        "id":"4566a5a1-1981-475f-8a70-053f0a409bcf",
        "name":"images",
        "version":"1.0",
        "desc":"Customer and technician photos",
        "links":[
          ...
        ],
        "published":false,
        "inTrash":false,
        "actionComment":null,
        "etag":"5",
        "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":null,
            "links":[

            ],
            "published":true,
            "inTrash":false,
            "actionComment":null,
            "etag":"1",
            "createdOn":null,
            "modifiedOn":null,
            "modifiedBy":null,
            "deletedOn":null,
            "deletedBy":null
          },
          {
            "id":"fd11a5739507b3bb2a371b45b0eda6c7",
            "name":"customer",
            "version":"1.0",
            "desc":null,
            "links":[

            ],
            "published":true,
            "inTrash":false,
            "actionComment":null,
            "etag":"1",
            "createdOn":null,
            "modifiedOn":null,
            "modifiedBy":null,
            "deletedOn":null,
            "deletedBy":null
          }
        ]
      }
    ],
    "unresolvedDependencies":[

    ],
    "roles":[
      {
        "id":"fd11a5739507b3bb2a371b45b0eda6c7",
        "name":"customer",
        "version":"1.0",
        "desc":null,
        "links":[
          ... 
        ],
        "published":true,
        "inTrash":false,
        "actionComment":null,
        "etag":"1",
        "createdOn":null,
        "modifiedOn":null,
        "modifiedBy":null,
        "deletedOn":null,
        "deletedBy":null
      },
      {
        "id":"fd42ebc04bff72fdd9adf34fd3732c12",
        "name":"manager",
        "version":"1.0",
        "desc":null,
        "links":[
          ... 
        ],
        "published":true,
        "inTrash":false,
        "actionComment":null,
        "etag":"1",
        "createdOn":null,
        "modifiedOn":null,
        "modifiedBy":null,
        "deletedOn":null,
        "deletedBy":null
      }
    ],
    "packages":[

    ],
    "clients":[

    ],
    "policies":[
      {
        "name":"*.custom/mcs_examples_sync_salesplus(1.0).Routing_BindApiToImpl",
        "value":"mcs_examples_sync_salesplus(1.0.0)",
        "desc":null
      }
    ]
  }
}

Example of Response Header

The following shows an example of the response headers:

200 OK
Content-Length: 200
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:

{
    "name": "package-salesPlusPackage.zip",
    "id": "13f8f425-0e8a-4e46-a4d1-f0ee37aa552e",
    "properties": {
        "is.package": "true"
    },
    "downloadLink": "/mobile/tools/1.0/artifacts/13f8f425-0e8a-4e46-a4d1-f0ee37aa552e"
}