Get Campaign

Use a campaign ID to retrieve the details of an individual campaign.

Overview

This request requires an access token with “campaigns-read” scope.

URI

https://rest.bronto.com/campaigns/{campaignId}

Parameters

Parameter Type Description
campaignId Required number The ID for the campaign.

Response

A response containing the campaign with the given ID.

{
  "id": number,
  "siteId": number,
  "createdDate": org.joda.time.Datetime,
  "modifiedDate": org.joda.time.Datetime,
  "campaignTypeId": number,
  "name": string,
  "description": string,
  "archived": boolean
}

Python Code Example

from __future__ import print_function
 
# Requests documentation:  http://docs.python-requests.org/
import requests
 
 
# API authorization
bronto_access_token = "access token"
session = requests.Session()
session.headers["Authorization"] = "Bearer " + bronto_access_token
 
campaign_id = "123";
 
url_fmt = "https://rest.bronto.com/campaigns/{campaign_id}"
url = url_fmt.format(campaign_id=campaign_id)
 
response = session.get(url)
 
if response.ok:
    campaign = response.json()
    print("campaign:", campaign)
else:
    print("Could not get campaign " + campaign_id + " (status code={}, content='{}', headers={})".format(
        response.status_code, response.text, response.headers
    ))