Tutorial: Get Actions
This tutorial demonstrates how to get a list of events (or any other action), view details about the action, and view a list of people who have taken that action.
Steps:
Calling the events collection
From the API entry point, navigate to the action type you'd like to call. In this tutorial, we'll be getting a list of events for an account. Call the events collection like so:
GET https://actionnetwork.org/api/v1/events/
Header:
api-key:[your api key here]
Which will return a response like this:
200 OK Content-Type: application/hal+json Cache-Control: max-age=0, private, must-revalidate
{ "total_pages": 18, "per_page": 25, "page": 1, "total_records": 431, "_links": { "next": { "href": "https://actionnetwork.org/api/v1/events?page=2" }, "self": { "href": "https://actionnetwork.org/api/v1/events" }, "osdi:events": [ { "href": "https://actionnetwork.org/api/v1/events/12c9a105-1ab6-472e-ac04-667c521a5968" }, { "href": "https://actionnetwork.org/api/v1/events/6e3c4610-98d1-11e3-a2e9-12313d316c29" }, //truncated for brevity ], "curies": [ { "name": "osdi", "href": "https://actionnetwork.org/docs/v1/{rel}", "templated": true }, { "name": "action_network", "href": "https://actionnetwork.org/docs/v1/{rel}", "templated": true } ] }, "_embedded": { "osdi:events": [ { "identifiers": [ "action_network:12c9a105-1ab6-472e-ac04-667c521a5968" ], "status": "confirmed", "created_at": "2014-02-18T19:44:49Z", "modified_at": "2014-02-25T16:08:26Z", "summary": "Resist Testing!", "description": "<p>Join our event and resist corporate testing!</p>", "action_network:event_instructions": "<p>Attendee instructions</p>", "url": "https://actionnetwork.org/events/resist-testing", "start": "2014-02-21T10:45:00Z", "transparence": "opaque", "visibility": "public", "guestsCanInviteOthers": true, "reminders": { [ "method": "email", "minutes": 1440 ] }, "total_accepted": 7, "_embedded": { "osdi:creator": { "given_name": "John", "family_name": "Doe", "identifiers": [ "action_network:c945d6fe-929e-11e3-a2e9-12313d316c29" ], "email_addresses": [ { "primary": true, "address": "johndoe@mail.com" } ], "postal_addresses": [ { "primary": true, "address_lines": [ "1600 Pennsylvania Ave." ], "locality": "Washington", "region": "DC", "postal_code": "20009", "country": "US", "language": "en", "location": { "latitude": 38.919, "longitude": -77.0379, "accuracy": "Approximate" } } ], "_links": { "self": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29" }, "osdi:question_answers": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29/question_answers" }, "osdi:attendance": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29/attendance" }, "osdi:signatures": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29/signatures" }, "osdi:submissions": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29/submissions" }, "osdi:donations": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29/donations" }, "curies": [ { "name": "osdi", "href": "https://actionnetwork.org/docs/v1/{rel}", "templated": true }, { "name": "action_network", "href": "https://actionnetwork.org/docs/v1/{rel}", "templated": true } ] } }, "osdi:organizer": { "given_name": "John", "family_name": "Doe", "identifiers": [ "action_network:c945d6fe-929e-11e3-a2e9-12313d316c29" ], "email_addresses": [ { "primary": true, "address": "johndoe@mail.com" } ], "postal_addresses": [ { "primary": true, "address_lines": [ "1600 Pennsylvania Ave." ], "locality": "Washington", "region": "DC", "postal_code": "20009", "country": "US", "language": "en", "location": { "latitude": 38.919, "longitude": -77.0379, "accuracy": "Approximate" } } ], "_links": { "self": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29" }, "osdi:question_answers": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29/question_answers" }, "osdi:attendance": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29/attendance" }, "osdi:signatures": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29/signatures" }, "osdi:submissions": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29/submissions" }, "osdi:donations": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29/donations" }, "curies": [ { "name": "osdi", "href": "https://actionnetwork.org/docs/v1/{rel}", "templated": true }, { "name": "action_network", "href": "https://actionnetwork.org/docs/v1/{rel}", "templated": true } ] } } }, "location": { "venue": "My house", "address_lines": [ "1600 Pennsylvanie Ave." ], "locality": "Washington", "region": "DC", "postal_code": "20009", "country": "US", "language": "en", "location": { "latitude": 38.9205626691329, "longitude": -77.0422188108486, "accuracy": "Rooftop" } }, "_links": { "self": { "href": "https://actionnetwork.org/api/v1/events/12c9a105-1ab6-472e-ac04-667c521a5968" }, "osdi:attendance": { "href": "https://actionnetwork.org/api/v1/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendance" }, "osdi:organizer": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29" }, "osdi:creator": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29" }, "action_network:embed": { "href": "https://actionnetwork.org/api/v1/events/12c9a105-1ab6-472e-ac04-667c521a5968/embed" }, "curies": [ { "name": "osdi", "href": "https://actionnetwork.org/docs/v1/{rel}", "templated": true }, { "name": "action_network", "href": "https://actionnetwork.org/docs/v1/{rel}", "templated": true } ] } }, { "identifiers": [ "action_network:6e3c4610-98d1-11e3-a2e9-12313d316c29" ], "status": "confirmed", "created_at": "2014-01-31T19:05:36Z", "modified_at": "2014-01-31T19:07:01Z", "summary": "I'm having a house party!", "description": "<p>Come to my house party!</p>", "action_network:event_instructions": "<p>Bring food and a friend</p>", "url": "https://actionnetwork.org/events/house-party-3", "start": "2014-02-01T04:30:00Z", "transparence": "opaque", "visibility": "public", "guestsCanInviteOthers": true, "reminders": { [ "method": "email", "minutes": 1440 ] }, "total_accepted": 2, "_embedded": { "osdi:creator": { "given_name": "John", "family_name": "Doe", "identifiers": [ "action_network:c945d6fe-929e-11e3-a2e9-12313d316c29" ], "email_addresses": [ { "primary": true, "address": "johndoe@mail.com" } ], "postal_addresses": [ { "primary": true, "address_lines": [ "1600 Pennsylvania Ave." ], "locality": "Washington", "region": "DC", "postal_code": "20009", "country": "US", "language": "en", "location": { "latitude": 38.919, "longitude": -77.0379, "accuracy": "Approximate" } } ], "_links": { "self": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29" }, "osdi:question_answers": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29/question_answers" }, "osdi:attendance": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29/attendance" }, "osdi:signatures": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29/signatures" }, "osdi:submissions": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29/submissions" }, "osdi:donations": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29/donations" }, "curies": [ { "name": "osdi", "href": "https://actionnetwork.org/docs/v1/{rel}", "templated": true }, { "name": "action_network", "href": "https://actionnetwork.org/docs/v1/{rel}", "templated": true } ] } }, "osdi:organizer": { "given_name": "John", "family_name": "Doe", "identifiers": [ "action_network:c945d6fe-929e-11e3-a2e9-12313d316c29" ], "email_addresses": [ { "primary": true, "address": "johndoe@mail.com" } ], "postal_addresses": [ { "primary": true, "address_lines": [ "1600 Pennsylvania Ave." ], "locality": "Washington", "region": "DC", "postal_code": "20009", "country": "US", "language": "en", "location": { "latitude": 38.919, "longitude": -77.0379, "accuracy": "Approximate" } } ], "_links": { "self": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29" }, "osdi:question_answers": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29/question_answers" }, "osdi:attendance": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29/attendance" }, "osdi:signatures": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29/signatures" }, "osdi:submissions": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29/submissions" }, "osdi:donations": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29/donations" }, "curies": [ { "name": "osdi", "href": "https://actionnetwork.org/docs/v1/{rel}", "templated": true }, { "name": "action_network", "href": "https://actionnetwork.org/docs/v1/{rel}", "templated": true } ] } } }, "location": { "venue": "My house", "address_lines": [ "1600 Pennsylvania Ave." ], "locality": "Washington", "region": "DC", "postal_code": "20009", "country": "US", "language": "en", "location": { "latitude": 38.9205626691329, "longitude": -77.0422188108486, "accuracy": "Approximate" } }, "_links": { "self": { "href": "https://actionnetwork.org/api/v1/events/6e3c4610-98d1-11e3-a2e9-12313d316c29" }, "osdi:attendance": { "href": "https://actionnetwork.org/api/v1/events/6e3c4610-98d1-11e3-a2e9-12313d316c29/attendance" }, "osdi:organizer": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29" }, "osdi:creator": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29" }, "action_network:embed": { "href": "https://actionnetwork.org/api/v1/events/6e3c4610-98d1-11e3-a2e9-12313d316c29/embed" }, "curies": [ { "name": "osdi", "href": "https://actionnetwork.org/docs/v1/{rel}", "templated": true }, { "name": "action_network", "href": "https://actionnetwork.org/docs/v1/{rel}", "templated": true } ] } }, //truncated for brevity ] } }
In the response you are able to see and parse data about each event -- the event's name, the URL to the RSVP page on the Action Network, who created the event, the total number of RSVPs, etc... Each event has at least an Action Network ID as well, which is used to form URLs in the API.
You can use the links provided to navigate to each specific event, pull a list of all of the people who have RSVPed, or view the next page of event.
You can also use URL arguments to change how the paging works. Use ?page=[page number]
to jump to a specific page, and ?per_page=[number of items per page]
to control how many events are shown for each call. Note: You can retrieve a maximum of 25 resources per page.
Click here for full documentation of event resources.