Replacing An App in a Journey With the API

Overview

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 https://api.observepoint.com/v2/apps. 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 \https://api.observepoint.com/v2/apps \-H 'Authorization: api_key {your api key here}' \-H 'cache-control: no-cache'
    	
  2. Obtain the Journey ID: Make a second GET call to https://api.observepoint.com/v2/apps/{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 \https://api.observepoint.com/v2/apps/{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 https://api.observepoint.com/v2/app-journeys/{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 \https://api.observepoint.com/v2/app-journeys/{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 https://api.observepoint.com/v2/app-journeys/{appjourneyId}/runs. The runId is returned in the response.

    cURL Code Snippet for Step 4:

    curl -X POST \https://api.observepoint.com/v2/app-journeys/{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.