- 11 Minutes to read
Mail Event Audiences
- 11 Minutes to read
This article describes resources and services that enable you to read, create, and update email event audiences.
Overview
A mail event audience enables you to target consumers based on sales receipts.
Advertisers can define the parameters of their audience based on purchase confirmation emails in Yahoo users’ inboxes for individual products, airline bookings, hotel reservations and more.
A purchase receipt is defined as an individual, anonymized email that a Yahoo mail user receives indicating that the user completed a purchase or payment.
Endpoint
/traffic/audiences/mail_event
The action taken depends on the HTTP method and the parameters specified.
Use the
GET
method to read an existing mail event audience.Use the
POST
method to create a new mail event audience.Use the
PUT
method to update an existing mail event audience.
Resources
Mail Event Object
The Mail Event object contains the following fields:
Field | Description | Type | Create | Update |
---|---|---|---|---|
| Specifies the audience ID. |
| N/A | Required |
| Specifies the name of the audience. |
| Required | Optional |
| Specifies the current status of the audience. Allowed values:
Defaults to |
| Optional | Optional |
| Specifies the mail event audience type. Options include:
|
| Required | Optional |
| Specifies the minimum number of receipts that must be in the consumer’s email for that consumer to be included in the audience. Options include:
|
| Optional | Optional |
| Specifies the advertiser ID. If specified, the mail event audience is tied to a specific advertiser and can only be used in that advertiser’s campaigns. To learn more, refer to Advertisers. |
| Required | Optional |
| A read-only field that specifies when the audience was created. |
| N/A | N/A |
| Specifies an array of Text Attribute objects. To learn more, refer to Text Attributes Object. |
| Optional | Optional |
| Specifies an array of Time Attribute objects. To learn more, refer to Time Attribute Object. |
| Optional | Optional |
Text Attributes Object
The textAttributes
array contains one or more Text Attribute objects. The Text Attribute object contains the following fields:
Field | Description | Type | Create | Update |
---|---|---|---|---|
| Specifies the attribute key. For a complete list, refer to Supported Purchase Events. |
| Required | Required |
| Specifies the group type. Option include:
|
| Required | Required |
| Specifies the match type. Options include:
To learn more, refer to Supported Purchase Events. Required if the value type of the attribute is |
| Required [1] | Required [1] |
| Specifies the operator type. Options include:
To learn more, refer to Supported Purchase Events. Required if the value type of the attribute is |
| Required [2] | Required [2] |
| Specifies an array of keywords. |
| Required | Required |
| Read-only field showing the event name. |
| N/A | N/A |
Example Payload
{
"textAttributes": [
{
"key": "cpv",
"groupType": "INCLUDE",
"values": [
"aa.com",
"advantage.com"
]
}
]
}
Time Attribute Object
The timeAttributes
array contains an array of Time Attribute objects. Time Attribute object are defined by the following fields:
Field | Description | Type | Create | Update |
---|---|---|---|---|
| Specifies the attribute key. For a complete list, refer to Supported Purchase Events. |
| Required | Required |
| Specifies the method used to select ranage of the data collection. Options include:
|
| Required | Required |
| Specifies the start of the date range. Required if the |
| Required [3] | Required [3] |
| Specifies the end of the date range. Required if the |
| Required [4] | Required [4] |
| Specifies the number of days into the past or future. Required if the |
| Required [5] | Required [5] |
| Read-only field showing the event name. |
| N/A | N/A |
Example Payload
{
"timeAttributes": [
{
"key": "cbkdt",
"rangeType": "DATE",
"fromDate": "20170703",
"toDate": "20170903"
},
{
"key": "cpickdt",
"rangeType": "DAY",
"numDays": "2"
}
]
}
Supported Purchase Events
string
data types can only be part oftextAttributes
time
data types can only be included intimeAttributes
.
Attribute | Event Key | Event Name | Data Type | Value Type |
---|---|---|---|---|
|
| airline |
| Search |
|
| booking service |
| Search |
|
| travel from |
| Search |
|
| travel to |
| Search |
|
| booking date |
| Timestamp |
|
| depart date |
| Timestamp |
|
| arrival date |
| Timestamp |
|
| booked car with |
| Search |
|
| rental city |
| String |
|
| rental country |
| Search |
|
| car booking date |
| Timestamp |
|
| pickup date |
| Timestamp |
|
| hotel name |
| String |
|
| booked hotel with |
| Search |
|
| hotel brand |
| Search |
|
| hotel city |
| String |
|
| hotel country |
| Search |
|
| check in date |
| Timestamp |
|
| hotel booking date |
| Timestamp |
|
| length of stay |
| Numeric |
|
| event name |
| String |
|
| event venue |
| String |
|
| event email sender |
| Search |
|
| event season |
| Search |
|
| event date |
| Timestamp |
|
| movie theater name |
| String |
|
| movie title |
| String |
|
| movie genre |
| Search |
|
| ticket vendor |
| Search |
|
| movie rating |
| Search |
|
| movie date |
| Timestamp |
|
| users making payment to |
| String |
|
| payment status |
| Search |
|
| payment due date |
| Timestamp |
|
| product name |
| String |
|
| bought from |
| Search |
|
| category |
| Search |
|
| subcategory |
| Search |
|
| payment method |
| Search |
|
| purchase date |
| Timestamp |
|
| product price |
| Numeric |
|
| social events top category |
| Search |
|
| social events subcategory |
| Search |
|
| social events date |
| Timestamp |
|
| Average Monthly Trades |
| Search |
|
| Provider |
| Search |
|
| Investment Date |
| Timestamp |
Read Attributes & Allowed Values
Get a list of attributes and allowed values.
GET /traffic/audiences/mail_event/allowedvalues/{eventType}
Each event type contains multiple attributes (such as hotel brand or hotel city). Certain attributes allow any value while others are restricted to a specific set of values.
Parameters
Parameter | Parameter Type | Description | Data Type | Required |
---|---|---|---|---|
| path | Specifies the mail event type.
|
Example Request URL
GET https://dspapi.admanagerplus.yahoo.com/traffic/audiences/mail_event/allowedvalues/HOTEL
Example Response (Partial)
The response contains the following fields:
{
"response": {
"categories": [
{
"attributeName": "hotel booking date",
"allowedValues": []
},
{
"attributeName": "checkin date",
"allowedValues": []
},
{
"attributeName": "hotel city",
"allowedValues": []
},
{
"attributeName": "hotel name",
"allowedValues": []
},
{
"attributeName": "length of stay",
"allowedValues": []
},
{
"attributeName": "booked hotel with",
"allowedValues": [
"0sg.net",
"4huffs.com"
]
},
{
"attributeName": "hotel brand",
"allowedValues": [
"BEST WESTERN HOTELS",
"CHOICE HOTELS"
]
},
{
"attributeName": "hotel country",
"allowedValues": [
"AND",
"ARG"
]
}
]
},
"errors": null,
"timeStamp": "2017-08-30T04:01:45Z"
}
Read Audience
Read a specific mail event audience.
GET /traffic/audiences/mail_event/{id}?accountId={accountId}
Parameters
Parameters | Parameter Type | Description | Data Type | Required/Optional |
---|---|---|---|---|
| path | Specifies the audience ID. |
| Required |
| query | Specifies the advertiser ID. |
| Required for advertiser-level audiences. Do not use for seat-level audiences. |
Example Request URL (Seat-Level)
GET https://dspapi.admanagerplus.yahoo.com/traffic/audiences/mail_event/50335610
Example Response (Seat-Level)
{
"response": {
"id": 50335610,
"name": "purtest130",
"frequency": 1,
"createdAt": "2017-09-23",
"status": "ACTIVE",
"eventType": "CAR",
"textAttributes": [
{
"name": "booked car with",
"key": "cpv",
"groupType": "INCLUDE",
"values": [
"aa.com",
"advantage.com"
]
},
{
"name": "rental city",
"key": "ccity",
"groupType": "EXCLUDE",
"matchType": "CONTAINS",
"values": [
"San Francisco",
"San Jose",
"Oakland"
]
}
],
"timeAttributes": [
{
"name": "pickup date",
"key": "cpickdt",
"rangeType": "DAY",
"numDays": "2"
},
{
"name": "car booking date",
"key": "cbkdt",
"rangeType": "DATE",
"fromDate": "20170703",
"toDate": "20170903"
}
]
},
"errors": null,
"timeStamp": "2017-09-23T05:11:03Z"
}
Example Request URL (Advertiser-Level)
GET https://dspapi.admanagerplus.yahoo.com/traffic/audiences/mail_event/50335609?accountId=1356341
Example Response (Advertiser-Level)
{
"response": {
"id": 50335609,
"name": "travel-test",
"accountId": 1356341,
"frequency": 1,
"createdAt": "2017-09-23",
"status": "ACTIVE",
"eventType": "FLIGHT",
"textAttributes": [
{
"name": "airline",
"key": "farcd",
"groupType": "INCLUDE",
"values": [
"UA"
]
},
{
"name": "travel from",
"key": "fdeap",
"groupType": "EXCLUDE",
"values": [
"JFK"
]
}
],
"timeAttributes": [
{
"name": "booking date",
"key": "fbkdt",
"rangeType": "DAY",
"numDays": "2"
}
]
},
"errors": null,
"timeStamp": "2017-09-23T05:08:19Z"
}
Create Audience
Create a new mail event audience.
POST /traffic/audiences/mail_event
Audiences may be created at the seat-level or the advertiser-level. If no advertiser ID (accountId
) is specified, the mail event audience is created at the seat level and is available to all advertisers belonging to that seat.
Example Request URL (Seat-Level)
POST https://dspapi.admanagerplus.yahoo.com/traffic/audiences/mail_event
Example Request Body (Seat-Level)
{
"name": "purtest130",
"textAttributes": [
{
"key": "cpv",
"groupType": "INCLUDE",
"values": [
"aa.com",
"advantage.com"
]
},
{
"key": "ccity",
"groupType": "EXCLUDE",
"matchType": "CONTAINS",
"values": [
"San Francisco",
"San Jose",
"Oakland"
]
}
],
"timeAttributes": [
{
"key": "cbkdt",
"rangeType": "DATE",
"fromDate": "20170703",
"toDate": "20170903"
},
{
"key": "cpickdt",
"rangeType": "DAY",
"numDays": "2"
}
],
"eventType": "CAR",
"accountId": null,
"status": "ACTIVE",
"frequency": 1
}
Example Response (Seat-Level)
{
"response": {
"id": 50335610,
"name": "purtest130",
"frequency": 1,
"createdAt": "2017-09-23",
"status": "ACTIVE",
"eventType": "CAR",
"textAttributes": [
{
"name": "booked car with",
"key": "cpv",
"groupType": "INCLUDE",
"values": [
"aa.com",
"advantage.com"
]
},
{
"name": "rental city",
"key": "ccity",
"groupType": "EXCLUDE",
"matchType": "CONTAINS",
"values": [
"San Francisco",
"San Jose",
"Oakland"
]
}
],
"timeAttributes": [
{
"name": "pickup date",
"key": "cpickdt",
"rangeType": "DAY",
"numDays": "2"
},
{
"name": "car booking date",
"key": "cbkdt",
"rangeType": "DATE",
"fromDate": "20170703",
"toDate": "20170903"
}
]
},
"errors": null,
"timeStamp": "2017-09-23T05:11:03Z"
}
Example Request Body (Advertiser-Level)
{
"name": "travel-test",
"textAttributes": [
{
"key": "airline",
"groupType": "INCLUDE",
"values": [
"UA"
]
},
{
"key": "travel from",
"groupType": "EXCLUDE",
"values": [
"JFK"
]
}
],
"timeAttributes": [
{
"key": "booking date",
"rangeType": "DAY",
"numDays": "2"
}
],
"eventType": "FLIGHT",
"accountId": 1356341,
"status": "ACTIVE",
"frequency": 1
}
Example Response (Advertiser-Level)
{
"response": {
"id": 50335609,
"name": "travel-test",
"accountId": 1356341,
"frequency": 1,
"createdAt": "2017-09-23",
"status": "ACTIVE",
"eventType": "FLIGHT",
"textAttributes": [
{
"name": "airline",
"key": "farcd",
"groupType": "INCLUDE",
"values": [
"UA"
]
},
{
"name": "travel from",
"key": "fdeap",
"groupType": "EXCLUDE",
"values": [
"JFK"
]
}
],
"timeAttributes": [
{
"name": "booking date",
"key": "fbkdt",
"rangeType": "DAY",
"numDays": "2"
}
]
},
"errors": null,
"timeStamp": "2017-09-23T04:56:01Z"
}
Update Audience
Update an existing mail event audience.
PUT /traffic/audiences/mail_event/{id}
Partial updates are supported for all fields except timeAttributes
; values of supported fields which are not in the payload will remain unchanged.
Example Request URL (Seat-Level)
PUT https://dspapi.admanagerplus.yahoo.com/traffic/audiences/mail_event/50336118
Example Request Body (Seat-Level)
{
"name": "new_name_purchase_event",
"textAttributes": [
{
"key": "cpv",
"groupType": "INCLUDE",
"values": [
"aa.com",
"advantage.com"
]
}
]
}
Example Response (Seat-Level)
{
"response": {
"id": 50336118,
"name": "new_name_purchase_event",
"frequency": 1,
"createdAt": "2017-09-25",
"status": "INACTIVE",
"eventType": "CAR",
"textAttributes": [
{
"name": "booked car with",
"key": "cpv",
"groupType": "INCLUDE",
"values": [
"aa.com",
"advantage.com"
]
}
],
"timeAttributes": []
},
"errors": null,
"timeStamp": "2017-09-25T18:11:47Z"
}
Example Request URL (Advertiser-Level)
PUT https://dspapi.admanagerplus.yahoo.com/traffic/audiences/mail_event/50336118?accountId=1356341
Example Request Body (Advertiser-Level)
{
"name": "new_name_purchase_event_adv",
"accountId": 1356341,
"textAttributes": [
{
"key": "ccity",
"groupType": "EXCLUDE",
"matchType": "CONTAINS",
"values": [
"San Francisco",
"San Jose",
"Oakland"
]
}
]
}
Example Response (Advertiser-Level)
{
"response": {
"id": 50336118,
"name": "new_name_purchase_event_adv",
"accountId": 1356341,
"frequency": 1,
"createdAt": "2017-09-25",
"status": "INACTIVE",
"eventType": "CAR",
"textAttributes": [
{
"name": "rental city",
"key": "ccity",
"groupType": "EXCLUDE",
"matchType": "CONTAINS",
"values": [
"San Francisco",
"San Jose",
"Oakland"
]
}
],
"timeAttributes": []
},
"errors": null,
"timeStamp": "2017-09-25T18:14:17Z"
}
Delete Audience
The DSP Traffic API does not support deletion of mail event audiences.