Campaigns Resource

List of API endpoints for the Campaigns resource.

Retrieve all Campaigns

GET https://www.dosomething.org/api/v2/campaigns

Get an index list of all campaigns, filterable using query parameters.

Query Parameters

Name
Type
Description

filter[id]

string

e.g.: 37,6LQzMvDNQcYQYwso8qSkQ8

{
  "data": [
    {
      "id": "6LQzMvDNQcYQYwso8qSkQ8",
      "legacyCampaignId": "1144",
      "legacyCampaignRunId": "7430",
      "type": "campaign",
      "title": "[Test] Teens for Jeans",
      "slug": "test-teens-for-jeans",
      "status": null,
      "endDate": {
        "date": "2019-01-01 12:00:00.000000",
        "timezone_type": 1,
        "timezone": "-06:00"
      },
      "callToAction": "Let's collect another million jeans TOGETHER.",
      "tagline": "Let's collect another million jeans TOGETHER.",
      "coverImage": {
        "description": null,
        "url":
          "https://images.ctfassets.net/81iqaqpfd8fy/4k8rv5sN0kii0AoCawc6UQ/c22c3c132d1bb43055b6bafc248fcea5/vn7gpbosm9rx.jpg",
        "landscapeUrl":
          "https://images.ctfassets.net/81iqaqpfd8fy/4k8rv5sN0kii0AoCawc6UQ/c22c3c132d1bb43055b6bafc248fcea5/vn7gpbosm9rx.jpg?w=1440&h=620&fm=jpg&fit=fill"
      },
      "actionText": "Join Now",
      "staffPick": null,
      "cause": null,
      "scholarshipAmount": null,
      "additionalContent": {
        "noun": {
          "plural": "jeans",
          "singular": "jean"
        },
        "verb": {
          "plural": "collected",
          "singular": "collected"
        }
      }
    },
    {
      "id": null,
      "legacyCampaignId": "37",
      "legacyCampaignRunId": "6188",
      "type": "campaign",
      "title": "Music March Out",
      "slug": null,
      "status": "active",
      "callToAction":
        "Run a musical walk out to defend music program funding at school.",
      "tagline":
        "Run a musical walk out to defend music program funding at school.",
      "coverImage": {
        "description": null,
        "url":
          "https://thor.dosomething.org/sites/default/files/styles/300x300/public/images/Music%20March%20Out%20square.jpg?itok=luE_GV4M",
        "landscapeUrl":
          "https://thor.dosomething.org/sites/default/files/styles/1440x810/public/images/Music%20March%20Out%20landscape.jpg?itok=EzoA7Zvn"
      },
      "staffPick": false,
      "cause": "education",
      "additionalContent": {
        "noun": {
          "singular": null,
          "plural": "Protesters"
        },
        "verb": {
          "singular": null,
          "plural": "Attended"
        }
      }
    }
  ]
}

Retrieve a single Campaign

GET https://www.dosomething.org/api/v2/campaigns/:id

Get a single campaign using a specified id.

Path Parameters

Name
Type
Description

id

string

e.g.: 6LQzMvDNQcYQYwso8qSkQ8

The id can be either a Contentful ID or an Ashes Legacy ID.

Retrieve all Posts for a Campaign

GET https://www.dosomething.org/api/v2/campaigns/:id/posts

Get an index list of all posts for a specified campaign.

Path Parameters

Name
Type
Description

id

string

e.g.: 6LQzMvDNQcYQYwso8qSkQ8

The request is proxied to Rogue and automatically adds the filter[campaign_id]=:id to the query params.

Create a Post for a Campaign

POST https://www.dosomething.org/api/v2/campaigns/:id/posts

Path Parameters

Name
Type
Description

id

string

e.g.: 3455

The request is proxied to Rogue and automatically adds the filter[campaign_id]=:id to the query params.

Please refer to the Rogue API Documentation for further information.

Last updated