Skip to content

Deploying Hybrid Apps Using the REST API

Deploy a new or updated hybrid app to SAP Cloud Platform Mobile Services using the POST application REST API.

Note

You cannot deploy a hybrid app for a specific platform: everything in the Kapsel application file is deployed. Once the application is deployed, you can promote or delete hybrid apps for specific platforms as needed.

To attach a Kapsel application file as a parameter in a REST client, use the curl command line tool.

After an application is deployed, it is considered to be a new version. You can activate it by promoting it to the current version, which allows users to download patches and upgrade the application on their devices.

Syntax

Send a POST request to the following URI:

https://<mobile services host>/Admin/kapsel/jaxrs/KapselApp/<APP_ID>

Note

To authenticate, specify the user name and password in each request.

Returns

A response with information about the new and current version of the application. For example:

{"newVersion":
  {"requiredKapselVersion":"1.5",
   "developmentVersion":"1.2.5",
   "description":"An update for the sample app.",
   "revision":-1},
 "currentVersion":
  {"requiredKapselVersion":"1.5",
   "developmentVersion":"1.2.4",
   "description":"A sample app.",
   "revision":2}
}

If successful, a 201 status code is returned; otherwise, an HTTP failure code and an error message are returned.

Example

This example uses the curl command line tool and the --cacert flag. Your client may require you to pass other arguments or set specific configuration options.

curl --user <user>:<password> --cacert <your-server.pem> --X POST -i https://localhost:8083/Admin/kapsel/jaxrs/KapselApp/MyTestAppId

Promoting Hybrid Apps Using the REST API

Promote a new hybrid app to make it the current version of the application using the PUT application REST API. Only administrators can run this API; developers cannot.

Promote a hybrid app for a specific platform or for all platforms.

Note

To authenticate, specify the user name and password in each request.

Syntax

To promote a hybrid app for all platforms, send a PUT request to the following URI:

https://<host>:<admin_port>/cockpit/v1/org/<ORG_NAME>/space/<SPACE_NAME>/app/<APP_ID>/service/app-update/Admin/kapsel/jaxrs/KapselApp/<APP_ID>

To promote a hybrid app for a specific platform, send a PUT request to the following URI:

https://<host>:<admin_port>/cockpit/v1/org/<ORG_NAME>/space/<SPACE_NAME>/app/<APP_ID>/service/app-update/Admin/kapsel/jaxrs/KapselApp/<APP_ID>/<action>

Where <action> is one of:

  • stage

  • unstage

  • promotePending

  • promoteStage

After the application is promoted, users can upgrade the application on their devices.

Returns

If successful, a 200 status code is returned; otherwise, an HTTP failure code and an error message are returned.

Example

This example uses the curl command line tool and the --cacert flag. Your client may require you to pass other arguments or set specific configuration options.

curl --user <user>:<password> --cacert <your-server.pem> --X `PUT` -i https://service-cockpit-web-development.cfapps.sap.hana.ondemand.com/cockpit/v1/org/mobiledev_mobile-ops-subscriber/space/development-qa/app/MyTestAppId/service/app-update/Admin/kapsel/jaxrs/KapselApp/MyTestAppId/promotePending

Last update: August 12, 2020