Edit in GitHubLog an issue

Target Raw API reference

executeRawRequest

This API can be used to retrieve prefetch or execute responses for mbox locations from the configured Target server.

Java

Syntax

Copied to your clipboard
public static void executeRawRequest(final Map<String, Object> request, final AdobeCallback<Map<String, Object>> callback)
  • request: A map containing prefetch or execute request data in the Target v1 delivery API request format.
  • callback: An AdobeCallback instance which will be called after the Target request is completed. The parameter in the callback will contain the response data if the request executed successfully, or it will contain null otherwise.

Example

Copied to your clipboard
final Map<String, Object> executeMbox1 = new HashMap<String, Object>() {
{
put("index", 0);
put("name", "mbox1");
put("parameters", new HashMap<String, String>() {
{
put("mbox_parameter_key1", "mbox_parameter_value1");
}
});
put("profileParameters", new HashMap<String, String>() {
{
put("subscription", "premium");
}
});
put("order", new HashMap<String, Object>() {
{
put("id", "id1");
put("total", 100.34);
put("purchasedProductIds", new ArrayList<String>() {
{
add("pId1");
}
});
}
});
put("product", new HashMap<String, String>() {
{
put("id", "pId1");
put("categoryId", "cId1");
}
});
}
};
final Map<String, Object> executeMbox2 = new HashMap<String, Object>() {
{
put("index", 1);
put("name", "mbox2");
put("parameters", new HashMap<String, String>() {
{
put("mbox_parameter_key2", "mbox_parameter_value2");
}
});
}
};
final List<Map<String, Object>> executeMboxes = new ArrayList<>();
executeMboxes.add(executeMbox1);
executeMboxes.add(executeMbox2);
final Map<String, Object> request = new HashMap<String, Object>() {
{
put("execute", new HashMap<String, Object>() {
{
put("mboxes", executeMboxes);
}
});
}
};
Target.executeRawRequest(request, response -> {
System.out.println("Received Target raw response.");
if (response == null) {
System.out.println("Null Target response!");
return;
}
// handle response
});

sendRawNotifications

This API sends notification request(s) to the configured Target server for click or display notifications. The event tokens required for the Target click or display notifications can be retrieved from a previous executeRawRequest API response.

Java

Syntax

Copied to your clipboard
public static void sendRawNotifications(final Map<String, Object> request)
  • request: A map containing notifications data in the Target v1 delivery API request format.

Example

Copied to your clipboard
final List<Map<String, Object>> notifications = new ArrayList<>();
final Map<String, Object> notification = new HashMap<String, Object>() {
{
put("id", "0");
put("timestamp", (long)(System.currentTimeMillis()));
put("type", "click");
put("mbox", new HashMap<String, Object>() {
{
put("name", "mbox1");
}
});
put("tokens", new ArrayList<String>() {
{
add("someClickToken");
}
});
put("parameters", new HashMap<String, Object>() {
{
put("mbox_parameter_key3", "mbox_parameter_value3");
}
});
}
};
notifications.add(notification);
final Map<String, Object> request = new HashMap<>();
request.put("notifications", notifications);
Target.sendRawNotifications(request);
Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.