List Campaigns
List Campaigns
GET
https://api.ocamba.com/v1/hood/campaigns
Retrieves a list of campaigns. By default, the 10 last created campaigns are returned in the default view. To fetch additional results, use the page parameter. To fetch additional details about campaigns, use the full view or specify fields in the fields parameter.
Note
Sortable fields are: name, status, next_run_time, run_counter, create_time and update_time.
Searchable fields are: name and description.
Rate limits:
- Burst: 10/s
- Steady: 150/m
Query parameters
parametersResponse schemas
›
200
application/json
›
400
application/json
›
500
application/json
curl -X GET \
"https://api.ocamba.com/v1/hood/campaigns" \
-H "Authorization: Bearer {TOKEN}"const url = 'https://api.ocamba.com/v1/hood/campaigns';
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/campaigns");
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": 50,
"items": [
{
"id": "1000248",
"company_id": "1000000",
"creator_id": "1000223",
"creator": {
"id": "1000163",
"name": "John Doe",
"status": "active",
"image": "https://image-uri-example.com"
},
"name": "My First Campaign",
"description": "This is my first campaign on the Hood application.",
"labels": [
"cars",
"bwm",
"audi",
"volkswagen"
],
"metadata": {
"key": "key",
"value": "value"
},
"scheduled_time": "2024-10-06 10:00:00",
"was_launched": true,
"ab_test": {
"name": "My First A/B Test",
"test_split": 30,
"winning_metric": "click_rate",
"evaluation_window": "5D 20H 30M",
"winner_delivery_mode": "manual"
},
"messages": [
{
"id": "1024",
"company_id": "1000000",
"name": "My first Message",
"campaign_id": "1000222",
"channel": "email",
"integration_id": "0",
"template_id": "1024",
"primary_lang": "en",
"email": {
"sender_name": "John Doe",
"sender_email": "[email protected]",
"subject": "All products 20% off!",
"preheader": "Enjoy a 20% discount on all products from the assortment",
"reply_to": "[email protected]",
"html": {
"key": "en",
"value": "Title example"
}
},
"push": {
"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,200",
"badge": "https://www.badgeexample.com",
"actions": {
"title": {
"key": "en",
"value": "Click here"
},
"icon": "https://www.iconexample.com",
"url": "https://www.urlexample.com"
}
},
"sms": {
"content": {
"key": "en",
"value": "This is a custom SMS message, sent to you from Ocamba!"
}
},
"test_result": 33.33,
"winner": 1,
"create_time": "2021-10-29 12:47:00",
"update_time": "2021-10-30 14:27:26"
}
],
"end_time": "2024-10-06 10:00:00",
"next_run_time": "2024-10-06 09:00:00",
"last_run_time": "2024-10-06 09:00:00",
"recurrence": {
"pattern": {
"minute": 10,
"hour": 10,
"weekdays": [
4
],
"months": [
12
]
},
"cron": "0 0 * * *"
},
"utm_tracking": {
"enabled": 1,
"utm_source": "OCMH_UTM_SOURCE",
"utm_medium": "OCMH_UTM_MEDIUM",
"utm_campaign": "OCMH_CAMPAIGN_NAME",
"utm_term": "keyword",
"utm_id": "OCMH_CAMPAIGN_ID",
"utm_content": "html",
"custom": {
"key": "key"
}
},
"status": "scheduled",
"status_code": "start_time_in_future",
"is_draft": true,
"effective_status": "active",
"send_in_profile_time_zone": true,
"send_if_profile_time_passed": true,
"quiet_hours": {
"from": 2,
"to": 12
},
"last_run_initiator": "time_pattern",
"scheduled_run_times": [
{
"time": "2024-10-06 15:04:00",
"initiator": "time_pattern",
"skip": true
}
],
"max_runs": 2,
"targeting": {
"countries": {
"items": [
"US"
],
"op": "in"
},
"languages": {
"items": [
"en"
],
"op": "in"
},
"os": {
"items": [
"4"
],
"op": "in"
},
"browsers": {
"items": [
"12"
],
"op": "in"
},
"containers": {
"items": [
"2309876111"
],
"op": "in"
},
"groups": {
"items": [
"164"
],
"op": "in"
},
"application_groups": {
"items": [
"1014"
],
"op": "nin"
},
"regions": {
"items": [
"2661876"
],
"op": "in"
},
"partners": {
"items": [
"2661876"
],
"op": "in"
},
"applications": {
"items": [
"2661876"
],
"op": "in"
},
"engagement_score": {
"from": 11,
"to": 73
},
"profile_age": {
"from": 10,
"to": 100
},
"custom_properties": {
"value": {
"items": [
"foo"
],
"op": "in"
}
},
"profile_lists": {
"items": [
"1000114"
],
"op": "nin"
},
"segment_lists": {
"items": [
"1000114"
],
"op": "in"
},
"utm_sources": {
"items": [
"Facebook"
],
"op": "in"
}
},
"deal_id": "1000251",
"score": 20,
"stats": {
"total_user": 11,
"delivered": 11,
"failed": 11,
"conversion": 11,
"churn": 11.52
},
"run_counter": 2,
"evaluated": true,
"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