Use this endpoint to create a campaign.
Request
End Point https://business.newsbreak.com/business-api/v1/campaign/create
Method POST
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. |
| name | Y | string | Descriptive name of campaign. |
| objective | Y | enumerate | Campaign objective. Available values: WEB_CONVERSION, APP_CONVERSION, REACH, WEB_TRAFFIC, APP_TRAFFIC. |
| status | N | enumerate | Status of the campaign. Available values: ON, OFF. Default is ON. |
Example
curl --location --request POST 'https://business.newsbreak.com/business-api/v1/campaign/create' \
-H 'Content-Type: application/json' \
-H 'Access-Token:{{Access-Token}}' \
-d '{
"name": "my campaign example",
"adAccountId": "123456789",
"objective": "WEB_CONVERSION"
}'
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. |
| └── id | string | Campaign ID. |
| └── name | string | Campaign name. |
| └── orgId | string | Organization ID. |
| └── adAccountId | string | Ad account ID. |
| └── objective | string | Objective of the campaign. |
| └── budget | int | Campaign budget in cents. |
| └── 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": {
"id": "987654321",
"orgId": "123456789",
"adAccountId": "123456789",
"name": "my campaign example",
"objective": "WEB_CONVERSION",
"budget": 1000,
"onlineStatus": "ACTIVE",
"status": "ON",
"createTime": "1700000000",
"updateTime": "1700000000"
}
}