CityGrid Advertising APIs
Campaign Status API
Introduction
The CityGrid Campaign/Adgroup Status API is part of the Advertising API suite and generates a list of reasons why a campaign and/or adgroup is not active. Report information is available in both JSON or XML.
Contents
- 1 Introduction
- 2 Endpoint
- 2.1 Request Parameters
- 2.2 Request Header Values
- 2.3 Request Examples
- 2.4 Response Properties
- 2.5 Response Examples
- 2.5.1 Success Response
- 2.5.2 Error Response
Endpoint
The operation is invoked via HTTPS GET to:
Request Parameters
Parameter | Description | Required | Type | Default | Example |
|---|---|---|---|---|---|
| Comma-separated list of campaign IDs. If specified, externalCampaignId must be left empty. | No | Long |
| 4352,8473,242 |
| Comma-separated list of external IDs of the campaign. If specified, campaignId must be left empty. | No | Long |
| 1,2,3,4 |
Request Header Values
Header | Description | Required | Valid Values |
|---|---|---|---|
| Requested format for the response | Yes |
|
| Authentication Token from the Authentication API | Yes | Valid token |
| The token received during registration | Yes | Valid token |
Request Examples
Example 1: Get the pending campaign and/or adgroup explanation(s) for all campaign owned by the authToken.
curl -X GET \
-H 'Accept:application/json' \
-H 'authToken:mytoken' \
'https://api.citygrid.com/advertising/campaign/v2/status'
Example 2: Get the pending campaign/adgroup explanation for two campaigns
curl -X GET \
-H 'Accept:application/json' \
-H 'authToken:mytoken' \
'https://api.citygrid.com/advertising/campaign/v2/status?campaignId=3229772,2719172'
Response Properties
Property | Type | Description |
|---|---|---|
| Response Metadata | |
| Integer | Total number of campaigns in the response. |
| String | The campaign ID. |
| String | External ID of the campaign. |
| String | Arbitrary campaign name, not shown in the ads. |
| {ACTIVE, CANCELLED, PENDING} | Status of the campaign in the system: Active: Campaign is serving ads Cancelled: User cancelled the campaign Pending: Campaign is not serving ads. See reasons for an explanation on why its not serving. |
| String | ID of the ad group. |
| String | The reason a campaign or adgroup is not active. |
Response Examples
Success Response
The following shows success responses in JSON and XML format.
JSON
{
"totalNumEntries": 2,
"campaigns": [
{
"campaignId": "3303582",
"externalCampaignId": "",
"campaignName": "106233",
"status": "Pending",
"adGroups": [
{
"adGroupId": "43054742",
"reasons": [
"Unmatched Place Info"
]
}
],
"reasons": [
]
},
{
"campaignId": "3334552",
"externalCampaignId": "",
"campaignName": "103336",
"status": "PENDING",
"adGroups": [
],
"reasons": [
"Campaign has no adgroups"
]
}
],
"response": {
"code": "SUCCESS",
"message": "Success",
"field": ""
}
}
XML
<results>
<totalNumEntries>2</totalNumEntries>
<campaigns>
<campaign>
<campaignId>3303582</campaignId>
<externalCampaignId/>
<campaignName>106233</campaignName>
<status>Pending</status>
<adgroups>
<adgroup>
<adGroupId>43054742</adGroupId>
<reasons>
<reason>Unmatched Place Info</reason>
</reasons>
</adgroup>
</adgroups>
<reasons/>
</campaign>
<campaign>
<campaignId>3334552</campaignId>
<externalCampaignId/>
<campaignName>103336</campaignName>
<status>PENDING</status>
<adgroups/>
<reasons>
<reason>Campaign has no adgroups</reason>
</reasons>
</campaign>
</campaigns>
<response>
<code>SUCCESS</code>
<field/>
<message>Success</message>
</response>
</results>
Error Response
The following shows error responses (in JSON and XML format) when campaignId are not comma separated numbers.
JSON
{
"totalNumEntries": 0,
"campaigns": [
],
"response": {
"code": "PARAMETER_FORMAT",
"message": "The parameter, campaignId, is formatted incorrectly. Valid formats are numbers separated by comma.",
"field": "campaignId"
}
}
XML
<results>
<totalNumEntries>0</totalNumEntries>
<campaigns/>
<response>
<code>PARAMETER_FORMAT</code>
<field>campaignId</field>
<message>The parameter, campaignId, is formatted incorrectly. Valid formats are numbers separated by comma.</message>
</response>
</results>