0
votes

I have developed a custom journey activity in salesforce marketing cloud based on salesforce guidelines https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-app-development.meta/mc-app-development/creating-activities.htm

We created a simple web app with a static HTML Page(index.html) as per specs. We coded the end points(Save, Publish, validate, stop, testsave, Execute) in a C# web API deployed to Azure App Service. We have secured both the Application and the end point with SSL. The Web API methods return a Status 200OK if successful and status 400 bad request if there is an error. For tracing purposes we are logging the web service call in a text file on the app service.

Here is the config.json file for the custom activity as per marketing cloud specs.

{
  "workflowApiVersion": "1.1",
  "metadata": {
    "icon": "images/icon.png",
    "iconSmall": "images/iconSmall.png"
  },
  "type": "RestDecision",
  "lang": {
    "en-US": {
      "name": "A custom journey activity",
      "description": "A custom Journey Builder activity to call Propensity hub."
    }
  },
  "userInterfaces": {
    "configInspector": {
      "size": "small"
    }
  },
  "arguments": {
    "execute": {
      "inArguments": [
        {
          "CampaignIdentifier": ""
        }
      ],
      "outArguments": [],
      "timeout": 99000,
      "retryCount": 1,
      "retryDelay": 50000,
      "url": "https://myUrl/api/myApp/execute"
    }
  },
  "configurationArguments": {
    "save": {
      "url": "https://myUrl/api/myApp/save"
    },
    "publish": {
      "url": "https://myUrl/api/myApp/publish"
    },
    "validate": {
      "url": "https://myUrl/api/myApp/validate"
    },
    "stop": {
      "url": "https://myUrl/api/myApp/stop"
    }
  },
  "outcomes": [
    {
      "arguments": {
        "branchResult": "OPT1"
      },
      "metaData": {
        "label": "Option 1"
      }
    },
    {
      "arguments": {
        "branchResult": "OPT2"
      },
      "metaData": {
        "label": "Option 2"
      }
    },
    {
      "arguments": {
        "branchResult": "OPT3"
      },
      "metaData": {
        "label": "Option 3"
      }
    },
    {
      "arguments": {
        "branchResult": "OPT4"
      },
      "metaData": {
        "label": "Option 4"
      }
    },
    {
      "arguments": {
        "branchResult": "OPT5"
      },
      "metaData": {
        "label": "Option 5"
      }
    },
    {
      "arguments": {
        "branchResult": "OPT6"
      },
      "metaData": {
        "label": "Option 6"
      }
    },
    {
      "arguments": {
        "branchResult": "OPT7"
      },
      "metaData": {
        "label": "Option 7"
      }
    },
    {
      "arguments": {
        "branchResult": "OPT8"
      },
      "metaData": {
        "label": "Option 8"
      }
    },
    {
      "arguments": {
        "branchResult": "OPT9"
      },
      "metaData": {
        "label": "Option 9"
      }
    },
    {
      "arguments": {
        "branchResult": "OPT10"
      },
      "metaData": {
        "label": "Option 10"
      }
    },
    {
      "arguments": {
        "branchResult": "NONE"
      },
      "metaData": {
        "label": "Option None"
      }
    }
  ]
}

The custom UI developed for this journey activity host successfully in the marketing cloud journey Iframe. The configuration metadata entered is saved correctly and when the custom activity is loaded again the values are loaded correctly in Iframe. In a nutshell the UI works fine.

However none of the web api end points are executed. If i save the journey when i click Save on journey builder the save end point(https://myUrl/api/myApp/save) is not called(there is no log in the text file).Same with the others (I hope i am interpreting the meaning of these operation specified in marketing cloud documentation correctly.)

The end points are reached though when executing through Postman - i get a status of 200OK. I have used a marketing cloud example while developing this activity (https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-app-development.meta/mc-app-development/example-rest-activity.htm)

Any thoughts/help would be appreciated.

Thanks Regards Sid

1

1 Answers

2
votes

It works. The document was slightly misleading - the end point for save i assumed would be called when we hit save on the journey builder to save my journey - all end points are executed when the journey is activated.