campaigns.create
Create new campaigns.
Use campaigns.check() for checking data before submitting them.
Parameters
struct |
user { |
|
string |
session |
Session (as retrieved from client.loginByToken() )
|
int |
userId |
(optional) User ID
|
|
} |
|
|
array |
campaigns ( |
|
struct |
{ |
|
string |
name |
Campaign name
|
int |
dayBudget |
Campaign daily budget (in halers; 100 = 1 Kc)
|
array |
excludedSearchServices ( |
(optional) Excluded search services (only for type in ["fulltext", "product"])
|
int
|
|
|
Search service id (see listSearchServices() for search service enumeration)
|
|
) |
|
|
array |
excludedUrls ( |
(optional) Excluded URLs (only for type in ["context", "product"])
|
string
|
|
|
URL to be excluded from context targeting (format "http://hotdog.com")
|
|
) |
|
|
array |
negativeKeywords ( |
(optional) Negative keywords (for all groups in this campaign) (only for type in ['context', 'fulltext', 'product'])
|
struct |
{ |
|
string |
name |
Negative keyword
|
string |
matchType |
(optional) Negative keyword match type: [default: negativeBroad]
-
negativeBroad :
Negative broad match (default); query must not contain words from this keyword
-
negativePhrase :
Negative phrase match; query must not contain keyword words in correct order
-
negativeExact :
Negative exact match; query must not exactly match this keyword
|
|
} |
|
|
|
) |
|
|
int |
totalBudget |
(optional) (can be null) Campaign total budget limit (in halers) or nil for no limit (default)
|
int |
totalClicks |
(optional) (can be null) Campaign total clicks limit or nil for no limit (default) (only for type in ['context', 'fulltext', 'product'])
|
string |
adSelection |
(optional) Ad selection strategy [default: weighted] (only for type in ["fulltext", "context"]):
-
weighted :
Prefer an ad with higher CTR (default)
-
random :
Every ads with same frequency only for type in ['combined', 'video', 'context', 'product', 'zbozi', 'social', 'simple']
-
cpa :
Prefer an ad with lower CPA
-
cos :
Prefer an ad with lower CTR
|
datetime |
startDate |
(optional) (can be null) Campaign start date; default: nil
|
datetime |
endDate |
(optional) (can be null) Campaign end date; default: nil
|
string |
status |
(optional) Set campaign status: [default: active]
-
active :
Active (default)
-
suspend :
Suspended
|
string |
type |
Type of campaign (cannot be changed):
-
fulltext :
fulltext campaign
-
context :
context campaign
-
product :
product campaign
-
video :
video campaign
-
simple :
simple ads campaign
-
zbozi :
non default zbozi.cz campaign
|
string |
paymentMethod |
(optional) Payment method for paying for ads (only for type=context):
-
cpc :
Payment per click
-
cpm :
Payment per thousand views
|
array |
regions ( |
(optional) Geotargeting
|
struct |
{ |
|
int |
predefinedId |
(optional) Predefined region id only if type is predefined.
|
|
} |
|
|
|
) |
|
|
array |
schedule ( |
(optional) (can be null) Spending schedule of campaign. Array of 7 days, week starts at monday.
|
) |
|
|
struct |
premise { |
(optional) Connection with Firmy.cz (only for type=fulltext)
|
int |
id |
(optional) (can be null) Connection with Firmy.cz
|
string |
defaultMode |
(optional) Firmy.cz connection display mode:
-
disabled :
No branch is displayed (default)
-
one :
Premise specified in defaultPremiseId is shown
-
nearest :
Client nearest premise is shown
|
int |
defaultId |
Branch premise id for connection with catalog Firmy.cz) (only for defaultMode=one)
|
|
} |
|
|
struct |
devicesPriceRatio { |
(optional) Specific ratio of max CPC/CPT for target device (These values override values in targetDevices)
|
int |
desktop |
(optional) Desktop/Notebook devices
|
int |
mobile |
(optional) Smartphones/Mobile devices
|
int |
tablet |
(optional) Tablet devices
|
int |
other |
(optional) Other devices
|
|
} |
|
|
string |
videoFormat |
(optional)(only for type=video) Sets allowed videoformat type [default: both]:
-
both :
Include instream and outstream (default)
-
instream :
campaign allows only instream format
-
outstream :
campaign allows only outstream format
|
string |
zboziBiddingType |
(optional) (only for type=zbozi) Zbozi.cz bidding type
|
int |
zboziPremiseId |
(optional) (only for type=zbozi) Zbozi.cz premise to link the campaign to
|
|
} |
|
|
|
) |
|
|
Response
struct |
{ |
|
string |
statusMessage |
Status code description
|
string |
session |
Refreshed session
|
array |
campaignIds ( |
Campaign ID of new created campaigns
|
|
) |
|
|
array |
diagnostics ( |
(optional) Various diagnostics(warnings, errors, other information)
|
|
) |
|
|
|
} |
|
|
Response status codes:
List of all possible response status codes:
200: OK
206: Partially OK
301: User is serviced
400: Bad arguments
401: Invalid session
403: Access Denied
404: Not found
406: Bad values of attributes
413: Too many items requested.
429: Too many requests. Has to wait.
500: Server Error.
409: Conflict
Diagnostics:
List of all possible diagnostics:
at_least_one_device_has_to_be_selected
attribute_cannot_be_updated_in_zbozi_campaign
campaign_bad_excluded_search_services
campaign_bad_region_predefinedId
campaign_context_network_out_range
campaign_dayBudget_is_too_high
campaign_dayBudget_is_too_low
campaign_excluded_url_error
campaign_invalid_schedule_day_size
campaign_invalid_schedule_size
campaign_name_duplicity
campaign_name_missing
campaign_no_network
campaign_startDate_after_endDate
campaign_totalBudget_is_too_high
campaign_totalBudget_is_too_low
campaign_totalClicks_is_too_high
campaign_totalClicks_is_too_low
campaign_type_cannot_be_changed
dayBudget_or_sharedBudgetId_must_be_set
group_access_denied
missing_mandatory_attribute_for_zbozi_campaign
missing_struct_field
not_allowed_for_campaign_type
only_for_struct_field
only_for_value_struct_field
user_access_denied
zbozi_campaign_not_allowed_for_premise_controllable_from_zbozi