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 id (optional) Ad ID (useful, when checking before ad update)
string creative1 (optional) Ad title
string creative2 (optional) Ad second line
string creative3 (optional) Ad third line
string clickthruText (optional) URL that will be displayed
string clickthruUrl (optional) Target URL
int groupId (optional) Group ID (Useful for duplicity check before create or update.
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
}
)

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-2018

www.seznam.cz   Help   Contact