private static final String ADVERTISER_ID = "INSERT_ADVERTISER_ID_HERE";
public static void runExample(
DfaServices dfaServices, DfaSession session, long advertiserId) throws Exception {
// Request the service.
SpotlightRemote service = dfaServices.get(session, SpotlightRemote.class);
// Set activity group search criteria structure and
// use advertiser ID as search criteria.
SpotlightActivityGroupSearchCriteria activityGroupSearchCriteria =
new SpotlightActivityGroupSearchCriteria();
activityGroupSearchCriteria.setAdvertiserId(advertiserId);
// Get activity group.
SpotlightActivityGroupRecordSet spotlightActivityGroupRecordSet =
service.getSpotlightActivityGroups(activityGroupSearchCriteria);
// Display activity group names and IDs.
if (spotlightActivityGroupRecordSet.getRecords() != null) {
for (SpotlightActivityGroup result : spotlightActivityGroupRecordSet.getRecords()) {
System.out.println("Activity group with name \"" + result.getName()