Create a Campaign
POST/v1/campaigns
Create a Campaign
Request
- application/json
Body
The request received from the client.
Array [
]
The Account identifier under which to create the Campaign.
The Data Specification identifier that this Campaign targets. The Data Specification culture and currency must be valid for the Account under which this Campaign will be created.
The name of the Campaign.
bidAmount
object
required
Represents an amount of money with its currency type.
The whole units of the amount.
For example if currencyCode
is "USD"
, then 1 unit is one US dollar.
Number of nano (10^-9) units of the amount.
The value must be between -999,999,999 and +999,999,999 inclusive.
If units
is positive, nanos
must be positive or zero.
If units
is zero, nanos
can be positive, zero, or negative.
If units
is negative, nanos
must be negative or zero.
For example $-1.75 is represented as units
=-1 and nanos
=-750,000,000.
query
object
required
A query containing conditions that all need to match against a Data Instance.
conditions
object[]
required
The query conditions.
The name of the property on the Data Instance as defined in the Data Specification.
(Optional) If a given Data Instance is missing a value for the property that this condition targets, should this condition be considered a match. This value can only be specified for properties that are not required on the Data Specification.
onWin
object
Preferences for being notified.
The email address to which to send notifications.
The phone number to which to send notifications.
Whether to notify by email to the given email address.
Whether to notify by text message to the given phone number.
onLose
object
Preferences for being notified.
The email address to which to send notifications.
The phone number to which to send notifications.
Whether to notify by email to the given email address.
Whether to notify by text message to the given phone number.
Metadata that can be returned when this Campaign has the winning bid for a Data Instance
(Optional) Whether to use global bid preferences for this Campaign. This overrides any local bid preferences
bidPreferences
object
Preferences for when to bid and limits on bidding.
Whether bids should be placed on Mondays.
Whether bids should be placed on Tuesdays.
Whether bids should be placed on Wednesdays.
Whether bids should be placed on Thursdays.
Whether bids should be placed on Fridays.
Whether bids should be placed on Saturdays.
Whether bids should be placed on Sundays.
bidTimeFrom
object
Represents a time of day. The date and time zone are not significant
Hours of day in 24 hour format. Must be from 0 to 23
Minutes of hour of day. Must be from 0 to 59.
Seconds of minutes of the time. Must be from 0 to 59
Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.
bidTimeTo
object
Represents a time of day. The date and time zone are not significant
Hours of day in 24 hour format. Must be from 0 to 23
Minutes of hour of day. Must be from 0 to 59.
Seconds of minutes of the time. Must be from 0 to 59
Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.
(Optional) A limit for the number of bids that can be placed daily.
dailySpendLimit
object
Represents an amount of money with its currency type.
The whole units of the amount.
For example if currencyCode
is "USD"
, then 1 unit is one US dollar.
Number of nano (10^-9) units of the amount.
The value must be between -999,999,999 and +999,999,999 inclusive.
If units
is positive, nanos
must be positive or zero.
If units
is zero, nanos
can be positive, zero, or negative.
If units
is negative, nanos
must be negative or zero.
For example $-1.75 is represented as units
=-1 and nanos
=-750,000,000.
Responses
- 200
- default
OK
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
campaign
object
required
A Campaign to bid on Data Instances.
The Campaign identifier.
The Account identifier in which the Campaign has been created.
The Data Specification identifier that the Campaign targets.
The name of the Campaign.
bidAmount
object
required
Represents an amount of money with its currency type.
The whole units of the amount.
For example if currencyCode
is "USD"
, then 1 unit is one US dollar.
Number of nano (10^-9) units of the amount.
The value must be between -999,999,999 and +999,999,999 inclusive.
If units
is positive, nanos
must be positive or zero.
If units
is zero, nanos
can be positive, zero, or negative.
If units
is negative, nanos
must be negative or zero.
For example $-1.75 is represented as units
=-1 and nanos
=-750,000,000.
query
object
required
A query containing conditions that all need to match against a Data Instance.
conditions
object[]
required
The query conditions.
The name of the property on the Data Instance as defined in the Data Specification.
(Optional) If a given Data Instance is missing a value for the property that this condition targets, should this condition be considered a match. This value can only be specified for properties that are not required on the Data Specification.
onWin
object
required
Preferences for being notified.
The email address to which to send notifications.
The phone number to which to send notifications.
Whether to notify by email to the given email address.
Whether to notify by text message to the given phone number.
Metadata provided if the Campaign wins a Data Instance.
onLose
object
required
Preferences for being notified.
The email address to which to send notifications.
The phone number to which to send notifications.
Whether to notify by email to the given email address.
Whether to notify by text message to the given phone number.
Whether the Campaign should use global bid preferences defined at the Organization level.
bidPreferences
object
required
Preferences for when to bid and limits on bidding.
Whether bids should be placed on Mondays.
Whether bids should be placed on Tuesdays.
Whether bids should be placed on Wednesdays.
Whether bids should be placed on Thursdays.
Whether bids should be placed on Fridays.
Whether bids should be placed on Saturdays.
Whether bids should be placed on Sundays.
bidTimeFrom
object
Represents a time of day. The date and time zone are not significant
Hours of day in 24 hour format. Must be from 0 to 23
Minutes of hour of day. Must be from 0 to 59.
Seconds of minutes of the time. Must be from 0 to 59
Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.
bidTimeTo
object
Represents a time of day. The date and time zone are not significant
Hours of day in 24 hour format. Must be from 0 to 23
Minutes of hour of day. Must be from 0 to 59.
Seconds of minutes of the time. Must be from 0 to 59
Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.
(Optional) A limit for the number of bids that can be placed daily.
dailySpendLimit
object
Represents an amount of money with its currency type.
The whole units of the amount.
For example if currencyCode
is "USD"
, then 1 unit is one US dollar.
Number of nano (10^-9) units of the amount.
The value must be between -999,999,999 and +999,999,999 inclusive.
If units
is positive, nanos
must be positive or zero.
If units
is zero, nanos
can be positive, zero, or negative.
If units
is negative, nanos
must be negative or zero.
For example $-1.75 is represented as units
=-1 and nanos
=-750,000,000.
The status of a Campaign.
Possible values: [RUNNING
, STOPPED
]
The date time at which the Campaign was created.
{
"campaign": {
"campaignId": "string",
"accountId": "string",
"dataSpecificationId": "string",
"name": "string",
"bidAmount": {
"currencyCode": "string",
"units": "string",
"nanos": 0
},
"query": {
"conditions": [
{
"propertyName": "string",
"condition": "string",
"matchMissingValue": true
}
]
},
"onWin": {
"email": "string",
"mobileNumber": "string",
"notifyByEmail": true,
"notifyByTextMessage": true
},
"onWinMetadata": "string",
"onLose": {
"email": "string",
"mobileNumber": "string",
"notifyByEmail": true,
"notifyByTextMessage": true
},
"useGlobalBidPreferences": true,
"bidPreferences": {
"bidOnMonday": true,
"bidOnTuesday": true,
"bidOnWednesday": true,
"bidOnThursday": true,
"bidOnFriday": true,
"bidOnSaturday": true,
"bidOnSunday": true,
"bidTimeFrom": {
"hours": 0,
"minutes": 0,
"seconds": 0,
"nanos": 0
},
"bidTimeTo": {
"hours": 0,
"minutes": 0,
"seconds": 0,
"nanos": 0
},
"dailyLimit": 0,
"dailySpendLimit": {
"currencyCode": "string",
"units": "string",
"nanos": 0
}
},
"status": "RUNNING",
"created": "2024-07-29T15:51:28.071Z"
}
}
Error
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
An error status code describing the response.
Enum Value | Description |
---|---|
0 | OK |
1 | Cancelled |
2 | Unknown |
3 | InvalidArgument |
4 | DeadlineExceeded |
5 | NotFound |
6 | AlreadyExists |
7 | PermissionDenied |
8 | ResourceExhausted |
9 | FailedPrecondition |
10 | Aborted |
11 | OutOfRange |
12 | Unimplemented |
13 | Internal |
14 | Unavailable |
15 | DataLoss |
16 | Unauthenticated |
Possible values: [0
, 1
, 2
, 3
, 4
, 5
, 6
, 7
, 8
, 9
, 10
, 11
, 12
, 13
, 14
, 15
, 16
]
A developer-facing error message
details
object[]
A list of messages containing details about the errors
{
"code": 0,
"message": "string",
"details": [
{
"@type": "string"
}
]
}