// Set the creative IDs to associate with this third party slot.
long[] creativeIds = new long[] {Long.parseLong("INSERT_CREATIVE_ID_HERE")};
// Create the ThirdPartySlot object.
ThirdPartySlot thirdPartySlot = new ThirdPartySlot();
thirdPartySlot.setCompanyId(companyId);
thirdPartySlot.setDescription("Third party slot description.");
thirdPartySlot.setExternalUniqueId(externalUniqueId);
thirdPartySlot.setExternalUniqueName(externalUniqueName);
// Set the creatives that the third party slots will represent.
thirdPartySlot.setCreativeIds(creativeIds);
// Create the third party slot.
thirdPartySlot = thirdPartySlotService.createThirdPartySlot(thirdPartySlot);
if (thirdPartySlot != null) {
System.out.println("A third party slot with ID \"" + thirdPartySlot.getId()
+ "\" and named \"" + thirdPartySlot.getExternalUniqueName() + "\" was created.");
} else {
System.out.println("No third party slot created.");
}
} catch (Exception e) {
e.printStackTrace();