Get Offers (Java)
- Topics:
- APIs/SDKs
CREATED FOR:
- Developer
Description
getOffers()
is used to execute a decision and retrieve an experience from Adobe Target.
Method
getOffers
The TargetClient.getOffers
method signature is shown as follows.
Request
TargetDeliveryResponse TargetClient.getOffers(TargetDeliveryRequest request)
TargetDeliveryRequest is created using TargetDeliveryRequest.builder
.
Response
TargetDeliveryRequestBuilder TargetDeliveryRequest.builder()
Parameters
The TargetDeliveryRequestBuilder
object has the following structure:
The values of each field should conform to Target View Delivery API request specification. To learn more about the Target View Delivery API, see http://developers.adobetarget.com/api/#view-delivery-overview
Response
The TargetDeliveryResponse
returned by TargetClient.getOffers(
) has the following structure:
The ResponseStatus
in the response contains the following fields:
The TargetCookie
object used for saving data for user session has the following structure:
You don’t have to worry about expiring the cookies. Target handles maxAge inside the SDK.
Example
Request
ClientConfig clientConfig = ClientConfig.builder()
.client("acmeclient")
.organizationId("1234567890@AdobeOrg")
.build();
TargetClient targetJavaClient = TargetClient.create(clientConfig);
List<MboxRequest> mboxRequests = new ArrayList<>();
mboxRequests.add((MboxRequest) new MboxRequest().name("a1-serverside-ab").index(1));
TargetDeliveryRequest targetDeliveryRequest = TargetDeliveryRequest.builder()
.context(new Context().channel(ChannelType.WEB))
.execute(new ExecuteRequest().setMboxes(mboxRequests))
.build();
Response
TargetDeliveryResponse targetResponse = targetJavaClient.getOffers(targetDeliveryRequest);