SysGetCampaignPage
Returns a page of the app's campaigns, filtered and sorted using the provided context. The response includes an encoded context string that you can pass to SysGetCampaignPageOffset to fetch the pages before or after it.
A single page returns at most 100 campaigns by default.
| Service | Operation |
|---|---|
| campaign | SYS_GET_CAMPAIGN_PAGE |
Method Parameters
| Parameter | Description |
|---|---|
| context | The JSON context for the page request. Supports pagination (rowsPerPage, pageNumber), searchCriteria (any simple campaign field, or dot-notation into target, scenarios or campaignJson) and sortCriteria (field name mapped to 1 for ascending or -1 for descending). |
Usage
http://localhost:3000
- C#
- C++
- Obj-C
- Java
- JavaScript
- Dart
- Roblox
- GDScript
- Lua
- Cloud Code
- Raw
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
// Cloud Code only. To view example, switch to the Cloud Code tab
-- N/A
N/A
-- Cloud Code only. To view example, switch to the Cloud Code tab
var context = {
"pagination": {
"rowsPerPage": 10,
"pageNumber": 1
},
"searchCriteria": {
"enabled": true,
"endAt": {
"$gt": 1811808000000
},
"target.type": "SEGMENT"
},
"sortCriteria": {
"createdAt": -1
}
};
var campaignProxy = bridge.getCampaignServiceProxy();
var postResult = campaignProxy.sysGetCampaignPage(context);
{
"service": "campaign",
"operation": "SYS_GET_CAMPAIGN_PAGE",
"data": {
"context": {
"pagination": {
"rowsPerPage": 10,
"pageNumber": 1
},
"searchCriteria": {
"enabled": true,
"endAt": {
"$gt": 1811808000000
},
"target.type": "SEGMENT"
},
"sortCriteria": {
"createdAt": -1
}
}
}
}
JSON Response
{
"data": {
"context": "eyJzZWFyY2hDcml0ZXJpYSI6eyJlbmFibGVkIjp0cnVlfSwic29ydENyaXRlcmlhIjp7ImNyZWF0ZWRBdCI6LTF9LCJwYWdpbmF0aW9uIjp7InJvd3NQZXJQYWdlIjoxMCwicGFnZU51bWJlciI6MX19",
"results": {
"count": 11,
"page": 1,
"items": [
{
"campaignCode": "SUMMER2026",
"name": "Summer 2026",
"purpose": "Evaluating impact of themes and summer sale on spenders",
"category": null,
"enabled": true,
"startAt": 1811808000000,
"endAt": 1814227200000,
"trigger": "LOGIN",
"target": {
"type": "SEGMENT",
"segmentCode": "spenders"
},
"scenarios": [
{
"scenarioCode": "_",
"weight": 100
}
],
"campaignJson": {
"customFieldA": "summer",
"customFieldB": 1,
"customFieldC": true
},
"abGoalType": "revenue",
"abConfidence": null,
"notes": null,
"version": 1,
"createdAt": 1811721600000,
"updatedAt": 1811721600000
}
],
"moreAfter": true,
"moreBefore": false
}
},
"status": 200
}
Common Error Codes
Status Codes
| Code | Name | Description |
|---|---|---|
| 40358 | MISSING_REQUIRED_PARAMETER | context was not specified. |
| 40660 | INVALID_PARAMETER_VALUE | searchCriteria or sortCriteria refers to a field that cannot be queried. |
| 40616 | CLOUD_CODE_ONLY_METHOD | The method was called from a client. It can only be called from Cloud Code or S2S. |
| 40731 | FEATURE_NOT_SUPPORTED_BY_BILLING_PLAN | Billing plan does not include the Campaign feature. Requires a plan that includes Enterprise features. |