Pushing a New App with the API
Using the API you can push apps to the cloud for TIBCO BusinessWorks, TIBCO Flogo®, and Node.js.
If the target organization has an existing connection that is similar, the app uses the connection ID of that connection. For example, if the app has a Salesforce connection and the target organization has an existing Salesforce connection, the app uses the ID of the existing Salesforce connection.
Considerations for Flogo apps pushed using the API:
- You can see the app and its implementation in the TIBCO Cloud™ Integration User Interface, but you cannot edit anything in the app even if you are the original owner of the app.
- The Change Owner option is not available in the TIBCO Cloud Integration User Interface, but you can change owner using the following API method:
POST /v1/subscriptions/{subscriptionLocator}/apps/{appId}/copy
. See Copying an App with the API for more information. - The app is visible only to users in the same organization as the user who pushed the app.
- If you make a copy of an app after pushing it via the API, the copied app is in read-only mode.
- If the app has variables configured, you cannot edit their default values. You can override the variables using the overrides parameter, using the Environment Controls tab on the App Details in the User Interface, or by pushing the app using the TIBCO Cloud™ - Command Line Interface.
-
You can push the apps created with TIBCO Flogo® Extension for Visual Studio Code that have the
.flogo
extension.
To push an app you need the following:
- Subscription Locator — The Subscription Locator of the Organization you want to access. To find Subscription Locators for your organizations use the
GET /v1/userinfo
method to return a list of all of the organizations for your OAuth Token with their Subscription Locators. You can use 0 as the Subscription Locator for the organization that owns the OAuth token. - App name — Name of the new app or the app to be updated. Supports names that start with either a letter or underscore and can contain letters, numbers, periods, dashes and underscores.
- App archive — For TIBCO BusinessWorks apps, the app archive is an EAR archive. For Node.js apps, it is a ZIP archive. For TIBCO Flogo® apps, the app archive is a JSON file. For Node.js apps, see Deploying Node.js Apps for information on packaging your app.
manifest.json
file — For TIBCO BusinessWorks apps, themanifest.json
file is optional if it is included in the EAR archive. For Node.js and Flogo apps, themanifest.json
file is required. However, if the.flogo
file is provided, themanifest.json
file is not required.
curl -X POST "https://api.cloud.tibco.com/tci/v1/subscriptions/0/apps?appName=ASBTestNewApp1&instanceCount=0&retainAppProps=true" -H "accept: application/json" -H "Authorization: Bearer <your-oauth-token>" -H "Content-Type: multipart/form-data" -F "artifact=@/Users/abahr/tci/flogo.json;type=application/json" -F "manifest.json=@/Users/abahr/tci/manifest.json;type=application/json"
- Use the
POST /v1/subscriptions/{subscriptionLocator}/apps
method to create a new app and push it to the cloud. This is an asynchronous call. - Include the
instanceCount
parameter, which controls scaling by setting the number of app instances to run. Default value is 0. -
Include the
tunnelKey
parameter with ID of the Hybrid agent access key. Hybrid agent access keys are only required if you are using the Hybrid agent with apps that connect to on-premise systems.Generate a Hybrid agent access key under your TIBCO Cloud Integration user settings. Be sure to copy it immediately and store it in a safe location. The key is only displayed once when it is generated. See Generating or Revoking Access Keys.
Note: Access keys can also be modified or detached using thePUT /v1/subscriptions/{subscriptionLocator}/apps/{appId}/env/tunnelkey
orDELETE /v1/subscriptions/{subscriptionLocator}/apps/{appId}/env/tunnelkey
methods. - Include the
artifact
parameter with the name of the app archive to be pushed with the app. - If required, include the
manfest.json
parameter with the namemanfiest.json
to be pushed with the app. -
Include the
overrides
parameter with the name of the file containing the new variable values for the app. If theretainAppProps
parameter is set to true, the overrides file is not used. - Use the
GET /v1/subscriptions/{subscriptionLocator}/apps/{appId}/status
method to check whether or not the app has been successfully pushed to the cloud. - Use the
GET /v1/subscriptions/{subscriptionLocator}/apps/{appId}
method to view the app details.
forceOverwrite
parameter to true
, the new app overwrites the existing app with the same name. TIBCO Cloud Integration - Connect has a separate API that allows you to manage objects for that capability. For information on creating TIBCO Cloud Integration - Connect apps see Create Or Modify A Solution Or Map, Solutions, Copy A Solution To Another Organization, and Preparing A Solution, in the TIBCO Cloud Integration - Connect Developer Portal.
Role Requirements
- An Admin can overwrite any app.
- Users can only overwrite an app they own.
- If there are multiple apps with the same name, a push will be rejected. (There could be apps with the same name due to migration of apps from when sandboxes were supported.) For an Admin user, this applies to all apps in an organization; for a User this only applies to their apps.
Related Topics
Managing Apps with the TIBCO Cloud™ Integration API
Pushing an Updated App with the API
Checking the Status of an App with the API
Viewing App Details with the API