List Macros

List Macros

GET https://api.ocamba.com/v2/adex/macros
Get a collection of macros.

Query parameters

parameters

Response schemas

curl -X GET \
 "https://api.ocamba.com/v2/adex/macros" \
  -H "Authorization: Bearer {TOKEN}"
const url = 'https://api.ocamba.com/v2/adex/macros';
const options = {
  method: 'GET',
  headers: {
    Authorization: `Bearer {TOKEN}`
  }
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
$ch = curl_init("https://api.ocamba.com/v2/adex/macros");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Authorization: Bearer {TOKEN}"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

Responses

200 OK

{
  "total": 20,
  "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": "1000248",
          "company_id": "6197120",
          "name": "SOME_MACRO_2",
          "type": "dynamic",
          "description": "description",
          "value": "value_default",
          "fields": [
              "campaign_id",
              "language_code",
              "creative_id"
          ],
          "records": [
              {
                  "fields": {
                      "campaign_id": "1225785716",
                      "creative_id": "1430685",
                      "language_code": "sr"
                  },
                  "value": "value3"
              },
              {
                  "fields": {
                      "campaign_id": "1225785716",
                      "creative_id": "1000685",
                      "language_code": "en"
                  },
                  "value": "vr1"
              }
          ],
          "size": 2,
          "create_time": "2023-10-17 09:57:03",
          "update_time": "2023-10-17 09:57:03"
      }
  ]
}
Responses

Tip
Searchable fields are name and description. Sortable fields are name, url, create_time and update_time. Filterable fields are id, name, type, size, create_time and update_time.
Info
The response example is representing a full view.