Target API Reference: Adobe Marketing Cloud

Download as pdf or txt
Download as pdf or txt
You are on page 1of 41

Adobe Marketing Cloud

Target API Reference

Contents
Target API..........................................................................................................................3
Overview...............................................................................................................................................................................3
Methods................................................................................................................................................................................3
Audit Report..................................................................................................................................................................................................4
Bulk Profile Update.....................................................................................................................................................................................5
Campaign Copy...........................................................................................................................................................................................7
Campaign Create/Update........................................................................................................................................................................8
Campaign List............................................................................................................................................................................................18
Campaign State.........................................................................................................................................................................................20
Campaign View..........................................................................................................................................................................................21
Folder List....................................................................................................................................................................................................24
Get Host Groups........................................................................................................................................................................................25
Landing Page Tool....................................................................................................................................................................................26
Offer Create.................................................................................................................................................................................................27
Offer Get.......................................................................................................................................................................................................28
Offer List.......................................................................................................................................................................................................29
1:1 Content Report...................................................................................................................................................................................30
Performance Report.................................................................................................................................................................................33
Profile Passing & Offline Conversion..................................................................................................................................................37
Third-Party Campaign ID........................................................................................................................................................................39
Widget Offer Creation.............................................................................................................................................................................40

Last updated 9/25/2013

Target API Reference

Test&Target API

Test&Target API
The Test&Target APIs provide programmatic access to Test&Target (T&T) reporting features and profiles.

Overview
The Test&Target API lets you programmatically retrieve data for your Test&Target campaigns.
Test&Target supports the REST interface only. SOAP is not supported.
3.2
January 31, 2012
Updated API
Campaign Create/Update

Campaign View
Campaign List

Campaign State
Offer Get
Offer Create

Description
Enabled existing campaigns to be saved using the campaign ID instead of a
third-party ID.
Added campaign-level targeting to the response (version 3).
Added campaign start/end date, status, third-party campaign IDs, and labels to the
response.
Added a Deleted state that enables campaign deletion.
Added the offer ID to the response (version 2).
Added the offer ID to the response (version 2).

3.1
Added version 2 of the Campaign View that adds campaign segment information to the response.
The following APIs are now available:
Campaign Create/Update
Folder List
Offer Create
Offer Get
Offer List
See the description for each API for details.

Methods
Test&Target API Methods
Use the links on the left to view reference information for the Test&Target methods.

Test&Target API

Audit Report
The Campaign Audit Report API lets you programmatically extract audit report data for a single campaign.
You can retrieve audit report data for off-line analysis, permanent storage, or to build a custom reporting interface.
Note: T&T stores audit data for 4 weeks only. To preserve it, use the Campaign Audit Report API or the Admin interface
to store it in a secondary location.
Create the URL
For each operation add the parameters and values you need as a filter. For example:
https://testandtarget.omniture.com/api?client=acme&[email protected]&
password=mypassword&operation=auditReport&campaignId=1234&start=2007-08-01T00:00&
end=2007-09-01T00:00&step=step1&environment=production&format=csv&version=1

Parameter
client
email
password
operation

campaignId

start

en

step

environment

Description
(Required) The T&T client code.
(Required) The Email address associated with the T&T user performing the operation.
(Required) The T&T password associated with the specified email address.
(Required) Identifies the type of T&T action to execute. To generate audit reports, this value is always
auditReport.
(Required) The ID of the campaign you want to query. To identify the Campaign List ID, Use the
Campaign List API or look at the campaignDescriptionId parameter in the URL when
viewing a campaign in the T&T Tool.
(Required) The report start date and time. Specify the date using the following format:
YYYY-MM-DDTHH:mm. The performance report uses the time zone setting specified in the Web
browser.
(Required) The report end date and time. Specify the date using the following format:
YYYY-MM-DDTHH:mm. The performance report uses the time zone setting specified in the Web
browser.
(Optional) The URL-encoded success metric name (formerly called a step). By default, the step value
is last step.
(Required) A URL-encoded host group name, as defined in the T&T Tool. By default, the environment
value is Production.

Test&Target API

Parameter
format

version

Description
(Optional) The report output format. Currently, the only supported value for this parameter is csv
(comma-separated value).
Specify which version of the API you want to use. Set this to version=1 unless there is a different
version described in the documentation.

Note: Parameters and values are case sensitive.


Inspect the Query Response
T&T generates the audit report in CSV format, which you can import into any spreadsheet program, such as Microsoft* Excel*.
For example:
"Campaign: landing campaign RFM"
"Downloaded at: 2007-08-24. Time zone: EST5EDT"
"Step: Conversion"
"Campaign Id","Recipe","Order Date","Order Time","Order
Ids"

Id","Amount","Order Flag","Product

"worst",""
42,81,"2007-08-20","17:25:29","1187645128929",$429.00,"---","9"
42,81,"2007-08-20","17:25:36","1187645135874",$319.00,"---","7"
42,81,"2007-08-20","17:25:43","1187645142834",$325.00,"---","5"
"best",""
42,82,"2007-08-20","16:56:11","1187643370833",$325.00,"---","5"
42,82,"2007-08-20","16:56:16","1187643376266",$479.00,"---","3"
42,82,"2007-08-20","16:58:15","1187643495634",$99.95,"---","42"

Parse the Query Response


Optionally, you can use a scripting language, such as Perl, Python, and Ruby, to programmatically manipulate the audit report
contents to create custom reports.

Bulk Profile Update


The Bulk Profile Update API lets you batch profile update requests.
Using Bulk Profile Update
1. Create a batch file like the following example:
batch=pcId, param1, param2, param3
1000000000000-100000.01, value1, value2, valueeeeeee
1000000000000-100000.01, value1, value3, valueeeeeee
1367320065048-801944.01_00, value1, value6, valueeeeeee
1000000000000-100000.01, value1, value6, valueeeeeee

2. curl -X POST --data-binary @batch http://mboxedge/m2/demo/profile/batchUpdate


Create the URL
For each operation add the parameters and values necessary to batch profile updates in a T&T campaign.

Test&Target API

Note: This is a SOAP API and not a REST API like the other Target APIs.
For example, use the following URL, substituting the appropriate value for each of the URL parameters:
https://client.tt.omtrdc.net/m2/client/profile/batchUpdate

Parameter
batch

Description
(Required) batch content sent in the POST content as "batch" parameter. The request should be a
POST. A batch is composed of the batch header followed by data. For example:
pcId, param1, param2, param3, param4
123, value1
124, value1,,,value4
125,,value2
126,value1,value2,value3,value4

Notes
Params and values must be URL-encoded using UTF-8
Param format is paramName only (it is not the current format: profile.paramName).
Not all parameter values need to exist for all pcIds.
ThirdPartyId is not supported.
Batch size is limited to 500k

Note: Parameters and values are case sensitive.


Inspect the Query Response
A response of <success>true</success> indicates a successful operation. T&T also returns a URL that clients can use to
retrieve the status of the batch and a message:
<response>
<success>true/false</success>
<batchStatus>http://mboxedge3.tt.omtrdc.net/demo/profile/batchStatus?batchId=demo-1234&mboxPC=0000000000000-000000.03_05</batchStatus>
<message>Error or success message</message>
</response>

