Skip to main content
Do Gooder's API

Introduction to our API

David Gravina avatar
Written by David Gravina
Updated over a week ago


Do Gooder has two APIs. The first is our native API which is the most data rich and comprehensive and the one used by most customers.

This API includes specific end points for individual Campaign Data, Activity Feeds and Action Logs (which include all data entered by supporters) to ingest that data into your own systems via our endpoints.

Getting started

Our APIs are available on our Goodest Pro Plan. Contact us to upgrade if you are not already on that plan level. If you are already on a Pro plan contact us also and we will set you up a Developer Token. You will then have access to your developer docs and endpoints.


Developer Information

Authentication

At the moment all API endpoints require a token for use. The token provides access to only information within your account. Since tokens provide access to information within your account, they should be kept private. Token can only be created by Do Gooder. If there are no tokens listed below, please contact us.

Token XXXXXX

To access an API endpoint include a valid token in the Authorization HTTP header. The value of the header should be the word Token followed by a space followed by your token. Here is an example:

GET /campaign/ HTTP/1.1 Host: example.com Authorization: Token XXXXX

Campaign Web APIs

The Campaign Web APIs are for accessing data relating to your account's campaigns.

Campaign Information

Returns information about all campaigns in an account. Information includes title, description, urls, actions, etc.

/api/campaigns/

Optional: a comma separated list of campaign IDs specified as a query string campaign_ids.

/api/campaigns/?campaign_ids=[IDs]

Optional: a comma separated list of campaign IDs specified as a query string campaign_ids.

/api/campaigns/?since=[timestamp]

Example requests:

/api/campaigns/?since=2019-03-29T12%3A00%3A00 /api/campaigns/?campaign_ids=2,3,4 /api/campaigns/?campaign_ids=2

Example response:

{ "count": 1, "next": null, "previous": null, "results": [ { "id": 1, "name": "Example cause", "description": "This is an example.", "country": "AU", "country_display": "Australia", "state": "A", "state_display": "Active", "result": "U", "result_display": "Undetermined", "campaign_url": "http://example.good.do/example/", "external_url": "", "image": null, "video": "", "background_image": null, "languages": [ { "code": "en", "display": "English" } ], "actions": [ { "id": 3, "title": "Sign Petition", "description": "Show your support fo example.", "goal_phrase": "signatures" }, { "id": 4, "title": "Email Example Office", "description": "", "goal_phrase": "emails sent" } ], "featured_action": null } ] }

Campaign Action Summary

Returns a summary of actions for campaigns. It includes date and times of first and last actions and counts of each action type. The API can only summarize up to 100 campaigns.

Required: a comma separated list of campaign IDs specified as a query string campaign_ids.

/api/action-summary/?campaign_ids=[IDs]

Example requests:

/api/action-summary/?campaign_ids=2,3,4 /api/action-summary/?campaign_ids=2

Example response:

{ "count": 1, "summary": { "campaign_ids": [ 2 ], "first_action_taken": "2016-08-19T13:51:00.195", "last_action_taken": "2016-08-19T15:39:08.270", "action_count": 2, "emails_sent": 1, "petitions_signed": 1, "donations_made": 0, "calls_made": 0 }, "details": [ { "campaign_id": 2, "campaign_name": "Example cause", "first_action_taken": "2016-08-19T13:51:00.195", "last_action_taken": "2016-08-19T15:39:08.270", "action_count": 2, "emails_sent": 1, "petitions_signed": 1, "donations_made": 0, "calls_made": 0 } ] }

Action Log Feed

Returns a feed the latest action log entries for the entire account. It includes the campaign, action, and form data submitted by the supporter.

Optional: a comma separated list of campaign IDs specified as a query string campaign_ids.

/api/action-log-feed/?campaign_ids=[IDs]

Optional: since timestamp threshold for the earliest action date.

/api/action-log-feed/?since=[timestamp]

Optional: ordering by created (oldest first), or -created (newest first, default)

/api/action-log-feed/?ordering=created

Example requests:

/api/action-log-feed/ /api/action-log-feed/?campaign_ids=2,3,4 /api/action-log-feed/?campaign_ids=2 /api/action-log-feed/?campaign_ids=2&since=2019-03-29T12%3A00%3A00 /api/action-log-feed/?campaign_ids=2&since=2019-03-29T12%3A00%3A00&ordering=created

Example response:

{ "count": 2, "next": null, "previous": null, "results": [ { "id": 1, "email": "[email protected]", "subscribed_to_campaign": null, "test": false, "created": "2019-03-29T14:55:13.330162", "campaign": { "id": 1, "name": "Campaign Number One" }, "action": { "id": 1, "title": "Action Number One", "action_type": "email_politician" }, "form_data": { "first_name": "Person" "last_name": "One", "utm_source": "google", ... } }, { "id": 2, "email": "[email protected]", "subscribed_to_campaign": null, "test": false, "created": "2019-03-29T14:55:13.330162", "campaign": { "id": 1, "name": "Campaign Number One" }, "action": { "id": 1, "title": "Action Number One", "action_type": "email_politician" }, "form_data": { "first_name": "Person" "last_name": "Two", "utm_source": "my-site", ... } }, ] }

Campaign Activity Feed

Returns a feed of latest activity for campaigns. It includes date and times of first and last actions and counts of each action type. The feed is limited to the latest 100 actions.

Required: a comma separated list of campaign IDs specified as a query string campaign_ids.

/api/activity-feed/?campaign_ids=[IDs]

Example requests:

/api/activity-feed/?campaign_ids=2,3,4 /api/activity-feed/?campaign_ids=2

Example response:

{ "count": 2, "next": null, "previous": null, "results": [ { "name": "Joe", "action_verb": "email", "country_code": "AU", "country_name": "Australia", "timestamp": "2016-08-19T17:06:19.144", "campaign_id": 2, "campaign_name": "Example cause", "message": "Joe in Australia emailed 3 days ago." }, { "name": "Sally", "action_verb": "sign", "country_code": "AU", "country_name": "Australia", "timestamp": "2016-08-19T14:18:38.858", "campaign_id": 2, "campaign_name": "Example cause", "message": "Sally in Australia signed 3 days ago." } ] }


OSDI API


NOTE: The OSDI project has stalled and there is a dispute that has resulted in no further work being done on it – so we are not supporting or planning to enhance this API at the current time.

We also have an experimental implementation of Open Supporter Data Interface. It allows campaigners to access their account data, like supporters, actions, and campaigns.

The current implementation is geared toward information access, not content creation. All of the endpoints within the Do Gooder OSDI implementation are read-only.

The OSDI specification documents can be found at https://opensupporter.github.io/osdi-docs/


Getting started 

The OSDI API implements the JSON+HAL spec. The spec makes the API easy to understand and use for both people and machines. 

You can browse the API using the HAL browser. You can checkout the various libraries and tools available for HAL based APIs.

The API entry point (AEP) is https://api.good.do/osdi/v1/


The API entry point doesn’t require authentication, but most other endpoints will. Authentication occurs with a token via HTTP header or query string. You can obtain an API token for your account from the token page.

OSDI-API-Token: your_api_key_here

or  

Did this answer your question?