Sklik API

Ads

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.login())
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: text]
  • text: Text ad
  • eta: Extended ad
  • combined: Combined ad
  • branding: Branding ad
string name (optional) Ad name (only for adType in ["branding"])
string creative1 (optional) Ad title (only for adType="text")
string creative2 (optional) Ad second line (only for adType="text")
string creative3 (optional) Ad third line (only for adType="text")
string clickthruText (optional) URL that will be displayed (only for adType="text")
string clickthruUrl (optional) Final URL (only for adType="text")
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")
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 ["eta", "combined"])
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):
  • 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
}
)
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 {
int status Status code
string statusMessage Status code description
string session Refreshed session
array diagnostics ( (optional) Array of various diagnostics(warnings, errors, other information)
struct {
...
}
)
}

Response status codes:

List of all possible response status codes:

Diagnostics:

List of all possible diagnostics:

            
        

Copyright © 1996-2019

www.seznam.cz   Help   Contact