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.