success: status of the request, true or false.


batchStatus: URL where the batch status can be retrieved. If the success value is false, batchStatus is empty.
message: additional information regarding the status.
Batch Status
For each client, only the previous 10 statuses are stored, for a maximum of 24 hours.
The status response appears as follows:
<response>
<batchId>ID</batchId>
<status>incomplete or complete</status>
<batchSize>number of updates in the batch</batchSize>
<successfulUpdates>number of profiles that were updated</successfulUpdates>
<profilesNotFound> number of profiles that were not found</profilesNotFound>

Test&Target API

<failedUpdates>number of profiles that failed to update for some reason</failedUpdates>


</response>

Campaign Copy
The Campaign Copy API lets you create a new T&T campaign based on an existing source campaign.
Create the URL
For each operation add the parameters and values necessary to copy a T&T campaign. For example, use the following URL to
copy a T&T campaign, substituting the appropriate value for each of the URL parameters:
https://testandtarget.omniture.com/api?client=user&[email protected]
&password=pword&operation=copyCampaign&id=123&
thirdPartyId=extID501&new3rdPartyId=extID995&branch=2&segment=3&
action=approve&name=Name&version=1

Parameter
client
email
password
operation

id

thirdpartyId

new3rdPartyId

branch

segment

action

Description
(Required) The T&T client code.
(Required) The Email address associated with the T&T user performing the operation.
(Required) The T&T password associated with the specified email address.
(Required) Identifies the type of T&T action to execute. To change a T&T campaign state, this value
is always copyCampaign.
(Optional) The campaign ID of the campaign you want to copy. You must provide either id or
thirdPartyId to identify the source campaign.
(Optional) The third-party identifier associated with the source campaign. You must provide either
id or thirdPartyId to identify the source campaign.
(Optional) A third-party identifier to associate with the source campaign. If not provided, no
third-party ID is associated with the new campaign. If this value is the same as thirdPartyId, the
source campaign thirdPartyId is set to NULL.
(Optional) A comma-separated list of branch IDs to copy to the new campaign. If no list is specified,
all campaign branches are copied to the new campaign.
(Optional) The segment to promote as entry targeting conditions to add to the current list of campaign
entry conditions. If no segment is specified, the new campaign uses the same entry conditions as the
source campaign and copies all segments to the new campaign.
(Optional) When set to approve, T&T activates the new campaign and deactivates the source
campaign. Otherwise, T&T creates the new campaign but does not activate it; leaving the source
campaign active.

Test&Target API

Parameter
name

version

Description
The name of the new campaign. If not specified, the new campaign name is the name of the source
campaign with "(copy)" appended to the end of the name. For example, "campaign1" becomes
"campaign1 (copy)".
Specify which version of the API you want to use. Set this to version=1 unless there is a different
version described in the documentation.

Note: Parameters and values are case sensitive.


Inspect the Query Response
A response of 200 indicates a successful operation. T&T also returns the following information about the new campaign:
<campaign>
<id>newCampaignID</id>
<thirdPartyId>new3rdPartyID</thirdPartyId> //if defined
</campaign>

Campaign Create/Update
The Campaign Create API lets you create and update AB..N campaigns, landing page campaigns and optimizing campaigns
(optimized to RPV/AOV/Conversion Rate). You can add experiences, targets, and mboxes to the campaign during creation.
The Campaign Create API can also be used to update an existing campaign.
Notes
Monitoring Campaigns cannot be created using API.
Use the Campaign State API to change campaign state.
Create the URL
For each operation add the parameters and values necessary to create a T&T campaign. For example, use the following URL
substituting the appropriate value for each of the URL parameters:
https://testandtarget.omniture.com/api?client=user&[email protected]
&password=pword&version=1&operation=saveCampaign&thirdPartyId=extID501&version=1&campaign=<XML
HERE>

Parameter
client
email
password
operation

Description
(Required) The T&T client code.
(Required) The Email address associated with the T&T user performing the operation.
(Required) The T&T password associated with the specified email address.
(Required) Identifies the type of T&T action to execute. To create or update a T&T campaign, this
value is always saveCampaign.

Test&Target API

Parameter
campaignId

Description
(optional for create, either campaignId or thirdPartyId required for update) Without this parameter
present in the URL, a new campaign is created and assigned a campaignId. Otherwise, if a value is
present, it tries to find a campaign that has a matching, non-null campaignId and if found, updates
it.
If a valid campaignId and a valid thirdPartyId are both included, the thirdPartyId takes precedence.

thirdPartyId

(optional for create, either campaignId or thirdPartyId required for update) Without this parameter
present in the URL, a new campaign is created with a NULL thirdPartyId. Otherwise, if a value for
thirdPartyId is present, it tries to find a campaign that has a matching, non-null thirdPartyId and if
found, updates it. If a thirdPartyId is present in the URL, but no matching campaign is found, a new
campaign is created with the proper thirdPartyId value.
it is also possible to specify thirdPartyId in the campaign XML itself. After the campaign has been
created this way, it can then be updated subsequently by specifying the thirdPartyId parameter in
the URL to refer to this campaign.

oldBranchName

optimizingMetric

version

campaign

(Optional) Provide the old experience name when renaming an experience. "Branch" refers to
experience in this API.
(Optional) valid values are RPV, AOV, Conversion Rate (case sensitive). Including this
parameter/value creates an optimizing campaign rather than an A/B campaign.
Specify which version of the API you want to use. Set this to version=1 unless there is a different
version described in the documentation.
(required, UTF-8 URL-encoded XML): XML that defines the campaign.
Keep in mind the size of campaign XML; otherwise, a HTTP 414 (Request URI too long) will occur.
// To create the campaign:
<campaign>
<name>REST ABN Campaign (four branches with segments II)</name>
<thirdPartyId>adobeID</thirdPartyId>
<branches>
<branch>
...

A complete xml example is located in at the bottom of this article in the Demo Campaign XML
section.

Note: Parameters and values are case sensitive.


Query Response
A response of 200 indicates a successful operation. T&T also returns the following information about the new campaign:

Test&Target API

10

Create:
<?xml version="1.0" encoding="UTF-8"?>
<campaign-create><result>createdsuccess</result><id>21</id></campaign-create>

Update:
<?xml version="1.0" encoding="UTF-8"?>
<campaign-create><result>updatedsuccess</result><id>21</id></campaign-create>

