View Tasks targeting a container

View Tasks targeting a container

GET https://api.ocamba.com/v1/hood/containers/{id}/tasks
Retrieves the details of Scheduled Tasks that explicitely or implicitely through groups, accounts and containers fragment targeting a specific container.

Rate limits:

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

Path parameters

parameters

Query parameters

parameters

Response schemas

curl -X GET \
 "https://api.ocamba.com/v1/hood/containers/{id}/tasks" \
  -H "Authorization: Bearer {TOKEN}"
const url = 'https://api.ocamba.com/v1/hood/containers/{id}/tasks';
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/{id}/tasks");
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": 1,
  "items": [
    {
      "id": 1057,
      "name": "Example task name",
      "start_time": "2021-12-28 09:16:33",
      "end_time": "2021-12-28 11:00:00",
      "frequency": 3600,
      "cron": "0 0 * * *",
      "ttl": 2400,
      "user_time_zone": 1,
      "quiet_time": {
        "from": 2,
        "to": 12
      },
      "next_execution_time": "2022-01-01 00:00:00",
      "last_execution_time": "2021-12-31 00:00:00",
      "create_time": "2021-12-20 17:14:56",
      "targeting": {
        "countries": {
          "items": [
            "US"
          ],
          "op": "include"
        },
        "regions": {
          "items": [
            "2661876"
          ],
          "op": "include"
        },
        "apps": {
          "items": [
            "21048"
          ],
          "op": "include"
        },
        "segments": {
          "items": [
            "2817"
          ],
          "op": "include"
        },
        "languages": {
          "items": [
            "en"
          ],
          "op": "include"
        },
        "os": {
          "items": [
            "4"
          ],
          "op": "include"
        },
        "browsers": {
          "items": [
            "12"
          ],
          "op": "include"
        },
        "groups": {
          "items": [
            "164"
          ],
          "op": "include"
        },
        "application_groups": {
          "items": [
            "164"
          ],
          "op": "include"
        },
        "accounts": {
          "items": [
            "2661876"
          ],
          "op": "include"
        },
        "applications": {
          "items": [
            "2661876"
          ],
          "op": "include"
        },
        "user_data": {
          "key": "clicker",
          "value": {}
        },
        "subscribed_age": {},
        "remote_users": {
          "items": [
            "81d650d5-3f17-4d20-9571-84e5578f4de2"
          ],
          "op": "include"
        },
        "users": {
          "items": [
            "1231241563"
          ],
          "op": "include"
        },
        "segment_lists": {
          "items": [
            "1000114"
          ],
          "op": "include"
        },
        "utm_sources": {
          "items": [
            "Facebook"
          ],
          "op": "include"
        }
      },
      "message": {
        "title": {
          "key": "en",
          "value": "Title example"
        },
        "body": {
          "key": "en",
          "value": "Hello world"
        },
        "image": {
          "key": "en",
          "value": "https://www.exampleimage.com/"
        },
        "landing_url": "https://www.landingurl.com/",
        "icon": "https://www.iconexample.com",
        "tag": "tag",
        "require_interaction": "1",
        "renotify": "0",
        "silent": "0",
        "vibration": "100,100",
        "badge": "https://www.badgeexample.com",
        "actions": {
          "action": "null",
          "title": "{\n  \"en\": \"en_title\"\n  \"de\": \"de_title\"\n}",
          "icon": "https://www.iconexample.com",
          "url": "https://www.urlexample.com"
        }
      },
      "adex": {
        "zone_id": 1000321,
        "account_id": "123456,654321",
        "campaign_id": "1367890,1098763",
        "group_id": "113,22,374",
        "default_campaign_id": 1036975,
        "number_of_messages": 4,
        "repeat_on_click": 1,
        "fallback_message": {
          "title": "Important Update Available",
          "body": "Please check your app for the latest updates and features.",
          "image": "https://example.com/images/notification-banner.jpg",
          "icon": "https://example.com/icons/app-icon.png",
          "landing_url": "https://example.com/landing/notification",
          "tag": "urgent-update",
          "require_interaction": "1",
          "renotify": "0",
          "silent": "0",
          "vibration": "100,100",
          "badge": "https://example.com/badges/notification-badge.png",
          "actions": [
            {
              "title": "View Details",
              "icon": "https://example.com/icons/action-icon.png",
              "url": "https://example.com/action/learn-more"
            }
          ]
        }
      }
    }
  ]
}

400 Bad Request

{
  "code": 400,
  "title": "Bad request.",
  "message": "The request body 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

Note
If executed without the ’explicit’ query parameter, it will show all the tasks implicitely targeting a specific container. The endpoint will return all the tasks regardless of status by default. If you wish to see only active tasks, filter by status.
Tip

Searchable field is name.

Sortable fields are: next_execution_time, last_execution_time, create_time, start_time, name, total_user, status.