Expand my Community achievements bar.

SOLVED

External system to integrate to ACC V7 for sending push notification

Avatar

Level 4

Hi Community! 

I have a use-case which I wanted to sparre with some of you about. We are looking into making an integration from an external system to ACC, to allow sending push notifications with dynamic content values such as title, sub title, text, and custom params. Also, the external system should be able to chose a target segment which will point to a pre-defined fitering or similar in ACC. 

So I am looking at docs to figure out the best approach for this, but it is a bit overwhelming to be honest. I have looked at functions like "CreateFromModel" and "SubmitDelivery" but I simply lack some working examples or similar to solving this challenge. Also I am really interested in simply hearing feedback on the approach and possible suggestions to other ways of solving this use-case. 

Thanks a bunch! 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @SorenDP Here is what you can do.

 

1. Create a workflow starting with external signal activity. Then use query activity to select all subscribed user for a segment and use dynamic value in the condition like segment name qual to $(vars/@segment) and add your deliveries based on devices.

 

2. Create a JSSP page

<%@ page import="/nl/core/shared/nl.js" %>
<%
// Load required libraries
loadLibrary("xtk:common.js");
loadLibrary("xtk:shared/json2.js");

// Initialize NL framework
NL.require('nl/core/shared/xtk.js');
NL.server.reset()
  .require("nl/core/apis.js")
  .require('nl/core/queryDef.js')
  .require('/nl/core/jsspcontext.js');

// Initialize API with request and response objects
NL.API.init(request, response, {
  authentication: false,
  jsonoutput: true
}, function(jsspContext) {
  // Check if the request method is GET
  if (request.method.toLowerCase() == "get") {
    var apiKey = "MY_API_KEY_HERE"; // Add your API Key here
    var context = logonEscalation("api");
    
    // Validate API key from request parameter
    if (apiKey == request.getParameter("apiKey")) {
      // Get segment code from request parameter with fallback to empty string
      var segmentCode = request.getParameter("segmentCode") ? request.getParameter("segmentCode") : "";
      
      // Trigger workflow event if segment code is provided
      if (segmentCode != "") {
        xtk.workflow.PostEvent(
          "INTERNAL_NAME_OF_WORKFLOW_FROM_STEP_1", 
          "signal", 
          "", 
          <variables segment={segmentCode}/>  
        , false);
      }
    } else {
      // Authentication failed
      responseCode = 401;
      responseMessage = "Unauthorized";  
      response.sendError(401);
    }
  } else {
    // Invalid request method
    responseCode = 400;
    responseMessage = "Invalid method";
    response.sendError(400);
  }
});  
%>

 

 

Now, from your external platform use the endpoint DOMAIN_HOST/NAMSPACE/PAHE_NAME/jssp?apiKey=API_KEY_HERE&segmentCode=SEGEMENT_CODE

 

This endpoint will use the segment code and trigger your workflow to select the audience for the segment and send them push.

 


     Manoj
     Find me on LinkedIn

View solution in original post

4 Replies

Avatar

Level 4

Hi @SorenDP ,

If I’m not mistaken, the external system will provide both the content for the push message and the targeting audience conditions or a list of audiences.

If that’s the case, you can send push notifications from Adobe Campaign as long as the users coming from the external system have a device ID in Adobe Campaign when they install the app, and all the app details are captured within Campaign.

Let me explain one automated approach we can use:

  1. We can pull the target audience from the SFTP or API into Campaign.

  2. Then, we reconcile this audience with the AppSubscription schema using the key fields.

  3. You can also get the content within the same file, including the personalization fields.
    Or If the push message is the same for all users, you can get the message from a separate file and load it into the data loading system. Then, create fields like Title, Message, etc., and use these fields directly in the push message delivery, such as targetData.title and targetData.message.

If this is not the approach is what you’re looking for, could you provide more details so we can assist you further?

Thanks,
Sushant Trimukhe

Avatar

Level 4

Hi @SushantTrimukheD 

Thanks for the reply! 

I am most keen on avoiding an ftp in this proces. Im looking for an automated solution where the push notification is created, and executed via an external system. (For now, let's just say Postman for POC purposes). 

So a few more details: 

 

An example use-case: An editor is writing an article about some football news (not related to ACC. Entirely different system). The editor publishes this article on a free news website. the editor wants to send a push notification to recipients who are interested in football and encourage them to read the article. This segment is a behavioural segment that exists in ACC V7 already. 

So in Campaign I have a push delivery template. I am also able to query the database for recipients who belongs to a football segment because I have that data stored in a 1:n relationship table with X amount of segments (true/false). 

SorenDP_0-1743679395342.png
So I am thinking about a use-case where the system the editor is using is simply asking the ACC Api's to send the push template with some specified target details. I.E: "Sport football = true" and then some dynamic content for the notification itself. 

Postman: 

SorenDP_1-1743679615611.png


So currently I am not able to make the API call work, and I am also not sure if this is an optimal path to take to solve this use-case. 

Hope that clarifies a bit! 

 



 

Avatar

Correct answer by
Community Advisor

Hello @SorenDP Here is what you can do.

 

1. Create a workflow starting with external signal activity. Then use query activity to select all subscribed user for a segment and use dynamic value in the condition like segment name qual to $(vars/@segment) and add your deliveries based on devices.

 

2. Create a JSSP page

<%@ page import="/nl/core/shared/nl.js" %>
<%
// Load required libraries
loadLibrary("xtk:common.js");
loadLibrary("xtk:shared/json2.js");

// Initialize NL framework
NL.require('nl/core/shared/xtk.js');
NL.server.reset()
  .require("nl/core/apis.js")
  .require('nl/core/queryDef.js')
  .require('/nl/core/jsspcontext.js');

// Initialize API with request and response objects
NL.API.init(request, response, {
  authentication: false,
  jsonoutput: true
}, function(jsspContext) {
  // Check if the request method is GET
  if (request.method.toLowerCase() == "get") {
    var apiKey = "MY_API_KEY_HERE"; // Add your API Key here
    var context = logonEscalation("api");
    
    // Validate API key from request parameter
    if (apiKey == request.getParameter("apiKey")) {
      // Get segment code from request parameter with fallback to empty string
      var segmentCode = request.getParameter("segmentCode") ? request.getParameter("segmentCode") : "";
      
      // Trigger workflow event if segment code is provided
      if (segmentCode != "") {
        xtk.workflow.PostEvent(
          "INTERNAL_NAME_OF_WORKFLOW_FROM_STEP_1", 
          "signal", 
          "", 
          <variables segment={segmentCode}/>  
        , false);
      }
    } else {
      // Authentication failed
      responseCode = 401;
      responseMessage = "Unauthorized";  
      response.sendError(401);
    }
  } else {
    // Invalid request method
    responseCode = 400;
    responseMessage = "Invalid method";
    response.sendError(400);
  }
});  
%>

 

 

Now, from your external platform use the endpoint DOMAIN_HOST/NAMSPACE/PAHE_NAME/jssp?apiKey=API_KEY_HERE&segmentCode=SEGEMENT_CODE

 

This endpoint will use the segment code and trigger your workflow to select the audience for the segment and send them push.

 


     Manoj
     Find me on LinkedIn

Avatar

Level 4

Hi @_Manoj_Kumar_ ! 

Thank you very much for the elaborate answer, that seems like a very good solution to create this in an jssp!