Replacing An App in a Journey With the API


This documentation is for those who want to upload newer versions of an app for a Journey. It involves uploading a new app and copying over the steps and rules of a previous Journey to the newer version of the app. The text in red indicates the parts of the cURL code snippets that need to be changed.

First see Upload App Files With API which documents the process of uploading a new app. The next steps are as follows:

  • Obtain the app ID for the newly uploaded app
  • Obtain the Journey ID for the previous version of the app
  • Replace the old app with the new app, for the Journey of interest
  • Run the app Journey in the application
  1. Obtain the New App ID: After you've uploaded the new app file (Upload App Files With API) make the GET call to Make sure that you have the proper ObservePoint API key for your account in the API environment.

    This call returns a list of all the apps uploaded to your account. Check to see if the new app you uploaded is contained in this list, and locate its id. You'll need this later.

    cURL Code Snippet for Step 1:

    curl -X GET \ \-H 'Authorization: api_key {your api key here}' \-H 'cache-control: no-cache'
  2. Obtain the Journey ID: Make a second GET call to{appId}/app-journeys. The {appId} is the id of the old app that you want to replace with the new app you uploaded. Obtain this from step 1, where the GET call retrieved all of the apps for the account. All the Journeys for that specific appId are displayed. Locate the id for the Journey that you wish to add the newly uploaded app to.

    cURL Code Snippet for Step 2:

    curl -X GET \{app Id}/app-journeys \-H 'Authorization: api_key {your api key here}' \-H 'cache-control: no-cache'
  3. Replace the Old App: Make a PUT call to{appJourneyId}.
    For the fields below, reference the settings found from step 2 for the specific Journey, and copy them over. Make sure that for appId you use the id found in step 1.

    {{"name": "string (required)","appId": {The ID found in step 1},"device": "integer (optional)","osVersion": "integer (optional)","countryCode": "string (optional)","locationId": {},"frequency": "integer (required)","nextRun": "string (optional)","numberOfMultiRuns": "integer (required)","deepLinkUrl": "string (optional)","filters": {"exclude": ["string"]}}
    In the response you should see the newly uploaded appId from step 1 replace the appId from step 2 with the same Journey ID. Check AppAssurance to see if the app Journey is running.

    cURL Code Snippet

    curl -X PUT \{app journey Id} \-H 'Authorization: api_key {your api key here}' \-H 'Content-Type: application/json' \-H 'cache-control: no-cache' \-d '{  "name": "{string}", "appId": {number},  "device": {number},  "osVersion": {number},  "countryCode": "{string}", "locationId": null,  "frequency": {number},  "numberOfMultiRuns": {number}, "deepLinkUrl": null,  "filters": {   "exclude": ["string"] }}
  4. Run the App Journey: If the app Journey doesn't automatically run, make a POST call to{appjourneyId}/runs. The runId is returned in the response.

    cURL Code Snippet for Step 4:

    curl -X POST \{app journey Id}/runs \-H 'Authorization: bearer_token {}' \-H 'cache-control: no-cache'
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.