View Macro


                https://api.ocamba.com/v2/adex/macros/{id}
            

Get an instance of macros


Name
Description
idstringrequired
Macro id.


Example: 15

Name
Description
fieldsstring
The client can request more efficient filtered representation of the resource showing only specific field(s), using the “fields” query parameter. Note that the “fields” parameter has precedence over the “view” parameter.

Example GET /VERSION/adex/RESOURCE_NAME?fields=id,name

See "Tips" for the list of filterable parameters.


Example: fields=field1,field2,field3

viewstring
Adex API returns full representation of the resource using the “view=full” query parameter. If not specified, the default view will be used.

Note that the “fields” parameter has precedence over the “view” parameter.


Example: view=full/default

sortstring
Sorts the response by specified field(s) with the option to specify sorting order (ascending by default, add prefix "-" for descending).

Examples:
GET /VERSION/adex/RESOURCE_NAME?sort=name → sorts per name, ascending
GET /VERSION/adex/RESOURCE_NAME?sort=-id → sorts per id descending
GET /VERSION/adex/RESOURCE_NAME?sort=id,-name → sorts per id ascending, then name descending

See tips for the list of sortable fields.


Example: sort=-field1,field2

pagestring
The page number indicates which set of items will be returned in the response. The format of request is "page=N,M" where 'N' (required) represents page number and 'M' (optional) is number of items per page.

Examples:
N=1, M=20 → returns page 1 with 20 items
N=2, M=20 → returns page 2 with 20 items (items 21-40)
N=3 → returns page 3. The number of objects returned depends on the resource settings.


Example: page=1,10

valuestring
Default value.


Example: value=some_value

sizestring
Number of records.


Example: size=3


200 - OK
Arrow
Name
Description
company_idstring
A unique company identifier generated by the Ocamba platform.


Example: 7196310

create_timestring
Timezone: GMT.


Example: 2023-04-06 06:53:29

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.

idstring
A unique identifier generated by the Ocamba platform.


Example: 10001233

namestring
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.

sizenumber (integer)
Represents a number of records in a macro. Automatically set by an API.

typestring
Describes the type of the macro. Possible values are dynamic and system. All user created macros get type dynamic.

update_timestring
Timezone: GMT.


Example: 2023-04-06 06:53:29

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


Example: this_is_a_value

tip
1 Searchable fields are name and description.

2 Sortable fields are name, create_time and update_time.
info
1 The response example is representing a full view.

200 Arrow
{
  "total": 1,
  "items": [
    {
      "id": "1130251",
      "company_id": "6197120",
      "name": "SOME_MACROS",,
      "type": "dynamic", 
      "description": "description",
      "value": "10",
      "fields": [
          "ssp_account_id",
          "campaign_id",
          "ab_test_id"
      ],
      "records": [
          {
              "fields": {
                  "ssp_account_id": "5436620746",
                  "ab_test_id": "1130594",
                  "campaign_id": "24809540"
              },
              "value": "5"
          }
      ],
      "size": 1,
      "create_time": "2023-10-18 07:40:33",
      "update_time": "2023-10-18 07:40:56"
    }
  ]
}

{
  "id": "10001233",
  "company_id": "7196310",
  "name": "MY_FIRST_MACRO",
  "description": "An example of a basic macro",
  "value": "this_is_a_value",
  "fields": [
    [
      "ssp_account_id",
      "campaign_id",
      "push_app_id"
    ]
  ],
  "records": {},
  "create_time": "2023-04-06 06:53:29",
  "update_time": "2023-04-06 06:53:29"
}