Campaigns

/v3/campaigns

Returns a list of campaigns for a user.

This endpoint is only available to Bitly Enterprise customers.

Authentication: oauth2

Return Values

  • campaigns (list)
    • campaign_id - The unique identifier of this campaign (string)
    • title - The short title of the campaign (string)
    • description - The description of the campaign (string)
    • modified - Unix timestamp indicating when the campaign was last modified (integer)
    • bitlink_count - The count of bitlinks across all channels in the campaign (integer)

Example Request

API Address: https://api-ssl.bitly.com
GET /v3/campaigns?access_token=ACCESS_TOKEN

Example Response

{
  "data": {
    "campaigns": [
      {
        "bitlink_count": 1, 
        "campaign_id": "fc2c1nlSjYB", 
        "description": "Testing campaign on android", 
        "login": "qaenterprise", 
        "modified": 1449060921, 
        "title": "Test the graph"
      }, 
      {
        "bitlink_count": 2, 
        "campaign_id": "fatf5bjTMa", 
        "description": "asdfaesfdas", 
        "login": "qaenterprise", 
        "modified": 1446131111, 
        "title": "super cool new campaign"
      }, 
      {
        "bitlink_count": 6, 
        "campaign_id": "f8ri1r1hhLQ1", 
        "description": "Testtttttttt", 
        "login": "qaenterprise", 
        "modified": 1440701989, 
        "title": "Test Campaign"
      }
    ], 
    "result_count": 9
  }, 
  "status_code": 200, 
  "status_txt": "OK"
}

/v3/campaigns/channel_names

Lists channel names for user.

This endpoint is only available to Bitly Enterprise customers.

Authentication: oauth2

Return Values

  • channel_names - A list of channel names across all campaigns (list of strings)

Example Request

API Address: https://api-ssl.bitly.com
GET /v3/campaigns/channel_names?access_token=ACCESS_TOKEN

Example Response

{
  "data": {
    "channel_names": [
      "Email", 
      "Facebook", 
      "Instagram", 
      "SMS", 
      "Twitter", 
      "Snapchat", 
      "Display", 
      "Channel 1", 
      "Power Rangers", 
      "Bumble", 
      "Search", 
      "The Wasteland"
    ]
  }, 
  "status_code": 200, 
  "status_txt": "OK"
}

/v3/campaigns/create

Creates a campaign for a user.

This endpoint is only available to Bitly Enterprise customers.

Authentication: oauth2

Parameters

  • title - the title of the campaign
  • description - optional the description for the campaign
  • channel - the name of the channels associated with a campaign. May be specified multiple times, e.g. channel=Instagram&channel=Email

Return Values

  • campaign
    • campaign_id - The unique identifier of this campaign (string)
    • title - The short title of the campaign (string)
    • description - The description for the campaign (string)
    • modified - Unix timestamp indicating when the channel was last modified (integer)
    • channel_names - A list of channel names created with the campaign (list of strings)

Example Request

API Address: https://api-ssl.bitly.com
GET /v3/campaigns/create?access_token=ACCESS_TOKEN&description=hello&channel=Pinterest&title=examplesample

Example Response

{
  "data": {
    "campaign": {
      "campaign_id": "fcuh1qnu1fx", 
      "channel_names": [
        "Facebook", 
        "Pinterest"
      ], 
      "description": "hello", 
      "login": "qaenterprise", 
      "modified": 1451498303, 
      "title": "examplesample"
    }
  }, 
  "status_code": 200, 
  "status_txt": "OK"
}

/v3/campaigns/get

Returns a campaign and its channels and associated links.

This endpoint is only available to Bitly Enterprise customers.

Authentication: oauth2

Parameters

  • campaign_id - the id of the campaign

Return Values

  • campaigns (list)
    • campaign_id - The unique identifier of this campaign (string)
    • title - The short title of the campaign (string)
    • description - The description of the campaign (string)
    • has_deeplinks - True if any channel in the campaign has deeplinks (bool)
    • channels (list)
      • name - The name of the channel (e.g. "Facebook", "Email") (string)
      • modified - Unix timestamp indicating when the channel was last modified (integer)
      • has_deeplinks - True if any link in the channel is a deeplink (bool)
      • links (list)
        • link - The URL of the bitlink (string)
        • long_url - The URL of the destination (string)
        • hash - The bitly hash identifier for the bitlink (string)
        • title - The extracted page title for the bitlink (string)
        • keyword_link - The keyword URL of the bitlink, if a keyword was assigned for this link, otherwise null (string)

Example Request

API Address: https://api-ssl.bitly.com
GET /v3/campaigns/get?access_token=ACCESS_TOKEN&campaign_id=fatf5bjTMa

Example Response

{
  "data": {
    "campaign": {
      "campaign_id": "fatf5bjTMa", 
      "channels": [
        {
          "has_deeplinks": false, 
          "links": [], 
          "modified": 1448992687, 
          "name": "Channel 1"
        }, 
        {
          "has_deeplinks": true, 
          "links": [
            {
              "hash": "GT4bjF", 
              "link": "http://huff.to/GT4bjF", 
              "long_url": "http://www.huffingtonpost.com/mark-godsey/for-the-first-time-ever-a_b_4221000.html", 
              "title": "For the First Time Ever, a Prosecutor Will Go to Jail for Wrongfully Convicting an Innocent Man\u00a0|\u00a0Mark Godsey"
            }, 
            {
              "hash": "1r0qPl7", 
              "keyword_link": "http://bitly.qa/yahoo", 
              "link": "http://bitly.qa/1r0qPl7", 
              "long_url": "http://www.yahoo.com/", 
              "title": null
            }
          ], 
          "modified": 1447776946, 
          "name": "Display"
        }
      ], 
      "description": "asdfaesfdas", 
      "has_deeplinks": true, 
      "title": "super cool new campaign"
    }
  }, 
  "status_code": 200, 
  "status_txt": "OK"
}

/v3/campaigns/update

Updates a campaign.

This endpoint is only available to Bitly Enterprise customers.

Authentication: oauth2

Parameters

  • campaign_id - the id of the campaign
  • title - the title for the campaign
  • description - optional the description for the campaign
  • channel - the names of the channels associated with a campaign. May be specified multiple times, e.g. channel=Instagram&channel=Email

Return Values

  • campaign
    • campaign_id - The unique identifier of this campaign (string)
    • title - The short title of the campaign (string)
    • description - The description for the campaign (string)
    • channel_names - A list of channel names currently in the campaign (list of strings)

Example Request

API Address: https://api-ssl.bitly.com
GET /v3/campaigns/update?access_token=ACCESS_TOKEN&title=new_title_time&description=new_description_time&channel=new_channel_2&campaign_id=fcuh1qnu1fx

Example Response

{
  "data": {
    "campaign": {
      "campaign_id": "fcuh1qnu1fx", 
      "channel_names": [
        "new_channel_2", 
        "new_channel_1", 
        "Facebook"
      ], 
      "description": "new_description_time", 
      "login": "qaenterprise", 
      "title": "new_title_time"
    }
  }, 
  "status_code": 200, 
  "status_txt": "OK"
}