Update a Campaign
To update an existing campaign, the URL is specified in the same format as described in Create the URL. However, instead of
providing a new thirdPartyId, you provide the thirdPartyId of the campaign that you want to update. Make sure that
the value of thirdPartyId parameter matches the one of the stored campaign you are trying to update; otherwise, a new
campaign is created instead.
You can update the following parts of a campaign:
Campaign name
Add/Delete target(s)
Rename URL parameter target name
Add/Delete experience(s)
Rename experience name (parameter 'oldBranchName' MUST be present in URL)
Add/Delete mbox(es) (you need to specify offers for the new mbox, otherwise you'll get a 404 error: 'You have mboxes with
no offers, please assign an offer for each mbox')
Rename mbox name
Add/Delete segments
Rename segments
Specify Campaign Type
By default the Campaign create API creates an A/B campaign. You can also specify a landing page instead by adding a <type>
parameter after <campaign>.
campaign><algorithm><type>Landing Page</type></algorithm>
<name>My campaign name</name>

Specify Start and End Dates and Times


You can specify start and end dates as follows, as children of the <campaign> root element:
<start>2012-03-20</start>
<end>2012-03-24</end>

The date format is yyyy-MM-dd without a timestamp. You can specify no set start and end date as follows:
<start>When Approved</start>
<end>When Deactivated</end>

If you do not provide a start or end date, the start date is set to the current date, and the end date is set to the current date plus
one month.
You can also set the time when the campaign starts or ends on the specified dates:
<start>2013-07-05T04:00</start>
<end>2013-08-05T16:00</end>

Test&Target API

Specify Percentage Targeting


You can specify percentage targeting as follows:
<branches>
<branch>
<name>Experience A</name>
<description/>
<percentConstraint>
<percent>30</percent>
</percentConstraint>
</branch>
</branches>

Specify Priority
The priority can be set as a child of the <campaign> root element:
<priority>High</priority>

Possible values are:


Monitoring
Low
Medium
High
Experience Impression Capping
Sets the number of impressions or visits that must be met before the specified action is exercised.
You can specify the following for all campaign experiences at the action level or they could be specified for every campaign
experience separately:
Visit count
Impression count
Action
The new step action will not currently be displayed in Campaign Edit UI.
If a campaign that has a step with experienceFrequencyCapping action set is edited the action should be preserved for step
(unless step was deleted etc)
The following XML snippet is used in campaign save action REST API for adding a step with an action:
<step>
<name>Success Metric 1</name>
<action type="countOnce"/>
<locations><location><mboxes><mbox><name>categoryPage</name></mbox></mboxes>
</location></locations>
</step>
action can contain one of the following types:

countOnce (default): count once


countLandings: Count landings, or clicks
alwaysConvert: always convert
restartSameExperience (default for conversion step): restart with the same experience
restartRandomExperience: restart with a different experience
restartNewExperience: restart with a new experience

11

Test&Target API

12

excludeSameExperience: do not count the same experience


excludeDefaultContent: do not count default content
In addition, for impression capping, use the experienceFrequencyCapping step action.
You can set additional data for the experienceFrequencyCapping action:
<step>
<name>Success Metric 1</name>
<action type="experienceFrequencyCapping" maxVisitsCount='2' maxImpressionsCount='8'
onConditionsMetAction='ban'/>
<locations><location><mboxes><mbox><name>categoryPage</name></mbox></mboxes>
</location></locations>
</step>
onConditionsMetAction can be either:

ban: bans the user from the experience he is on if has reached either 2 visits or 8 impressions (does not matter what condition
was reached first). After reaching the cap, the user remains on the current experience in the campaign, but on the visit of the
entry step, the user is banned from the current experience and whether another experience can be selected is evaluated, excluding
the experiences where the visitor has reached the cap (or, was banned from).
reset: resets all current capping information for a user. All previous cap information is deleted.
Either maxVisitsCount or maxImpressionsCount must be present.
<step>
<name>Success Metric 1</name>
<action type="experienceFrequencyCapping" maxVisitsCount='2' maxImpressionsCount='8'
onConditionsMetAction='ban'>
<experience
name="Experience A" maxVisitsCount='3' maxImpressionsCount='10' onConditionsMetAction='reset'
/>
<experience name="Experience B"
maxVisitsCount='3' maxImpressionsCount='10' onConditionsMetAction='ban' />
</action>
<locations><location><mboxes><mbox><name>categoryPage</name></mbox></mboxes>
</location></locations>
</step>

If the impression capping is not provided for all campaign experiences, the impression capping provided at the action level is
used.
If the campaign is edited within the Target interface and a new branch is added, the branch automatically uses the impression
capping set at the action level.
Limiting Changes and Visibility
Campaigns created in Recommendations are visible in Target but are not editable. Allowing editing would create synchronization
issues with their origin and any updates made in Recommendations override the changes made in Target.
Recommendations campaigns are hidden by adding the parameter editUrl=hidden to the campaign create API. For example:
https://admin/admin/api?client=demo&[email protected]&password=demo&operation=saveCampaign&version=1&editUrl=hidden&campaign=XMLHERE

You can also make a campaign read-only with the editUrl=readonly parameter. The details for the campaign can be viewed,
but the edit page is not editable. Everyone is essentially a read-only user when viewing the campaign. Campaigns saved via the

Test&Target API

13

API with editUrl=readonly can't be saved in the admin UI, but can be updated using the API. Read-only campaigns can be
deleted, and campaign states can be changed.
Demo Campaign XML
Notes
Experience name is limited to 20 characters.
To set an offer to display the default content, pass Default Content.
<offer>
<name>Default Content</name>
</offer>

If you want your mbox to display the default content, you must pass a string of DefaultContent (whatever is in the mbox div)
At least one branch is required.
Each experience must include the same mboxes.
Each offer listed must be already created. Use Offer Create to create new offers.
<campaign>
<name>REST ABN Campaign (four branches, two segments and thirdPartyId, with campaign level
targeting)</name>
<thirdPartyId>adobeID</thirdPartyId>
<priority>High</priority>
<start>2012-03-20</start>
<end>2012-03-24</end>
<branches>
<branch> <!-- at least one branch is required -->
<name>Experience A</name> <!-- 20 character limit -->
<description/>
<percentConstraint>
<percent>30</percent>
</percentConstraint>
<paramConstraints>
<paramConstraint>
<parameterType>URL</parameterType>
<name>ad</name>
<matcherType>equalsIgnoreCase</matcherType>
<values>
<string>a</string>
</values>
</paramConstraint>

Test&Target API

</paramConstraints>
</branch>
<branch>
<name>Experience B</name>
<description/>
<paramConstraints>
<paramConstraint>
<parameterType>URL</parameterType>
<name>ad</name>
<matcherType>equalsIgnoreCase</matcherType>
<values>
<string>b</string>
</values>
</paramConstraint>
</paramConstraints>
</branch>
<branch>
<name>Experience C</name>
<description/>
<paramConstraints>
<paramConstraint>
<parameterType>URL</parameterType>
<name>ad</name>
<matcherType>equalsIgnoreCase</matcherType>
<values>
<string>c</string>
</values>
</paramConstraint>
</paramConstraints>
</branch>
<branch>
<name>Experience D</name>
<description/>
<paramConstraints>
<paramConstraint>

14

Test&Target API

<parameterType>URL</parameterType>
<name>ad</name>
<matcherType>equalsIgnoreCase</matcherType>
<values>
<string>d</string>
</values>
</paramConstraint>
</paramConstraints>
</branch>
</branches>
<steps>
<step>
<type>entry</type>
<locations>
<location>
<mboxes>
<mbox>
<name>* display mboxes *</name>
<paramConstraints>
<paramConstraint>
<parameterType>URL</parameterType>
<name>myURLParam</name>
<matcherType>paramPresent</matcherType>
</paramConstraint>
</paramConstraints>
</mbox>
</mboxes>
</location>
</locations>
</step>
<step>
<type>display</type>
<locations>
<location>

15

Test&Target API

<mboxes>
<mbox>
<name>homePageHero</name>
</mbox>
</mboxes>
<displays>
<display>
<branch>Experience A</branch>
<offers>
<offer>
<name>Homepage Hero Number 2 - Stored outside Offermatica</name> <!--required -->
</offer>
</offers>
</display>
<display>
<branch>Experience B</branch>
<offers>
<offer>
<name>Homepage Hero Number 3 - Stored outside Offermatica</name>
</offer>
</offers>
</display>
<display>
<branch>Experience C</branch>
<offers>
<offer>
<name>Logo Number 2 - HTML and Image</name>
</offer>
</offers>
</display>
<display>
<branch>Experience D</branch>
<offers>
<offer>
<name>Flash Movie - Stored outside Offermatica</name>

16

Test&Target API

</offer>
</offers>
</display>
</displays>
</location>
</locations>
</step>
<step>
<name>Conversion</name>
<type>conversion</type>
<locations>
<location>
<mboxes>
<mbox>
<name>orderConfirmPage</name>
</mbox>
</mboxes>
</location>
</locations>
</step>
</steps>
<segments>
<segment>
<stepName>entry</stepName>
<name>Segment 1</name>
<paramConstraints>
<paramConstraint>
<parameterType>URL</parameterType>
<name>abc</name>
<matcherType>equalsIgnoreCase</matcherType>
<values>
<string>c</string>
</values>
</paramConstraint>

17

Test&Target API

18

</paramConstraints>
</segment>
<segment>
<stepName>entry</stepName>
<name>Segment 2</name>
<paramConstraints>
<paramConstraint>
<parameterType>URL</parameterType>
<name>def</name>
<matcherType>equalsIgnoreCase</matcherType>
<values>
<string>test</string>
</values>
</paramConstraint>
</paramConstraints>
</segment>
</segments>
</campaign>

Campaign List
The Campaign List API lets you programmatically define filters (based on time, state, etc.) that extract campaign names and
identifiers.
Create the URL
For each operation add the parameters and values you need as a filter. For example:
https://testandtarget.omniture.com/api?client=acme&[email protected]
&password=mypassword&operation=campaignList&environment=testEnvironment&name=test&
state=saved,activated&labels=label1,library,label2&version=1

Parameter
client
email
password
operation

Description
(Required) The T&T client code.
(Required) The Email address associated with the T&T user performing the operation.
(Required) The T&T password associated with the specified email address.
(Required) Identifies the type of T&T action to execute. To generate campaign list reports, this value
is always campaignList.

Test&Target API

Parameter
environment

name
state

19

Description
(Optional) A URL-encoded host group name, as defined in the T&T Tool. By default, the environment
value is Production.
(Optional) The campaign name, or portion of the campaign name, that you want to match.
(Optional) Comma-separated list of states to match. Supported values include: saved, activated,
library. By default, the filtered results include all states.

labels
version

(Optional) Comma-separated list of labels to match. By default, the filtered results include all labels.
Specify which version of the API you want to use. Set this to version=1 unless there is a different
version described in the documentation.

Note: Parameters and values are case sensitive.


Inspect the Query Response
A successful query response uses the following XML structure:
<campaigns>
<campaign>
<id>16</id>
<name>Test Campaign A</name>
</campaign>
<campaign>
<id>17</id>
<name>Test Campaign B</name>
</campaign>
</campaigns>

Tag
campaign
id
name

Description
A single campaign.
The campaign identifier. Use this value with the Campaign Performance Report API.
The campaign name you specified.

A failed query response uses the following XML structure:


<error>
<message>Invalid email or password supplied. Email: [email protected]</message>
<code>401</code>
</error>

Tag
message

Description
A description of the error. For example:

Test&Target API

Tag

20

Description
Invalid email or password supplied. Email: [email protected].

code

The error code. For example: 401

Parse the Query Response


Optionally, you can use a scripting language, such as Perl, Python, and Ruby, and the Campaign Performance Report API to
iterate through the query result and retrieve specific campaign detail reports.

Campaign State
The Campaign State API lets you change the state of an existing T&T campaign.
Create the URL
For each operation add the parameters and values necessary to set the state of the T&T campaign. For example:
https://testandtarget.omniture.com/api?client=user&[email protected]
&password=pword&operation=setCampaignState&state=Deactivated&
campaignId=cam29034&thirdPartyId=extID501>&version=1

Parameter
client
email
password
operation

state

Description
(Required) The T&T client code.
(Required) The Email address associated with the T&T user performing the operation.
(Required) The T&T password associated with the specified email address.
(Required) Identifies the type of T&T action to execute. To change a T&T campaign state, this value
is always setCampaignState.
(Required) The campaign state. Supported values include Approved, Deactivated, Deleted, and
Archive.

campaignId

thirdpartyId

version

(Optional) The campaign ID of the campaign you want to modify. You must provide either
campaignId or thirdPartyId.
(Optional) The third-party identifier associated with the campaign you want to modify. You must
provide either campaignId or thirdPartyId
Specify which version of the API you want to use. Set this to version=1 unless there is a different
version described in the documentation.

Note: Parameters and values are case sensitive.

Test&Target API

21

Inspect the Query Response


The response to the request alerts you to the success of the operation. For example:
<success>Campaign [7] state set to [Approved]</success>

Campaign View
The Campaign View API returns an XML "view" of the specified T&T campaign.
Create the URL
For each operation add the parameters and values necessary to copy the T&T campaign. For example:
https://testandtarget.omniture.com/api?client=user1&[email protected]
&password=pword&operation=viewCampaign&id=intID995&thirdPartyId=extID501&version=3

Parameter
client
email
password
operation

id

Description
(Required) The T&T client code.
(Required) The Email address associated with the T&T user performing the operation.
(Required) The T&T password associated with the specified email address.
(Required) Identifies the type of T&T action to execute. To view a campaign, this value is always
viewCampaign.
(Optional) The campaign ID of the campaign you want to view. You must provide either id or
thirdPartyId.

thirdpartyId

version

(Optional) The third-party identifier associated with the campaign you want to modify. You must
provide either id or thirdPartyId
Specify which version of the API you want to use. Set to one of the following:
version=1 to return the campaign without segment information or campaign-level targeting.
version=2 to return the campaign with segment information but without campaign-level targeting.
version=3 to return the campaign with segment information and campaign-level targeting.
version=6 to display the on step actions using the "action" elements instead of the "strategy"
elements, and to present the Display Step.

Note: Parameters and values are case sensitive.

Test&Target API

22

Inspect the Query Response


If T&T locates a campaign with the specified id or thirdPartyId it returns XML that describes the campaign. Otherwise, it
returns one of the following error messages:
Authentication error code: 401
Invalid request code: 400

If when approved was specified for the campaign start date when the campaign is created, the start date returned is
1970-01-01T00:00Z. If you pass when deactivated, the end date is 2100-01-01T10:00Z.
<campaign>
<id>NNNN</id>
<thirdPartyId>third party id</thirdPartyId> //if supplied by client.
<name>Campaign Name</name>
<state>approved|paused|deactivated|saved|deleted</state>
<enabled>true|false</enabled> <!--only 'approved' and 'paused' have enabled = true. -->
<startDate>YYYY-mm-DDTMM:HH:SS</startDate>
<endDate>YYYY-mm-DDTMM:HH:SS</endtDate>
<displayLocations>
<location>
<targetExpression>
<targetMbox>
<name>mboxName</name>
</targetMbox>
<targetParameter>
<type>url</type>
<name>ad</type>
<matcher>equalsIgnoreCase</matcher>
<values>
<value>A</value>
<value>B</value>
</values>
</targetParameter>
<targetUnknown/> (for currently unsupported targets)
</targetExpression>
</location>
<location>
<targetExpression>
<targetMbox><name>homePageHero</name></targetMbox>
<targetParameter>
<type>mbox</type>
<name>age</name>
<matcher>equals</matcher>
<values>
<value>33</value>
</values>
</targetParameter>
</targetExpression>
</location>
</displayLocations>
<branches>
<branch>
<id>NNNN</id> (recipe model ID - doesn't change even on client migration)
<name>branch name</name>
<description>branch description</description>
<targets>recipe targeting - same type as targets from displayTargets</targets>
<offers>
<displayLocation location="/campaign/displayLocations/location[1]">
<offerHTML> (for anonymous offers)
<html>...</html>
</offerHTML>
</displayLocation>
<displayLocation location="/campaign/displayLocations/location[2]">
<offerNamed>
<id>ID</id>
<name>offer name</name>
<offerRedirect>
<url>http://client.com/page.html</url>

Test&Target API

</offerRedirect>
</displayLocation>
<displayLocation location="/campaign/displayLocations/location[3]">
<offerDefault/>
</displayLocation>
</offers>
</branch>
<branch>
...
</branch>
</branches>
<!-- version 2 only -- >
<segments>
<segment>
<stepName>Step</stepName>
<name>name</name>
<targetExpression>
<targetParameter>
<type>type</type>
<name>name</name>
<matcher>equals</matcher>
<values>
<string>value</string>
</values>
</targetParameter>
</targetExpression>
</segment>
<segment>
...
</segment>
</segments>
<! -- end of version 2 only section -- >
</campaign>

Supported Targets
mbox name:
<targetMbox><name>mboxName</name></targetMbox>

mbox and URL parameter targeting:


<targetParameter>
<type>url | mbox</type>
<name>parameter name</name>
<matcher>equals | equalsIgnoreCase|etc</matcher>
<values>
<value>value1</value>
<value>value2</value>
....
</values>
</targetParameter>

Branch percent constraint:


<targetPercent>
<percent>95.5</percen>
</targetPercent>

Supported Offers
Anonymous HTML offers:
<offerHTML>
<html>offer content</html>
</offerHTML>

23

Test&Target API

24

Anonymous redirect offers:


<offerRedirect>
<url>http://mysite.com/page.html</url>
</offerRedirect>

Default content:
<offerDefault/>
Currently unsupported offers:
<offerUnknown>
<id>ID</id>
</offerUnknown>

Non-anonymous offers:
<offerNamed>
<id>ID</id>
<name>offer name</name>
</offerNamed>

Folder List
The Folder List API lets you list your T&T folders. You can use this list to retrieve the folder ID to use with the Offer Create
API or to use with the Offer List API.
Create the URL
For each operation add the parameters and values necessary to list folders in a T&T campaign. For example, use the following
URL substituting the appropriate value for each of the URL parameters:
https://testandtarget.omniture.com/api?client=user&[email protected]
&password=pword&operation=folderList&version=1

Parameter
client
email
password
operation

version

Description
(Required) The T&T client code.
(Required) The Email address associated with the T&T user performing the operation.
(Required) The T&T password associated with the specified email address.
(Required) Identifies the type of T&T action to execute. To list folders, this value is always
folderList.
Specify which version of the API you want to use. Set this to version=1 unless there is a different
version described in the documentation.

Note: Parameters and values are case sensitive.

Test&Target API

25

Inspect the Query Response


A response of 200 indicates a successful operation. T&T also returns the following information about each folder and subfolder:
This is the folder that lists all of the folders.
<folder> <!-- this is the first folder in the list -- >
<name>name</name>
<id>#</id>
<folders> <!-- additional folders are listed under the folders node -->
<folder>
<name>name</name>
<id>#</id>
<folder>
...

Get Host Groups


The Get Host Groups API returns the list of host groups.
In T&T, host groups are used to separate reporting and data collection to match production, staging, dev environments, or to
separate based on GEOs or similar values.
Create the URL
For each operation add the parameters and values necessary to get host groups in a T&T campaign. For example, use the following
URL, substituting the appropriate value for each of the URL parameters:
https://testandtarget.omniture.com/api?client=user&[email protected]
&password=pword&operation=getHostGroups&version=1

Parameter
client
email
password
operation

version

Description
(Required) The T&T client code.
(Required) The Email address associated with the T&T user performing the operation.
(Required) The T&T password associated with the specified email address.
(Required) Identifies the type of T&T action to execute. To get host groups, this value is always
getHostGroups.
Specify which version of the API you want to use. Set this to version=1 unless there is a different
version described in the documentation.

Note: Parameters and values are case sensitive.


Inspect the Query Response
A response of 200 indicates a successful operation. T&T also returns the following information about each group:
<hostGroups>
<hostGroup id="#" name="name" isDefault"true|false" isDefaultReporting="true|false"
timeOffsetDays="#"/>
</hostGroups>

Test&Target API

26

isDefault: identifies which host group accepts new hosts automatically.


isDefaultReporting: identifies which host group defaults as the primary host group to see reports.
timeOffsetDays: indicates if the host group is set off from the current date, as described here:
http://microsite.omniture.com/t2/help/en_US/tnt/help/index.html?f=t_Using_Time_Offset_for_Viewing_Campaigns
Example:
<hostGroups>
<hostGroup id="581" name="Production" isDefault="true" isDefaultReporting="true"
timeOffsetDays="0"/>
<hostGroup id="582" name="Staging" isDefault="false" isDefaultReporting="false"
timeOffsetDays="0"/>
<hostGroup id="583" name="Development" isDefault="false" isDefaultReporting="false"
timeOffsetDays="0"/>
</hostGroups>

Landing Page Tool


The Landing Page Tool API lets you configure default campaign creation settings in Test&Target.
This lets you simplify the campaign configuration process for the T&T user (the marketer). For example, you can pre-define
the URL parameters that trigger a campaign.
Note: When using the Landing Page Tool API, all parameters must be URL-encoded.
Use the following URL for the Landing Page Tool, substituting the appropriate value for each of the URL parameters:
https://testandtarget.omniture.com/api?tool=API%20tests&version=1

Parameter
tool

Description
(Required) The type of edit page interface. Supported values include the following:
admin: Use an edit classic interface.
simple: Use a new edit interface.

campaignName
3rdPartyCampaignId

campaignTarget

(Optional) The T&T campaign name.


(Optional) A third-party ID to associate with the campaign. For more information, see the
Third-Party Campaign ID API.
(Optional) The targeting expression, which takes one of the following forms:
page.param('paramName').indexOf('paramValue') >= 0
page.referrer.param('paramName').indexOf('paramValue') >= 0

page

(Optional) The URL of the campaign landing page. Consider the following when designating a
landing page:
The URL can be either HTTP or HTTPS.
The landing page should have an mbox.js include on the page, and at least one mbox.
Customers should have a T&T account.

Test&Target API

Parameter
returnLink

breadcrumb

branchNames

displayMboxes

conversionMbox

priority

27

Description
(Optional) The URL of a page to return to if there are problems. If this parameter is unspecified, the
Web browser closes if there is a problem.
(Optional) Text to display in a breadcrumb link. The Landing Page Tool uses the returnLink URL
as the breadcrumb link URL.
(Optional) A comma-separated list of recipe names. If this parameter is unspecified, the Landing
Page Tool defaults to Recipe A.
(Optional) A comma-separated list of mbox names. For example: Product Page, Category Page,
Footer.
(Optional) The name of the Conversion mbox. If this parameter is unspecified, the Landing Page
Tool defaults to conversion.
(Optional) The campaign priority used by Test&Target to determine which campaign takes
precedence. Supported values include the following:
0: Low priority
1: Medium priority
2: High priority

label

version

(Optional) A descriptive campaign label. A descriptive label makes it easier to filter the campaign
list.
Specify which version of the API you want to use. Set this to version=1 unless there is a different
version described in the documentation.

Offer Create
The Offer Create API lets you create an HTML offer.
Create the URL
For each operation add the parameters and values necessary to create an HTML offer in a T&T campaign. For example, use the
following URL substituting the appropriate value for each of the URL parameters:
https://testandtarget.omniture.com/api?client=user&[email protected]&password=pword
&operation=saveHtmlOfferContent&offerName=name&folderId=#&version=2&content=<HTML HERE>

Parameter
client

Description
(Required) The T&T client code.

Test&Target API

Parameter
email
password
operation

offerName
folderId
version

28

Description
(Required) The Email address associated with the T&T user performing the operation.
(Required) The T&T password associated with the specified email address.
(Required) Identifies the type of T&T action to execute. To save an HTML offer, this value is always
saveHtmlOfferContent.
(Required) The name of the offer.
(Required) The folder where you want to save the offer. Get the ID from Folder List.
Specify which version of the API you want to use. Set to one of the following:
version=1 does not include the offer ID in the response.
version=2 includes the offer ID in the response.

content

(Required) URL escaped HTML snippet that contains the offer. For example:
%3Cdiv+class%3D%22offer-content%22%3E...%3C%2Fdiv%3E

Note: Parameters and values are case sensitive.


Inspect the Query Response
A response of 200 indicates a successful operation.
<status>SUCCESS</status>

Offer Get
The Offer Get API lets you get the content of an HTML offer.
Create the URL
For each operation add the parameters and values necessary to get the content of an HTML offer in a T&T campaign. For
example, use the following URL substituting the appropriate value for each of the URL parameters:
https://testandtarget.omniture.com/api?client=user&[email protected]
&password=pword&operation=getHtmlOfferContent&offerName=name&version=1

Parameter
client
email

Description
(Required) The T&T client code.
(Required) The Email address associated with the T&T user performing the operation.

Test&Target API

Parameter
password
operation

offerName
version

29

Description
(Required) The T&T password associated with the specified email address.
(Required) Identifies the type of T&T action to execute. To get an offer, this value is always
getHtmlOfferContent.
(Required) The name of the HTML offer you want to get.
Specify which version of the API you want to use. Set to one of the following:
version=1 does not include the offer ID in the response.
version=2 includes the offer ID in the response.

Note: Parameters and values are case sensitive.


Inspect the Query Response
A response of 200 indicates a successful operation. T&T also returns the following content from the specified HTML offer:
<htmlOffer>
<SCRIPT/>
<value>
<![CDATA[
<div class="offer-content">...</div>
]]>
</value>
</htmlOffer>

Offer List
The Offer List API lets you list the offers that are contained in a folder.
Create the URL
For each operation add the parameters and values necessary to list offers. For example, use the following URL substituting the
appropriate value for each of the URL parameters:
https://testandtarget.omniture.com/api?client=user&[email protected]
&password=pword&operation=offerList&folderId=8&version=1

Parameter
client
email
password
operation

Description
(Required) The T&T client code.
(Required) The Email address associated with the T&T user performing the operation.
(Required) The T&T password associated with the specified email address.
(Required) Identifies the type of T&T action to execute. To list offers, this value is always offerList.

Test&Target API

Parameter
folderId
version

30

Description
(Required) The ID of the folder for which you want to view offers.
Specify which version of the API you want to use. Set this to version=1 unless there is a different
version described in the documentation.

Note: Parameters and values are case sensitive.


Inspect the Query Response
A response of 200 indicates a successful operation. T&T also returns the following information about each offer:
<offer>
<name>offer-name</name>
<id>#</id>
</offer>

1:1 Content Report


The 1:1 Content Report API lets you programmatically extract detailed visit and impression information for a single campaign.
This reports shows you the number of times each piece of content was displayed. This value is based on the impression count
rather than the number of visitors. For example, a visitor could be displayed a piece of content multiple times in a single visit.
Create the URL
For each operation add the parameters and values you need as a filter. For example:
https://testandtarget.omniture.com/admin/api?client=acme&
[email protected]&password=mypassword&operation=oneToOneContentReport&
campaignId=21&environment=Production&start=2011-08-24T00:00:00
&end=2011-09-12T00:00:00&resolution=day&version=1

Parameter
client
email
password
operation

campaignId

Description
(Required) The T&T client code.
(Required) The Email address associated with the T&T user performing the operation.
(Required) The T&T password associated with the specified email address.
(Required) Identifies the type of T&T action to execute. To generate 1:1 Content reports,
this value is always oneToOneContentReport.
(Required) The ID of the campaign you want to query. To identify the Campaign List ID,
Use the Campaign List API or look at the campaignDescriptionId parameter in
the URL when viewing a campaign in the T&T Tool.

Test&Target API

Parameter
start

31

Description
(Required) The report start date and time. Specify the date using the following format:
YYYY-MM-DDTHH:mm.

end

(Required) The report end date and time. Specify the date using the following format:
YYYY-MM-DDTHH:mm.

environment

resolution

timeZone

version

(Optional) A URL-encoded host group name, as defined in the T&T Tool. By default, the
environment value is Production.
(Optional) The period of the report, which can be one of the following values: day (default),
month.
(Optional) If not specified, the default time zone associated with the T&T client name is
used.
Specify which version of the API you want to use. Set this to version=1 unless there is a
different version described in the documentation.

Note: Parameters and values are case sensitive.


Inspect the Query Response
The following abbreviated success response displays sample report data.
<reports start="2011-08-24T00:00:00" end="2011-09-12T00:00:00" environment="Production"
timeZone="XXX" resolution="day" campaignId="21">
<report>
<period start="2011-08-25T00:00:00">
<mbox name="homePageHero">
<offer name="Offer1">
<traffic type="TESTING">
<step name="Entry">
<visits>1</visits>
<impressions>3</impressions>
<sumOfSquares>325.00000</sumOfSquares>
</step>
<step name="Display Mboxes">
.............
</step>
.........
</traffic>
<traffic type="TARGETED">
<step name="Entry">
<visits>5</visits>
<impressions>8</impressions>
<sumOfSquares>325.00000</sumOfSquares>
</step>
<step name="Display Mboxes">
.............
</step>
.........
</traffic>
</offer>

Test&Target API

32

<offer name="Offer2">
..........
</offer>
.............
</mbox>
<mbox name="homePageFeature1">
..............
</mbox>
.................
</period>
<period.....>
.........
</report>
<reports>

Tag
reports

Description
Contains all reports generated through a single 1:1 Content Report API request.
campaignId: See the campaignId parameter.
start: See the start parameter.
end: See the end parameter.
timeZone: See the timeXone parameter.
environment: See the resolution parameter.
resolution: See the resolution parameter.

report
period

Contains data for a single report.


Contains data for a single report interval. If there are no visitors in a given time interval (for example, day
2) the XML output omits that node. The period tag supports the following attributes:
start: The start date/time of the sample.

mbox

Contains data for a single mbox. The mbox tag supports the following attributes:
name: The name of the mbox.

offer

Contains data for a single offer. The offer tag supports the following attributes:
name: The name of the offer.

traffic

Contains traffic data associated with an offer. The traffic tag supports the following attribute:
type: The type of traffic contained in the tag.

step

Contains the data (visits and impressions) associated with this offer/traffic. The step tag supports the
following attribute:
name: The success metric name.

visits

Contains the visits associated with this step.

Test&Target API

Tag
impressions
sumOfSquares

33

Description
Contains the impressions associated with this step.
Contains the "Sum of Squares" value, which is useful for extreme order calculation.

A failed query response uses the following XML structure:


<error>
<message>Invalid email or password supplied. Email: [email protected]</message>
<code>401</code>
</error>

Tag
message

Description
A description of the error. For example:
Invalid email or password supplied. Email: [email protected].

code

The error code. For example: 401.

Parse the Query Response


Optionally, you can use a scripting language such as Perl, Python, and Ruby, to parse the results and write them to an output
file, such as a CSV file, that you can view in any spreadsheet application.

Performance Report
The Performance Report API lets you programmatically extract detailed performance information for a single campaign.
About Version 2
An new version of the Performance Report API is now available. The format has been improved to make it easier to write scripts
to traverse the API response and gather the data. Each step now contains an "amount" node within it that displays the count,
which make the returned data easier to read.
Additionally, in version 1, revenue data is only available for the final conversion point on the campaign. Version 2 shows sales
data available for all steps in the campaign, not just the final conversion point. It also shows engagement data per step instead
of grouped at the end.
To use the new verison, append &version=2 to your API call to the Performance Report.
Create the URL
For each operation add the parameters and values you need as a filter. For example:
https://testandtarget.omniture.com/api?client=acme&[email protected]
&password=mypassword&operation=report&campaignId=NNNN&
start=YYYY-MM-DD&end=YYYY-MM-DD&environment=testEnvironment&resolution=hour
&segments=name&version=2

Test&Target API

Parameter
client
email
password
type

operation

campaignId

start

end

environment

resolution

segments

34

Description
(Required) The T&T client name.
(Required) The Email address associated with the T&T user performing the operation.
(Required) The T&T password associated with the specified email address.
(Optional) A specific campaign metric. Supported values include visit, visitor, and
impression. If you do not specify this parameter, T&T includes all metrics in the report.
(Required) Identifies the type of T&T action to execute. To generate performance reports,
this value is always Report.
(Required) The ID of the campaign you want to query. To identify the Campaign List ID,
Use the Campaign List API or look at the campaignDescriptionId parameter in
the URL when viewing a campaign in the T&T Tool.
(Required) The report start date and time. Specify the date using the following format:
YYYY-MM-DDTHH:mm. The performance report uses the time zone setting specified in the
Web browser.
(Required) The report end date and time. Specify the date using the following format:
YYYY-MM-DDTHH:mm. The performance report uses the time zone setting specified in the
Web browser.
(Optional) A URL-encoded host group name, as defined in the T&T Tool. By default, the
environment value is Production.
(Optional) The period of the report, which can be one of the following values: hour, day
(default), week, month.
(Optional) The name of the segments to include in the report. If you don't specify this
parameter, the performance report is an aggregate of all segments.
To generate a report listing each segment separately, use a segment value of allSegments.

includeDeletedReportRows

filterExtremeOrders

version

(Optional) Default value is false. If set to true, report information will show for experiences
that are now deleted, but which had data during the period for which the report was run.
(Optional) Default value is false. If set to true, then extreme orders, as defined in
Test&Target, are excluded from the API response.
Specify which version of the API you want to use. For example, version=2.

Test&Target API

35

Note: Parameters and values are case sensitive.


Inspect the Query Response
The following abbreviated success response displays two individual segments and the segment aggregate.
<reports>
<report campaignId="7" start="2009-07-01" end="2009-08-02" resolution="day" type="visitor"
segments="Segment 1" segmentId="0">
<sample start="2009-08-01T00:00" duration="day">
<recipe name="Experience A">
<step name="Entry">476.0</step>
<step name="Visits">370.0</steps>
<step name="Display mboxes">476.0</step>
<step name="Time on Site">1117.0</step>
<step name="Page Count">1117.0</step>
<step name="Score">1100.0</step>
<step name="Global Mbox">1100.0</step>
<step name="Clicked Article">255.0</step>
<amount>121.13</amount>
<engagementMetrics>
<engagement stepName="Page Count" count="190"
total="558.00000"sumOfSquares="4382.00000"/>
<engagement stepName="Time on Site" count="211"
total="44773.42500"sumOfSquares="43287221.65236"/>
<engagement stepName="Score" count="207"
total="117.00000"sumOfSquares="843.00000"/>
</engagementMetrics>
</recipe>
</sample>
</report>
<report campaignId="7" start="2007-08-01" end="2007-08-02" resolution="day" type="visitor"
segments="Segment 2" segmentId="1">
.
.
.
</report>
<report campaignId="7" start="2007-08-01" end="2007-08-02" resolution="day" type="visitor">
.
.
.
</report>
</reports>

Tag
reports
report

Description
Contains all reports generated through a single Performance Report API request.
Contains one report. The report tag supports the following attributes:
campaignId: See the campaignId parameter.
start: See the start parameter.
end: See the end parameter.
resolution: See the resolution parameter.
type: See the type parameter.

Test&Target API

Tag

36

Description
segments: The name of the segment used to generate this report. This attribute is omitted when

generating an aggregate report of all segments.


segmentId: The ID of the segment used to generate this report. T&T omits this attribute when

generating an aggregate report of all segments.


sample

Contains data for a single report interval. If there are no visitors in a given time interval (for
example, day 2, or hour 5) the XML output omits that node. The sample tag supports the
following attributes:
start: The start date/time of the sample.
duration: The duration of the sample, as defined by the resolution query parameter.

recipe

Contains the recipe. The recipe attribute supports the following attribute:
name: The recipe name.

step

Contains the data (visitors, visits, or impressions) from a single success metric (display mboxes,
eonversion, etc.) associated with this recipe. The step tag supports the following attribute:
name: The success metric name.

count
amount
engagementMetrics
engagement

Contains the item or value count associated with each step.


Contains the revenue associated with this recipe.
Contains the engagement metrics.
The engagementMetrics tag supports the following attributes:
stepName: The success metric name.
count: The number of times this success metric has been viewed.
total: The calculated value of the success metric.
sumOfSquares: Contains the "Sum of Squares" value, which is useful for extreme order

calculation.

Note: The recipe named "Campaign" in each sample shows a summary for that sample.
A failed query response uses the following XML structure:
<error>
<message>Invalid email or password supplied. Email: [email protected]</message>
<code>401</code>
</error>

Test&Target API

37

Tag

Description

message

A description of the error. For example:


Invalid email or password supplied. Email: [email protected].

code

The error code. For example: 401.

Parse the Query Response


Optionally, you can use a scripting language such as Perl, Python, and Ruby, to parse the results and write them to an output
file, such as a CSV file, that you can view in any spreadsheet application.

Profile Passing & Offline Conversion


The Third-party Profile Passing and Offline Conversion API lets you programmatically pass a user profile and map a third-party
user ID to T&T.
Pass a User Profile: Use the profile passing API to pass third-party segmentation data into Test&Target (T&T) as profile
attributes for targeting. This lets you use Test&Target to target content based on segmentation data from analytics vendors,
as long as you know the T&T ID for the user to which the passed-in data belongs.
Note: Using the Test&Target ID is preferred, but the API also supports using a third-party ID (assuming the ID is already
stored in Test&Target). Contact your Account Representative for further details.
Map a Third-Party User ID to T&T: Use the Offline Conversion API to associate a visitor ID in your system with a Test&Target
visitor ID. Doing this lets you add additional profile information to the visitor's Test&Target persistent profile.
Passing a User Profile
Use the Profile Passing API to pass third-party segmentation data into Test&Target as profile attributes for targeting.
This lets you use Test&Target to target content based on segmentation data from analytics vendors, as long as you know the
T&T ID for the user to which the passed-in data belongs.
1. Create the URL. For example:
https://clientcode.tt.omtrdc.net/m2/clientcode/rest/standard?mbox=confirmed_offline
&mboxPC=XXX&mboxHost=offline.offermatica.com&mboxParam=value&profile.Name=value&version=1

Note: Parameters and values are case sensitive.


Parameter
clientCode
mbox
mboxPC

Description
(Required) A valid T&T client code.
(Required) The mbox name.
(Required) The T&T profile ID of the user associated with the passed-in segment data.

Test&Target API

38

Parameter

Description

mboxHost

(Optional) The mbox host. The default value is offline.offermatica.com.

mboxParam
profile.Name

Version

(Optional) A list of name/value pairs to pass into the mbox for targeting content.
(Optional) A list of name/value pairs with the names prefixed with "profile.", which signals T&T
to store the name/value pair in the user profile.
Specify which version of the API you want to use. Set this to version=1 unless there is a different
version described in the documentation.

2. Inspect the query reponse.


The query response uses the following XML structure:
<response>
<success>true</success>
<pcId>124252</pcId>
</response>

Tag
success

Description
Indicates the success of failure of the query.
true: success
false: failure.

pcId

The user's unique identifier. Shown only when success = true.

Map a Third-Party User ID to T&T


The Offline Conversion API lets you map a third-party profile ID, order ID, or any other ID explicitly associated with a user,
to a T&T profile ID.
Build the mapping by making an mbox request with the parameter:
mbox3rdPartyId=XXX

For example:
<div class="mboxDefault"></div>
<script type="text/javascript">
mboxCreate('application_submitted_online', 'mbox3rdPartyId=CA10021456');
</script>

T&T logs the third-party ID or pcId when it writes the profile to the database (after a delay of about 30 minutes). After the
third-party ID or pcId is logged, you can use the API to send more requests and use the third-party profile ID instead of the
mboxId. For example:
https://clientcode.tt.omtrdc.net/m2/clientcode/rest/standard?mbox=confirmed_offline
&mbox3rdPartyId=acmecorp&mboxHost=offline.omniture.com&
mboxParam=value&profile.Name=value&version=1

Test&Target API

39

Note: Parameters and values are case sensitive.


Parameter
clientCode
mbox

Description
(Required) A valid T&T client code.
(Required) The mbox name.

mbox3rdPartyId

mboxHost
mboxParam
profile.Name

Version

(Required) The third-party profile ID of the user associated with the passed-in segment data. Limited
to 60 characters.
(Optional) The mbox host. The default value is offline.offermatica.com.
(Optional) A list of name/value pairs to pass into the mbox for targeting content.
(Optional) A list of name/value pairs with the names prefixed with "profile.", which signals T&T to
store the name/value pair in the user profile.
Specify which version of the API you want to use. Set this to version=1 unless there is a different version
described in the documentation.

Third-Party Campaign ID
The Third-party Campaign ID API lets you associate a third-party identifier to a T&T campaign.
Associate the Third-Party ID
You can associate a third-party ID with a T&T campaign only when creating the campaign programmatically (see Campaign
Copy). To do so, specify the appropriate third-party ID in the <thirdPartyId> element. For example:
<campaign>
<name>Example REST Campaign</name>
<thirdPartyId>extID501</3rdPartyId>
<branches>
...
</campaign>

Looking Up a Campaign by Third-Party ID


Create the URL. For example:
https://testandtarget.omniture.com/api?client=user1&
[email protected]&password=pword&operation=getCampaignId&campaign3rdPartyId=extID501&version=1

Note: Parameters and values are case sensitive.

Parameter
client

Description
(Required) The T&T client name.

Test&Target API

40

Parameter

Description

email

(Required) The Email address associated with the T&T client.

password

(Required) The T&T client password.

operation

(Required) Identifies the type of T&T action to execute. To look-up a T&T campaign, this value
is alwaysgetCampaignId.

campaign3rdPartiId

(Required) The third-party campaign ID associated with the T&T campaign.

Version

Specify which version of the API you want to use. Set this to version=1 unless there is a different
version described in the documentation.

Widget Offer Creation


The Widget Offer Creation API lets you programmatically create a widget offer.
Create the URL
A widget offer is a URL that corresponds to a T&T fetched response from a third-party server. T&T caches a response associated
with each offerID parameter, which serves as a key.
For each operation add the parameters and values necessary to set the state of the T&T campaign. For example:
https://admin.testandtarget.omniture.com/api?client=clientcode&
[email protected]&password=pword&operation&version=1

Parameter
client
email
password
operation

name
url

id

Description
(Optional) The T&T client code.
(Required) The Email address associated with the T&T user performing the operation.
(Required) The T&T password associated with the specified email address.
(Required) Identifies the type of T&T action to execute. To change a T&T campaign state, this value
is always saveWidgetOffer.
(Required) The name of the widget offer, which is displayed in the admin interface Offer list.
(Required)The encoded URL of the third-party server that hosts the dynamically generated response.
T&T calls this URL and caches the resulting response.
(Required) The third-party ID of the widget offer.

Test&Target API

Parameter
version

41

Description
Specify which version of the API you want to use. Set this to version=1 unless there is a different
version described in the documentation.

Note: Parameters and values are case sensitive.


Inspect the Query Response
On a successful widget offer creation, T&T returns an XML response that contains the specified third-party ID. For example:
<success>
<third-party-id>999</third-party-id>
</success>

If the operation fails, T&T returns an XML response that contains an error message. For example:
<error>
<message>Parameter 'id' should not be blank.</message>
<code>400</code>
</error>

You might also like