Create Macro


                https://api.ocamba.com/v2/adex/macros
            

Creates a new Macro object


Name
Description
descriptionstring
A description of the macro. Maximum 2000 characters.


Example: An example of a basic macro

fields[ string ]
An array of strings representing parameters by which to dynamically pick a value. Maximum 3 elements.

namestringrequired
Name of the macro. Accepts only alphanumeric characters, words separated by underscore. Maximum 100 characters. Name must be unique.


Example: MY_FIRST_MACRO

recordsobject

Name
Description
ab_test_idstring
Represents an ab test id, length must be between 5 and 10 characters.

ab_test_variation_idstring
Represents an ab test variation id, length must be between 5 and 10 characters.

campaign_idstring
Represents a campaign id, length must be exactly 10.

country_codestring
Must be a valid country code supported by Ocamba.

creative_idstring
Represents a creative id, length must be between 7 and 10.

dsp_account_idstring
Represents a dsp account id, length must be between 7 and 10.

exchange_idstring
Represents an external demand id, length must be between 5 and 10 characters.

hood_container_idstring
Represents a container id, length must be between 3 and 10 characters.

language_codestring
Must be a valid language code supported by Ocamba.

push_app_idstring
Represents a tag id, length must be between 3 and 10 characters. This field is deprecated and will be removed in future. Please use hood_container_id as a replacement.

ssp_account_idstring
Represents an ssp account id, length must be between 7 and 10.

user_agestring
Represents users age. Accepted formats are 'from-to', 'from-', 'from' and '-to' where from and to represent start and end point of an age range.

valuestring
Macro default value. Required if field 'fields' is not present. Must only contain alphanumerics, dashes or underscores.


Example: this_is_a_value
200 Arrow
{
  "name":"some_macro",
  "description":"macro magic",
  "value":"default_value",
  "fields": [
      "country_code", "language_code", "creative_id"
  ],
  "records": [
      {
        "fields": {
            "country_code": "RS",
            "language_code": "sr",
            "creative_id": "1330685"
        },
        "value": "value_1"
      },
      {
        "fields": {
            "country_code": "GB",
            "language_code": "en",
            "creative_id": "1330685"
        },
        "value": "value_2"
      }
  ]
}
201 Arrow
{
  "id": "1000252",
  "company_id": "1331131",
  "name": "SOME_MACRO",
  "type": "dynamic",
  "description": "macro magic",
  "value": "default_value",
  "fields": [
      "country_code",
      "language_code",
      "creative_id"
  ],
  "records": [
      {
          "fields": {
              "creative_id": "1330685",
              "country_code": "RS",
              "language_code": "sr"
          },
          "value": "value_1"
      },
      {
          "fields": {
              "creative_id": "1330685",
              "country_code": "GB",
              "language_code": "en"
          },
          "value": "value_2"
      }
  ],
  "size": 2
}