List Containers

List Containers

GET https://api.ocamba.com/v1/hood/containers
Returns a list of Containers

Tip
Sortable fields are id, partner_id, account_id, name, status, create_time, update_time.
Warning
In order to read partner, account or stat fields you can use predefined response (view=full). At the moment it is not possible to read those fields using fields parameter (fields=partner,account,stats) and this kind of request will result with an error.

Rate limits:

  • Burst: 10/s
  • Steady: 150/m

Query parameters

parameters

Response schemas

curl -X GET \
 "https://api.ocamba.com/v1/hood/containers" \
  -H "Authorization: Bearer {TOKEN}"
const url = 'https://api.ocamba.com/v1/hood/containers';
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/v1/hood/containers");
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": 15,
  "items": [
    {
      "id": "1000000",
      "company_id": "1000001",
      "partner_id": "1000001",
      "partner": {
        "id": "1000001",
        "name": "some-site.com",
        "status": "active"
      },
      "account_id": "1000001",
      "account": {
        "id": "1000001",
        "name": "some-site.com",
        "status": "active"
      },
      "creator_id": "1000111",
      "enable_tags": true,
      "tags": [
        {
          "id": "1000001",
          "company_id": "1000000",
          "container_id": "1000",
          "status": "active",
          "type": "custom-code",
          "name": "My first tag",
          "triggers": {
            "element_visibility": {
              "selector": ".class",
              "when_to_fire": "once-per-page",
              "min_on_screen_time": 200,
              "observe_dom_changes": true
            },
            "scroll_depth": {
              "horizontal": {
                "percentage": 75,
                "pixels": 1223
              },
              "vertical": {
                "percentage": 75,
                "pixels": 1223
              }
            },
            "click_element": {
              "enabled": true,
              "element": "header"
            },
            "timer": 200,
            "custom_event": {
              "event": "my_event"
            },
            "require_all_triggers": true,
            "dom_content_ready": true
          },
          "filters": [
            {
              "variable": "1000231",
              "value": "Some-value",
              "filters": [
                {
                  "variable": "1000231",
                  "value": "Some-value"
                }
              ]
            }
          ],
          "group": "Group A",
          "target": {
            "element": "head",
            "action": "append"
          },
          "position": 3,
          "create_time": "2021-10-29 12:47:00",
          "update_time": "2021-10-30 14:27:26"
        }
      ],
      "enable_modals": true,
      "modals": [
        {
          "id": "1000001",
          "company_id": "1000001",
          "container_id": "1000",
          "status": "active",
          "type": "push",
          "name": "My first modal",
          "triggers": {
            "element_visibility": {
              "selector": ".class",
              "when_to_fire": "once-per-page",
              "min_on_screen_time": 200,
              "observe_dom_changes": true
            },
            "scroll_depth": {
              "horizontal": {
                "percentage": 75,
                "pixels": 1223
              },
              "vertical": {
                "percentage": 75,
                "pixels": 1223
              }
            },
            "click_element": {
              "enabled": true,
              "element": "header"
            },
            "timer": 200,
            "custom_event": {
              "event": "my_event"
            },
            "require_all_triggers": true,
            "dom_content_ready": true
          },
          "filters": [
            {
              "variable": "1000231",
              "value": "Some-value",
              "filters": [
                {
                  "variable": "1000231",
                  "value": "Some-value"
                }
              ]
            }
          ],
          "group": "Group A",
          "settings": {
            "position": "top-left",
            "background_color": "green",
            "height": 500,
            "width": 700,
            "close_cta": true,
            "close_esc": true,
            "close_click": true,
            "close_auto": 3000,
            "delay": 2000,
            "animation": "slide-up"
          },
          "ab_test_config": {
            "num_of_appears": 1200,
            "evaluation_window": 72,
            "winning_metric": "click_rate",
            "name": "My first ab test",
            "winner_delivery_mode": "automatic"
          },
          "frequency": {
            "per_session": 1000,
            "per_day": 1000,
            "per_week": 1000,
            "once_per_period": 1000,
            "always_show": true,
            "stop_after_interaction": true,
            "show_cooldown": 1000
          },
          "messages": [
            {
              "id": "1000001",
              "company_id": "1000001",
              "container_id": "1000",
              "resource": "modal",
              "resource_id": "1001241",
              "experiment_id": "4245",
              "template_id": "2141",
              "name": "Big summer sale message",
              "settings": {
                "position": "top-left",
                "background_color": "green",
                "height": 500,
                "width": 700,
                "close_cta": true,
                "close_esc": true,
                "close_click": true,
                "close_auto": 3000,
                "delay": 2000,
                "animation": "slide-up"
              },
              "variant": "A",
              "winner": 1,
              "create_time": "2021-10-29 12:47:00",
              "update_time": "2021-10-30 14:27:26"
            }
          ],
          "position": 1,
          "impression_limit": 1000,
          "end_time": "2021-10-29 12:47:00",
          "create_time": "2021-10-29 12:47:00",
          "update_time": "2021-10-30 14:27:26"
        }
      ],
      "prompts": [
        {
          "id": "1000001",
          "uuid": "c3e25631-4030-409d-a021-5fb091b9d0b1",
          "company_id": "1000001",
          "container_id": "1000",
          "status": "active",
          "type": "html",
          "name": "My first prompt",
          "triggers": {
            "element_visibility": {
              "selector": ".class",
              "when_to_fire": "once-per-page",
              "min_on_screen_time": 200,
              "observe_dom_changes": true
            },
            "scroll_depth": {
              "horizontal": {
                "percentage": 75,
                "pixels": 1223
              },
              "vertical": {
                "percentage": 75,
                "pixels": 1223
              }
            },
            "click_element": {
              "enabled": true,
              "element": "header"
            },
            "timer": 200,
            "custom_event": {
              "event": "my_event"
            },
            "require_all_triggers": true,
            "dom_content_ready": true
          },
          "filters": [
            {
              "variable": "1000231",
              "value": "Some-value",
              "filters": [
                {
                  "variable": "1000231",
                  "value": "Some-value"
                }
              ]
            }
          ],
          "settings": {
            "position": "top-left",
            "background_color": "green",
            "height": 500,
            "width": 700,
            "close_cta": true,
            "close_esc": true,
            "close_click": true,
            "close_auto": 3000,
            "delay": 2000,
            "animation": "slide-up"
          },
          "ab_test_config": {
            "num_of_appears": 1200,
            "evaluation_window": 72,
            "winning_metric": "click_rate",
            "name": "My first ab test",
            "winner_delivery_mode": "automatic"
          },
          "messages": [
            {
              "id": "1000001",
              "company_id": "1000001",
              "container_id": "1000",
              "resource": "modal",
              "resource_id": "1001241",
              "experiment_id": "4245",
              "template_id": "2141",
              "name": "Big summer sale message",
              "settings": {
                "position": "top-left",
                "background_color": "green",
                "height": 500,
                "width": 700,
                "close_cta": true,
                "close_esc": true,
                "close_click": true,
                "close_auto": 3000,
                "delay": 2000,
                "animation": "slide-up"
              },
              "variant": "A",
              "winner": 1,
              "create_time": "2021-10-29 12:47:00",
              "update_time": "2021-10-30 14:27:26"
            }
          ],
          "position": 3,
          "create_time": "2021-10-29 12:47:00",
          "update_time": "2021-10-30 14:27:26"
        }
      ],
      "type": "web",
      "name": "Container Example",
      "description": "This is an example of description.",
      "status": "active",
      "applications": [
        {
          "app": "example-app.com",
          "create_time": "2021-10-30 14:27:26"
        }
      ],
      "icon": "https://dev-storage.ocamba.com/6197120/hood/containerss/1099/icons/favicon.ico",
      "utm_ht": "NjY4bL60N1eBPTQ2PC4xNDY4MjE0Njlh",
      "push": {
        "override": true,
        "apns_env": "production",
        "vapid_public_key": "BCNgZE2uKpC0T9rx65suEzjsXlNz3kXxcVHcFjQ6tDLQpF8lsFd1XBuwdZ2JHPzvU1A8X6QZFtN1w63imLqKNbs",
        "service_worker": {
          "path": "/sw.js",
          "scope": "example-scope"
        },
        "auto_resubscribe": true,
        "suppress_prompts_on_subdomains": true
      },
      "analytics": {
        "enabled": true,
        "domain": "t.ocmthood.com"
      },
      "crashlytics": {
        "enabled": true,
        "domain": "t.ocmthood.com"
      },
      "consent": {
        "enabled": true
      },
      "code": "<script>!function(h,oo,d,y,t,a,g){h[y]=t[y]||function(){(h[y].q=h[y].q||[]).push(arguments)},h[y].l=1*new Date,a=oo.createElement(d),g=oo.getElementsByTagName(d)[0],a.async=1,a.crossOrigin='anonymous',a.src=t,g.parentNode.insertBefore(a,g)}(window,document,'script','Hood','https://dev-sdk.ocmhood.com/sdk/ht.js?tag=NjY4bL60Nma9sTQ2AuAxNDY4MjE0NvHt');</script>",
      "code_snippet": "<script src=\"https://sdk.ocmcore.com/sdk/ht-latest.js\" data-tag=\"NjY4bL60N1eBPTQ2PC4xNDY4MjE0Njlh\"></script>",
      "stats": {
        "pageviews": 10,
        "sessions": 6,
        "users": 4,
        "push_subscriptions": 2,
        "push_unsubscriptions": 1
      },
      "autoconf_status": "active",
      "create_time": "2021-10-29 12:47:00",
      "update_time": "2021-10-30 14:27:26"
    }
  ]
}

400 Bad Request

{
  "code": 400,
  "title": "Bad request.",
  "message": "The request is not valid.",
  "trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}

500 Internal Server Error

{
  "code": 500,
  "title": "Internal server error.",
  "trace_id": "99a84211-f73d-4ff8-acdf-eb3e06bb9d62"
}
Responses