Interface TestandtargetService
TestandtargetService
is the entry point for all the operations which interact with the
Adobe Target API
This service is able to perform operations on both Adobe Target entry points - XML and REST. While care has been taken to make the API backend transparent, to the caller, there are some methods where there are small differences, usually due the XML API providing less information than the REST API. These limitations are clearly documented in the method-level javadocs.
As such, clients of this service are encouraged to use the REST API rather than XML API. This setting is a property on the cloud service configuration and is properly saved by the cloud configuration UI.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Deprecated.static final String
Deprecated.static final String
Deprecated.campaign list operationstatic final String
Deprecated.Widget offer deletion operationstatic final String
Deprecated.folder list operationstatic final String
Deprecated.HTML offer get operationstatic final String
Deprecated.HTML offer list operationstatic final String
Deprecated.static final String
Deprecated.Widget offer save operationstatic final String
Deprecated.Campaign create operationstatic final String
Deprecated.HTML offer save operationstatic final String
Deprecated.save operationstatic final String
Deprecated.Property name authenticationstatic final String
Deprecated.Property name client codestatic final String
Deprecated.Property name E-Mailstatic final String
Deprecated.Property name passwordstatic final String
Deprecated.Property name tenant id -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkCredentials
(String clientcode, String email, String password) Deprecated.long
createHTMLOffer
(Configuration configuration, SaveOfferRequest request) Deprecated.Creates a HTML offervoid
createHTMLOffer
(Configuration configuration, String offerName, String folderId, String content) Deprecated.Creates an HTML offer.createWidgetOffer
(Configuration configuration, String name, String url, String id) Deprecated.getCampaignById
(Configuration configuration, long campaignId, CampaignType campaignType) Deprecated.getCampaignByThirdPartyId
(Configuration configuration, String thirdPartyId, CampaignType campaignType) Deprecated.Retrieves a campaign from Target using the thirdPartyId propertygetHTMLOffer
(Configuration configuration, String offerName) Deprecated.Retrieves a HTML offer from Adobe TargetgetMboxActivityCollisions
(Configuration configuration, String mboxName, String mboxUrl) Deprecated.getPerformanceReport
(Configuration configuration, PerformanceReportRequest request) Deprecated.Retrieves the performance report data for a specific campaigngetPerformanceReport
(Configuration configuration, ReportType reportType, String thirdPartyCampaignId, String campaignId, Date start, Date end, Resolution resolution) Deprecated.Retrieves the performance report data for a specific campaigngetReusableOffer
(Configuration configuration, ViewOfferRequest request) Deprecated.listCampaigns
(Configuration configuration, Date before, Date after, String environment, String name, String state, String label) Deprecated.listFolders
(Configuration configuration) Deprecated.Returns a tree of folders available in Adobe Target.listMboxNames
(Configuration configuration) Deprecated.Get the mboxes list for a given configurationlistOffers
(Configuration configuration, ListOffersRequest request) Deprecated.Returns a list of offers currently registered in TargetlistOffers
(Configuration configuration, String folderId) Deprecated.listSegments
(Configuration configuration, ListSegmentsRequest request) Deprecated.Retrieves a list of segments for the specifiedconfiguration
publishOffer
(Configuration configuration, String name, String url, String id) Deprecated.boolean
setCampaignState
(Configuration configuration, String campaignState, String testAndTargetCampaignId, String thirdPartyCampaignId) Deprecated.Updates the state of the campaign in Adobe Target.unpublishOffer
(Configuration configuration, String name, String url, String id) Deprecated.Deletes a widget offer on Adobe Target.
-
Field Details
-
OPERATION_FOLDER_LIST
Deprecated.folder list operation- See Also:
-
OPERATION_CAMPAIGN_LIST
Deprecated.campaign list operation- See Also:
-
OPERATION_SAVE_HTML_OFFER
Deprecated.HTML offer save operation- See Also:
-
OPERATION_GET_HTML_OFFER
Deprecated.HTML offer get operation- See Also:
-
OPERATION_HTML_OFFER_LIST
Deprecated.HTML offer list operation- See Also:
-
OPERATION_DELETE
Deprecated.Widget offer deletion operation- See Also:
-
OPERATION_SAVE
Deprecated.Widget offer save operation- See Also:
-
OPERATION_SET_CAMPAIGN_STATE
Deprecated.save operation- See Also:
-
OPERATION_SAVE_CAMPAIGN
Deprecated.Campaign create operation- See Also:
-
OPERATION_REPORT
Deprecated.- See Also:
-
PN_EMAIL
Deprecated.Property name E-Mail- See Also:
-
PN_PASSWORD
Deprecated.Property name password- See Also:
-
CAMPAIGN_STATE_APPROVED
Deprecated.- See Also:
-
CAMPAIGN_STATE_DEACTIVATED
Deprecated.- See Also:
-
PN_CLIENTCODE
Deprecated.Property name client code- See Also:
-
PN_TENANTID
Deprecated.Property name tenant id- See Also:
-
PN_AUTHENTICATION
Deprecated.Property name authentication- See Also:
-
-
Method Details
-
listFolders
Deprecated.Returns a tree of folders available in Adobe Target. Folders are not supported when using REST API.- Parameters:
configuration
- ServiceConfiguration
- Returns:
- The tree of folders available in Adobe Target. This method returns <code>null</code> when using Adobe Target REST API
- Throws:
TestandtargetException
-TestandtargetException
on all errors
-
publishOffer
@Deprecated String publishOffer(Configuration configuration, String name, String url, String id) throws TestandtargetException Deprecated.Creates a widget offer on Adobe Target.- Parameters:
configuration
- ServiceConfiguration
name
- Name of the widget offerurl
- The encoded URL of the third-party server that hosts the dynamically generated responseid
- The third-party ID of the widget offer- Returns:
- A string representation of the third-party id
- Throws:
TestandtargetException
-TestandtargetException
on all errors
-
unpublishOffer
String unpublishOffer(Configuration configuration, String name, String url, String id) throws TestandtargetException Deprecated.Deletes a widget offer on Adobe Target.- Parameters:
configuration
- ServiceConfiguration
name
- Name of the widget offerurl
- The encoded URL of the third-party server that hosts the dynamically generated responseid
- The third-party ID of the widget offer- Returns:
- A string representation of the third-party id
- Throws:
TestandtargetException
-TestandtargetException
on all errors
-
createWidgetOffer
@Deprecated String createWidgetOffer(Configuration configuration, String name, String url, String id) throws TestandtargetException Deprecated.Creates a widget offer.- Parameters:
configuration
- ServiceConfiguration
name
- Name of the widget offerurl
- The encoded URL of the third-party server that hosts the dynamically generated responseid
- The third-party ID of the widget offer- Returns:
- A string representation of the third-party id
- Throws:
TestandtargetException
-TestandtargetException
on all errors
-
createHTMLOffer
void createHTMLOffer(Configuration configuration, String offerName, String folderId, String content) throws TestandtargetException Deprecated.Creates an HTML offer.- Parameters:
configuration
- ServiceConfiguration
offerName
- Name of the offerfolderId
- Folder idcontent
- Offer content as plain HTML.- Throws:
TestandtargetException
-TestandtargetException
on all errors
-
createHTMLOffer
long createHTMLOffer(Configuration configuration, SaveOfferRequest request) throws TestandtargetException Deprecated.Creates a HTML offer- Parameters:
configuration
- the cloud-service configurationrequest
- aSaveOfferRequest
object containing the operation's details, such as the offer data. This object may be incomplete, i.e. just contain the essential data for creating an offer - name and content- Returns:
- the offer id, as set by Adobe Target. If the XML API is used this method return -1
- Throws:
TestandtargetException
-TestandtargetException
on all errors
-
getHTMLOffer
Deprecated.Retrieves a HTML offer from Adobe Target- Parameters:
configuration
- ServiceConfiguration
offerName
- Name of the offer- Returns:
- An HTMLOffer
- Throws:
TestandtargetException
-TestandtargetException
on all errors
-
getReusableOffer
@Deprecated ViewOfferResponse getReusableOffer(Configuration configuration, ViewOfferRequest request) throws TestandtargetException Deprecated.Retrieves an offer from Adobe Target- Parameters:
configuration
- the cloud services configuration for the Adobe Target accountrequest
- aViewOfferRequest
object containing the request data- Returns:
- a
ViewOfferResponse
object containing the offer's data - Throws:
TestandtargetException
-TestandtargetException
on all errors
-
listOffers
@Deprecated Collection<Offer> listOffers(Configuration configuration, String folderId) throws TestandtargetException Deprecated.Returns a JSON representation of offers.- Parameters:
configuration
- ServiceConfiguration
folderId
- Folder id- Returns:
- An
Collection
ofOffer
objects - Throws:
TestandtargetException
-TestandtargetException
on all errors
-
listOffers
Collection<ViewOfferResponse> listOffers(Configuration configuration, ListOffersRequest request) throws TestandtargetException Deprecated.Returns a list of offers currently registered in Target- Parameters:
configuration
- a reference to the serviceConfiguration
request
- aListOffersRequest
object containing the request details- Returns:
- a collection of
ViewOfferResponse
objects. - Throws:
TestandtargetException
-TestandtargetException
on all errors
-
listCampaigns
@Deprecated Map<Integer,String> listCampaigns(Configuration configuration, Date before, Date after, String environment, String name, String state, String label) throws TestandtargetException Deprecated.Returns aMap
with campaigns. The Map key contains the campaign ID and the Map value the campaign name.- Parameters:
configuration
- ServiceConfiguration
before
- A date value. Includes campaigns that were active at least once before the specified date. By default, the before parameter is 2100-01-01T00:00.after
- A date value. Includes campaigns that were active at least once after the specified date. By default, the after parameter is 1969-00-00T00:00.environment
- A URL-encoded host group name, as defined in the T&T Tool. By default, the environment value is Production.name
- The campaign name, or portion of the campaign name, that you want to match.state
- Comma-separated list of states to match. Supported values include: saved, activated, library. By default, the filtered results include all states.label
- Comma-separated list of labels to match. By default, the filtered results include all labels.- Returns:
- Map of campaigns
- Throws:
TestandtargetException
-TestandtargetException
on all errors
-
setCampaignState
boolean setCampaignState(Configuration configuration, String campaignState, String testAndTargetCampaignId, String thirdPartyCampaignId) throws TestandtargetException Deprecated.Updates the state of the campaign in Adobe Target.- Parameters:
configuration
- ServiceConfiguration
campaignState
- The campaign state , one ofCAMPAIGN_STATE_APPROVED
orCAMPAIGN_STATE_DEACTIVATED
testAndTargetCampaignId
- The campaign identifier. You must provide either testAndTargetCampaignId or thirdPartyCampaignIdthirdPartyCampaignId
- The third-party campaign identifier. You must provide either testAndTargetCampaignId or thirdPartyCampaignId- Returns:
- true if the operation succeeded
- Throws:
TestandtargetException
-TestandtargetException
on all errors
-
checkCredentials
void checkCredentials(String clientcode, String email, String password) throws TestandtargetException Deprecated.- Throws:
TestandtargetException
-
getPerformanceReport
Reports getPerformanceReport(Configuration configuration, ReportType reportType, String thirdPartyCampaignId, String campaignId, Date start, Date end, Resolution resolution) throws TestandtargetException Deprecated.Retrieves the performance report data for a specific campaignAll parameters are mandatory, except for
campaignId
andthirdPartyId
, out of which exactly one must be specified.- Parameters:
configuration
- the cloud services configuration associated with the Adobe Target accountreportType
- aReportType
object representing the type of reportthirdPartyCampaignId
- the third party id of the campaigncampaignId
- the id of the campaign, as defined in Adobe Targetstart
- the start date of the campaign (used as report filter)end
- the end date of the campaign (used as a report filter)resolution
- the campaign's resolution (hour, day etc.)- Returns:
- performance report data for a specific campaign
- Throws:
TestandtargetException
-TestandtargetException
on all errors- See Also:
-
getPerformanceReport
PerformanceReport getPerformanceReport(Configuration configuration, PerformanceReportRequest request) throws TestandtargetException Deprecated.Retrieves the performance report data for a specific campaignThe data returned by this method always returns visits for the
PerformanceReportItem.getEntryCount()
methodNote that it is recommended that the
request
is configured with a campaign id rather than a third party id. The reason is that when using the REST API an additional call is performed to map the third party id to a campaign id.- Parameters:
configuration
- the cloud services configuration associated with the Adobe Target accountrequest
- the request object holding all data needed to retrieve the performance data- Returns:
- the performance report data, never
null
- Throws:
TestandtargetException
-TestandtargetException
on all errors
-
listSegments
List<Segment> listSegments(Configuration configuration, ListSegmentsRequest request) throws TestandtargetException Deprecated.Retrieves a list of segments for the specifiedconfiguration
Optional filtering parameters may be set in the
request
parameter.- Parameters:
configuration
- ServiceConfiguration
request
- optional request parameters. May be null.- Returns:
- a list of segments, possibly empty, never
null
- Throws:
TestandtargetException
-TestandtargetException
on all errors
-
getMboxActivityCollisions
@Deprecated List<String> getMboxActivityCollisions(Configuration configuration, String mboxName, String mboxUrl) throws TestandtargetException Deprecated.Detects the usage of an mbox in multiple activities- Parameters:
configuration
- a reference to the Cloud Service configurationmboxName
- the name of the mboxmboxUrl
- the URL of the mbox. "http://localhost" is accepted- Returns:
- a list of campaign names which reference the specified mbox. The return value can be empty, which signals that there are no collisions. It can also be
null
, which signals that there is no information about collisions - Throws:
TestandtargetException
-TestandtargetException
on all errors
-
listMboxNames
Deprecated.Get the mboxes list for a given configuration- Parameters:
configuration
- a reference to the Cloud Service configuration- Returns:
- a list of mbox names. The list can be empty if no mboxes are available for the received configuration
- Throws:
TestandtargetException
-TestandtargetException
on all errors
-
getCampaignByThirdPartyId
Campaign getCampaignByThirdPartyId(Configuration configuration, String thirdPartyId, CampaignType campaignType) throws TestandtargetException Deprecated.Retrieves a campaign from Target using the thirdPartyId property- Parameters:
configuration
- theConfiguration
associated with the Target accountthirdPartyId
- the thirdPartyId of the campaigncampaignType
- the type of the campaign -landingPage
orab
- Returns:
- a
Campaign
object ornull
if the campaign cannot be found in Target - Throws:
TestandtargetException
-TestandtargetException
on all errors
-
getCampaignById
@Deprecated Campaign getCampaignById(Configuration configuration, long campaignId, CampaignType campaignType) throws TestandtargetException Deprecated.Retrieves a campaign from Target using the id property- Parameters:
configuration
- theConfiguration
associated with the Target accountcampaignId
- the id of the campaign, as received from Target during a previous updatecampaignType
- the type of the campaign -landingPage
orab
- Returns:
- a
Campaign
ornull
if the campaign cannot be found in Target - Throws:
TestandtargetException
-TestandtargetException
on all errors
-