Tutorial: Get Actions Version 2

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/v2/events/

Header:
OSDI-API-Token: your_api_key_here
		

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/v2/events?page=2"
    },
    "self": {
      "href": "https://actionnetwork.org/api/v2/events"
    },
    "osdi:events": [
      {
        "href": "https://actionnetwork.org/api/v2/events/12c9a105-1ab6-472e-ac04-667c521a5968"
      },
      {
        "href": "https://actionnetwork.org/api/v2/events/6e3c4610-98d1-11e3-a2e9-12313d316c29"
      },
      //truncated for brevity
    ],
    "curies": [
      {
        "name": "osdi",
        "href": "https://actionnetwork.org/docs/v2/{rel}",
        "templated": true
      },
      {
        "name": "action_network",
        "href": "https://actionnetwork.org/docs/v2/{rel}",
        "templated": true
      }
    ]
  },
  "_embedded": {
    "osdi:events": [
      {
          "identifiers": [
                 "action_network:12c9a105-1ab6-472e-ac04-667c521a5968"
            ],
            "origin_system": "Action Network",
            "status": "confirmed",
            "created_date": "2014-02-18T19:44:49Z",
            "modified_date": "2014-02-25T16:08:26Z",
            "title": "Resist Testing!",
            "description": "<p>Join our event and resist corporate testing!</p>",
            "action_network:event_instructions": "<p>Attendee instructions</p>",
            "browser_url": "https://actionnetwork.org/events/resist-testing",
            "start": "2014-02-21T10:45:00Z",
            "transparence": "opaque",
            "visibility": "public",
            "guests_can_invite_others": true,
            "capacity": 10,
            "reminders": {
              [
                "method": "email",
                "minutes": 1440
              ]
            },
            "total_accepted": 7,
            "action_network:hidden": false,
            "_embedded": {
              "osdi:creator": {
                "given_name": "John",
                "family_name": "Doe",
                "created_date": "2014-02-18T19:44:49Z",
                "modified_date": "2014-02-25T16:08:26Z",
                "identifiers": [
                     "action_network:c945d6fe-929e-11e3-a2e9-12313d316c29"
                ],
                "email_addresses": [
                  {
                    "primary": true,
                    "address": "johndoe@mail.com",
                    "status": "subscribed"
                  }
                ],
                "phone_numbers": [
                  {
                   "primary": true,
                   "number_type": "Mobile",
                   "status": "unsubscribed"
                  }
               ],
                "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"
                    }
                  }
                ],
                "languages_spoken": [
                  "en"
                ],
                "_links": {
                  "self": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29"
                  },
                  "osdi:attendances": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29/attendances"
                  },
                  "osdi:signatures": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29/signatures"
                  },
                  "osdi:submissions": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29/submissions"
                  },
                  "osdi:donations": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29/donations"
                  },
                  "osdi:outreaches": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29/outreaches"
                  },
                  "osdi:taggings": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29/taggings"
                  }
                }
              },
              "osdi:organizer": {
                "given_name": "John",
                "family_name": "Doe",
                "created_date": "2014-02-18T19:44:49Z",
                "modified_date": "2014-02-25T16:08:26Z",
                "identifiers": [
                     "action_network:c945d6fe-929e-11e3-a2e9-12313d316c29"
                ],
                "email_addresses": [
                  {
                    "primary": true,
                    "address": "johndoe@mail.com",
                    "status": "subscribed"
                  }
                ],
                "phone_numbers": [
                  {
                   "primary": true,
                   "number_type": "Mobile",
                   "status": "unsubscribed"
                  }
               ],
                "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"
                    }
                  }
                ],
                "languages_spoken": [
                  "en"
                ],
                "_links": {
                  "self": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29"
                  },
                  "osdi:attendances": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29/attendances"
                  },
                  "osdi:signatures": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29/signatures"
                  },
                  "osdi:submissions": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29/submissions"
                  },
                  "osdi:donations": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29/donations"
                  },
                  "osdi:outreaches": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29/outreaches"
                  },
                  "osdi:taggings": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29/taggings"
                  }
                }
              }
            },
            "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/v2/events/12c9a105-1ab6-472e-ac04-667c521a5968"
              },
              "osdi:attendances": {
                "href": "https://actionnetwork.org/api/v2/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendances"
              },
              "osdi:organizer": {
                "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29"
              },
              "osdi:creator": {
                "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29"
              },
              "action_network:embed": {
                "href": "https://actionnetwork.org/api/v2/events/12c9a105-1ab6-472e-ac04-667c521a5968/embed"
              },
              "record_attendance_helper": {
                "href": "https://actionnetwork.org/api/v2/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendances"
              }
            }
        },
        {
            "identifiers": [
                "action_network:6e3c4610-98d1-11e3-a2e9-12313d316c29"
            ],
            "origin_system": "Action Network",
            "status": "confirmed",
            "created_date": "2014-01-31T19:05:36Z",
            "modified_date": "2014-01-31T19:07:01Z",
            "title": "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>",
            "browser_url": "https://actionnetwork.org/events/house-party-3",
            "start": "2014-02-01T04:30:00Z",
            "transparence": "opaque",
            "visibility": "public",
            "guests_can_invite_others": true,
            "reminders": {
              [
                "method": "email",
                "minutes": 1440
              ]
            },
            "total_accepted": 2,
            "action_network:hidden": false,
            "_embedded": {
              "osdi:creator": {
                "given_name": "John",
                "family_name": "Doe",
                "created_date": "2014-02-18T19:44:49Z",
                "modified_date": "2014-02-25T16:08:26Z",
                "identifiers": [
                     "action_network:c945d6fe-929e-11e3-a2e9-12313d316c29"
                ],
                "email_addresses": [
                  {
                    "primary": true,
                    "address": "johndoe@mail.com",
                    "status": "subscribed"
                  }
                ],
                "phone_numbers": [
                  {
                   "primary": true,
                   "number_type": "Mobile",
                   "status": "unsubscribed"
                  }
               ],
                "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"
                    }
                  }
                ],
                "languages_spoken": [
                  "en"
                ],
                "_links": {
                  "self": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29"
                  },
                  "osdi:attendances": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29/attendances"
                  },
                  "osdi:signatures": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29/signatures"
                  },
                  "osdi:submissions": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29/submissions"
                  },
                  "osdi:donations": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29/donations"
                  },
                  "osdi:outreaches": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29/outreaches"
                  },
                  "osdi:taggings": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29/taggings"
                  }
                }
              },
              "osdi:organizer": {
                "given_name": "John",
                "family_name": "Doe",
                "created_date": "2014-02-18T19:44:49Z",
                "modified_date": "2014-02-25T16:08:26Z",
                "identifiers": [
                     "action_network:c945d6fe-929e-11e3-a2e9-12313d316c29"
                ],
                "email_addresses": [
                  {
                    "primary": true,
                    "address": "johndoe@mail.com",
                    "status": "subscribed"
                  }
                ],
                "phone_numbers": [
                  {
                   "primary": true,
                   "number_type": "Mobile",
                   "status": "unsubscribed"
                  }
               ],
                "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"
                    }
                  }
                ],
                "languages_spoken": [
                  "en"
                ],
                "_links": {
                  "self": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29"
                  },
                  "osdi:attendances": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29/attendances"
                  },
                  "osdi:signatures": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29/signatures"
                  },
                  "osdi:submissions": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29/submissions"
                  },
                  "osdi:donations": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29/donations"
                  },
                  "osdi:outreaches": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29/outreaches"
                  },
                  "osdi:taggings": {
                    "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29/taggings"
                  }
                }
              }
            },
            "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/v2/events/6e3c4610-98d1-11e3-a2e9-12313d316c29"
              },
              "osdi:attendances": {
                "href": "https://actionnetwork.org/api/v2/events/6e3c4610-98d1-11e3-a2e9-12313d316c29/attendances"
              },
              "osdi:organizer": {
                "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29"
              },
              "osdi:creator": {
                "href": "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29"
              },
              "action_network:embed": {
                "href": "https://actionnetwork.org/api/v2/events/6e3c4610-98d1-11e3-a2e9-12313d316c29/embed"
              },
              "record_attendance_helper": {
                "href": "https://actionnetwork.org/api/v2/events/6e3c4610-98d1-11e3-a2e9-12313d316c29/attendances"
              }
            }
        },
        //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.

Back To Top ↑

Next Tutorial: Get a list of people who signed one of your petitions