Timeline for SFMC JB Custom Activity | POST values from DE to endpoint that requires specific data set
Current License: CC BY-SA 4.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 28, 2020 at 5:16 | comment | added | Jason Hanshaw | You'll still use those endpoints in your config file and within your package in SFMC, but refer to that post route for your own internal logic of how your application is going to process that data on a given event. | |
Aug 28, 2020 at 4:56 | comment | added | Aib Syed | Thank you very much, this explains a lot. I used a git repo as a template for my activity and didn't go through the process of actually configuring my express logic so this helps greatly. As for the execute endpoint in my config.JSON, would I simply use example.herokuapp.com/journeybuilder/execute or would it not be required since I am now doing a POST from the backend? | |
Aug 28, 2020 at 4:47 | vote | accept | Aib Syed | ||
Aug 28, 2020 at 4:46 | comment | added | Jason Hanshaw | Check out this repo: github.com/ExactTarget/journey-builder-custom-hello-world. Look at line 74 of the app.js file in the parent folder. This is what defines what to do when an action comes in from JB. For the execute method, notice that it's calling the path to file (defined at the top) and the execute function within that file.Navigate to that file path (routes/activity.js) and look for "exports.execute." Add your logic to grab the payload and call the API within that function as it will run on JB execution. | |
Aug 28, 2020 at 4:42 | comment | added | Jason Hanshaw | In your express logic, you should have a post method for each of the actions you want to take in your app (save/validate/publish/execute). This tells your application what file and function to run when a given action is triggered from SFMC. Locate the route to your execute function (what happens when a user record enters your activity step) and you can retrieve the payload values and format/make your API call from there. | |
Aug 28, 2020 at 4:36 | comment | added | Aib Syed | Let's say my app URL is something like this: appurl.herokuapp.com - What would the endpoint be on execute to send to the backend, and should I create a new JS file to work the backend? (Sorry kind of new to working data like this, and I may be overlooking something completely trivial). Feel free to skip the jwt part if necessary. | |
Aug 28, 2020 at 4:35 | comment | added | Aib Syed | thank you for the great response. At the time of posting my save function looks almost identical to your example. That is actually exactly how I am currently assigning values from my DE. The only thing I didn't do was store the values in a recipient object but I will do exactly as your example moving forward. - You speak of sending the values to the backend of the app and working it from there. Here is where I would like additional guidance. How can I do this? | |
Aug 28, 2020 at 4:30 | history | edited | Jason Hanshaw | CC BY-SA 4.0 |
added 95 characters in body
|
Aug 28, 2020 at 4:21 | history | answered | Jason Hanshaw | CC BY-SA 4.0 |