ads.check
Check ads attributes before create or update.
If the response status is 206, it means that ad does not contain errors
and will be accepted, but we still have some suggestions for it.
In this case the response still contains the diagnostics, with type=warnings.
For example, ad with errors and corresponding response looks like this:
ads.check(
..., [{
"creative1": "foo.foo!",
"creative2": "bar",
"creative3": "",
"clickthruText": "www.seznam.cz",
"clickthruUrl": "http://www.seznam.cz",
...
}])
=>
{
diagnostics = (
[0] = {
field = "creative1"
id = "exclamation_mark_in_title"
requestId = 0
type = "error"
}
[1] = {
field = "common"
id = "consecutive_same_words"
requestId = 0
type = "warning"
}
[2] = {
field = "creative1"
id = "missing_space_after_dot"
requestId = 0
type = "warning"
}
[3] = {
field = "creative3"
id = "missing_text"
requestId = 0
type = "error"
}
)
status = 406
statusMessage = "Bad values of attributes Some element(s) has(have) bad values of attributes!"
}
This ad would not be accepted in ads.create() and ads.update() methods, because it contains some errors.
Another example:
ads.check(
..., [{
"creative1": "foo.foo",
"creative2": "bar",
"creative3": "test",
"clickthruText": "www.seznam.cz",
"clickthruUrl": "http://www.seznam.cz",
...
}])
=>
{
diagnostics = (
[0] = {
field = "creative1"
id = "missing_space_after_dot"
requestId = 0
type = "warning"
}
)
session = "user-session-xxx"
status = 206
statusMessage = "Partially OK Some element(s) has(have) been processed incorrectly!"
}
This ad would be accepted in ads.create() and ads.update() methods, because it contains only warnings.
Parameters
struct |
user { |
|
string |
session |
Session (as retrieved from client.loginByToken() )
|
int |
userId |
(optional) User ID
|
|
} |
|
|
array |
ads ( |
|
struct |
{ |
|
int |
requestId |
(optional) Chosen id to identify item in response and diagnostics
|
int |
groupId |
(optional) Group ID (Useful for duplicity check before create or update.
|
int |
id |
(optional) Ad ID (useful, when checking before ad update)
|
string |
adType |
(optional) Type of created ad: [default: eta]
-
eta :
Extended ad
-
combined :
Combined ad
-
branding :
Branding ad
-
dynamicBanner :
Dynamic banner
|
string |
name |
(optional) Ad name (only for adType in ["branding"])
|
string |
headline1 |
(optional) Headline 1 (only for adType="eta")
|
string |
headline2 |
(optional) Headline 2 (only for adType="eta")
|
string |
headline3 |
(optional) Headline 3 (only for adType="eta")
|
string |
path1 |
(optional) Part path 1 (only for adType="eta")
|
string |
path2 |
(optional) Part path 2 (only for adType="eta")
|
string |
longLine |
(optional) Long line (only for adType="combined")
|
string |
shortLine |
(optional) Short line (only for adType="combined")
|
string |
companyName |
(optional) Company or brand name (only for adType="combined")
|
string |
colorAccent |
(optional) (can be null) Accent color in HEX format without leading # character (only for adType="combined")
|
string |
colorMain |
(optional) (can be null) Main color in HEX format without leading # character (only for adType="combined")
|
binary |
image |
(optional) Image data (jpg, png, gif) (excludes: imageId, imageMeta) (only for adType in ["combined", "branding"] ; .options.checkDuplicity=False)
|
binary |
imageLogo |
(optional) Image data (jpg, png, gif) (excludes: imageLogoId, imageLogoMeta) (only for adType="combined" ; .options.checkDuplicity=False)
|
binary |
imageSquare |
(optional) Image data (jpg, png, gif) (excludes: imageSquareId, imageSquareMeta) (only for adType="combined" ; .options.checkDuplicity=False)
|
binary |
imageLandscapeLogo |
(optional) Image data (jpg, png, gif) (excludes: imageLandscapeLogoId, imageLandscapeLogoMeta) (only for adType="combined" ; .options.checkDuplicity=False)
|
int |
imageSquareId |
(optional) id square image (excludes: imageSquare, imageSquareMeta) (only for adType="combined")
|
int |
imageLogoId |
(optional) (can be null) id landscape image (excludes: imageLogo, imageLogoMeta) (only for adType="combined")
|
int |
imageLandscapeLogoId |
(optional) (can be null) Id image logo (excludes: imageLandscapeLogo, imageLandscapeLogoMeta) (only for adType="combined")
|
struct |
imageLogoMeta { |
(optional) (can be null) logo image metadata (excludes: imageLogo, imageLogoId) (only for adType="combined" ; .options.checkDuplicity=False)
|
int |
width |
image width in pixels
|
int |
height |
image height in pixels
|
int |
size |
image size in bytes
|
|
} |
|
|
struct |
imageLandscapeLogoMeta { |
(optional) (can be null) landscape image metadata (excludes: imageLandscapeLogo, imageLandscapeLogoId) (only for adType="combined" ; .options.checkDuplicity=False)
|
int |
width |
image width in pixels
|
int |
height |
image height in pixels
|
int |
size |
image size in bytes
|
|
} |
|
|
struct |
imageSquareMeta { |
(optional) square image metadata (excludes: imageSquare, imageSquareId) (only for adType="combined" ; .options.checkDuplicity=False)
|
int |
width |
image width in pixels
|
int |
height |
image height in pixels
|
int |
size |
image size in bytes
|
|
} |
|
|
string |
description |
(optional) Description (only for adType in ["eta", "combined"])
|
string |
description2 |
(optional) Description 2 (only for adType="eta")
|
string |
finalUrl |
(optional) Final URL (only for adType in ["eta", "combined", "branding"])
|
string |
mobileFinalUrl |
(optional) Mobile final URL (only for adType in ["eta", "combined"])
|
string |
trackingTemplate |
(optional) Tracking template (only for adType in ["eta", "combined", "branding"])
|
string |
impressionTrackingTemplate |
(optional) Tracking template (only for adType in ["combined", "branding"])
|
string |
impressionTrackingTemplate2 |
(optional) Tracking template 2 (only for adType in ["combined", "branding"])
|
int |
imageId |
(optional) image id (excludes: image, imageMeta) (only for adType in ["combined", "branding"])
|
struct |
imageMeta { |
(optional) image metadata (excludes: image, imageId) (only for adType in ["combined", "branding"] ; .options.checkDuplicity=False))
|
int |
width |
image width in pixels
|
int |
height |
image height in pixels
|
int |
size |
image size in bytes
|
|
} |
|
|
string |
premiseMode |
(optional) Premise display mode (for connection with catalog Firmy.cz) (only for adType in ["eta", "banner"]):
-
disabled :
Assigned premise is not shown
-
one :
Premise specified in premiseId is shown
-
nearest :
Client nearest premise is shown
|
int |
premiseId |
(optional) (can be null) Premise id - for connection with catalog Firmy.cz (only for premiseMode='one';adType in ["eta", "banner"])
|
int |
dynamicTemplateId |
(optional) Id of dynamic template (only for adType="dynamicBanner")
|
array |
schedule ( |
(optional) (can be null) Delivery schedule of ad. Array of 7 days, week starts at monday.
|
) |
|
|
|
} |
|
|
|
) |
|
|
struct |
options { |
(optional) Options for checks [default: see below]
|
bool |
checkDuplicity |
(optional) Check duplicity [default: True]
|
bool |
checkRules |
(optional) Check all ad's rules (excludes duplicity) [default: True]
|
bool |
checkRequired |
(optional) Check required parameters [default: True]
|
|
} |
|
|
Response
struct |
{ |
|
string |
statusMessage |
Status code description
|
string |
session |
Refreshed session
|
array |
diagnostics ( |
(optional) Array of 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:
ad_access_denied
ad_attribute_no_change
ad_duplicate_in_db
ad_duplicate_in_request
bad_length
bad_url
bad_url_text
clickthruText_is_too_long
clickthruUrl_is_too_long
companyName_is_too_long
consecutive_same_words
consecutive_two_and_more_punctuation_chars
consecutive_two_and_more_uppercase
creative1_is_too_long
creative2_is_too_long
creative3_is_too_long
description2_is_too_long
description_is_too_long
exclamation_mark_in_title
exclusive_struct_field
failed_checksum_calculation
finalUrl_is_too_long
group_access_denied
headline1_is_too_long
headline2_is_too_long
headline3_is_too_long
hyphen_at_the_end
image_access_denied
image_height_too_low
image_no_access
image_no_rule_set_passed
image_ratio_incorrect
image_size_too_large
image_width_too_low
impressionTrackingTemplate2_is_too_long
impressionTrackingTemplate_is_too_long
invalid_chars
invalid_schedule_day_size
invalid_schedule_size
left_parenthesis_at_the_end
longLine_is_too_long
missing_required_attribute
missing_space_after_colon
missing_space_after_comma
missing_space_after_dot
missing_space_after_exclamation_mark
missing_space_after_hyphen
missing_space_after_question_mark
missing_space_after_right_parenthesis
missing_space_after_semicolon
missing_space_before_hyphen
missing_space_before_left_parenthesis
missing_text
mobileFinalUrl_is_too_long
more_then_one_exclamation_mark_in_text
nine_and_more_uppercase
not_allowed_for_campaign_type
path1_is_too_long
path2_is_too_long
path2_set_path1_unset
path_contains_unsupported_characters
punctuation_char_at_the_begin
schedule_value_too_large
schedule_value_too_low
shortLine_is_too_long
space_after_left_parenthesis
space_before_colon
space_before_comma
space_before_dot
space_before_exclamation_mark
space_before_question_mark
space_before_right_parenthesis
space_before_semicolon
trackingTemplate_is_too_long
user_access_denied
words_more_than_three_times_in_all_text
wrong_attribute