Use this endpoint to get all campaigns for an ad account. Optionally, you can use filters in your request to return only certain campaigns.
Request
End Point https://business.newsbreak.com/business-api/v1/campaign/getList
Method GET
Header
| Field | Required | Data Type | Description |
|---|---|---|---|
| Access-Token | Y | string | Authorized access token. |
Request Parameters
| Field | Required | Data Type | Description |
|---|---|---|---|
| adAccountId | Y | string | ID of ad account. |
| search | N | string | Query to search. |
| onlineStatus | N | enumerate[] | Campaign status filter. Available values: WARNING, INACTIVE, ACTIVE, DELETED. |
| pageNo | Y | integer | Page number. |
| pageSize | Y | integer | Page size. Available values: 5, 10, 20, 50, 100, 200, 500. |
Example
curl --location --request GET 'https://business.newsbreak.com/business-api/v1/campaign/getList?adAccountId=12345&search=11111111&onlineStatus=WARNING&onlineStatus=ACTIVE&pageNo=1&pageSize=5' \
-H 'Content-Type: application/json' \
-H 'Access-Token:{{Access-Token}}'
Response
Response Parameters
| Field | Data Type | Description |
|---|---|---|
| code | int | Status code, see Return Codes |
| errMsg | string | Error message when code!=0 |
| data | object | Response object. |
| └── pageNo | int | Number of current page. |
| └── pageSize | int | Size of current page. |
| └── total | int | Total size for this search. |
| └── hasNext | bool | Whether there is next page. |
| └── rows | object[] | Each row is a campaign. |
| └── id | string | Campaign ID |
| └── name | string | Campaign name |
| └── orgId | string | Organization ID |
| └── adAccountId | string | Ad account ID |
| └── objective | string | Objective of campaign. |
| └── budget | int | Campaign budget. |
| └── onlineStatus | String | Online status of the campaign. |
| └── status | String | Campaign status. |
| └── createTime | String | Create time of the campaign. |
| └── updateTime | String | Update time of the campaign. |
Example
{
"code": 0,
"data": {
"rows": [
{
"id": "11111111",
"orgId": "11111111",
"adAccountId": "111111111",
"name": "my campaign",
"createTime": 1689880761,
"updateTime": 1698196169,
"objective": "REACH",
"budget": 10000,
"onlineStatus": "ACTIVE",
"status": "OFF",
"createTime": "1700000000",
"updateTime": "1710000000"
}
],
"pageNo": 1,
"pageSize": 5,
"total": 1,
"hasNext": false
}
}