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 support for a Developer Token. You will then have access to developer docs in the top menu and your endpoints.
Versions
Do Gooder updates our API from time to time to add features. To ensure backwards compatibility with your integrations we do not force the updates on you. Instead we provide a new API version. You can either choose to use this manually by selecting it in your Account Admin page, or add to your parameters explicitly (with ?version=VERSION-NUMBER).
Version 1.0
Uses timestamps without a time-zone (shown in examples below)
Version 1.1
Uses timestamps with the time-zone set in your Account Admin.
Consistent boolean values for "embedded" within form_data.
(See API Documentation for more detail - available from the top menu on Pro accounts. Contact support for API access.)
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: until timestamp threshold for the latest action date.
/api/action-log-feed/?until=[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." } ] }
