Attendance Version 1
This document describes the OSDI attendance collection and attendance resource as implemented by the Action Network.
Attendance represents the action an activist took when they RSVPed for a specific event.
Attendance are linked to the person resource corresponding to the activist who RSVPed.
Note: Attendance are deduplicated based on person, so a specific person can only RSVP to an event once.
Sections:
- Endpoints and URL structures
- Field names and descriptions
- Links
- Scenario: Retrieving a collection of attendance resources (GET)
- Scenario: Retrieving an individual attendance resource (GET)
- Scenario: Creating a new attendance (POST)
- Scenario: Modifying an attendance (PUT)
- Scenario: Deleting an attendance (DELETE)
Endpoints and URL structures
Endpoints:
https://actionnetwork.org/api/v1/events/[event_id]/attendance
https://actionnetwork.org/api/v1/people/[person_id]/attendance
Attendance resources live at endpoints relating to the person who RSVPed and the event they RSVPed to. The endpoints return a collection of all attendance associated with either that person or that event.
URL Structures:
https://actionnetwork.org/api/v1/events/[event_id]/attendance/[attendance_id]
https://actionnetwork.org/api/v1/people/[person_id]/attendance/[attendance_id]
To address a specific attendance, use the identifier without the action_network:
prefix to construct a URL, like https://actionnetwork.org/api/v1/events/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/attendance/167ce1d2-70b7-423e-b480-914981cbeaff
Field names and descriptions
Field Name | Type | Required on POST | Description |
---|---|---|---|
identifiers | array[] |
An array of identifiers in the format [system name]:[id] . See the general concepts document for more information about identifiers.
|
|
originating_system | string | Yes | A human readable string identifying where this attendance originated. May be used in the user interface for this purpose. |
created_at | datetime | The date and time the resource was created. System generated, not editable. | |
modified_at | datetime | The date and time the resource was last modified. System generated, not editable. | |
status | enum | The status of this user's RSVP. One of ["declined" "tentative" "accepted" "needs action"]. System generated, always accepted, not editable. | |
action_network:person_id | string | The native Action Network identifier associated with the person who RSVPed to this event. Action Network-only feature. System generated, not editable. | |
action_network:event_id | string | The native Action Network identifier associated with the event this attendance is associated with. Action Network-only feature. System generated, not editable. | |
action_network:referrer_data | hash | A hash of referrer data such as source code and referrer code. Action Network-only. | |
action_network:referrer_data.source | string |
The source code of this attendance. Equivalent to someone taking action with the url argument ?source=[your source] . Corresponds to the sources chart in this action's manage page. Action Network-only.
|
|
action_network:referrer_data.referrer | string |
The referrer code of this attendance. Equivalent to someone taking action with the url argument ?referrer=[your referrer code] . Must be a valid Action Network referrer code. Read-only. Corresponds to the referrers chart in this action's manage page. Action Network-only.
|
|
action_network:referrer_data.website | string | The website referrer for this attendance. Equivalent to someone taking action after clicking a link on the listed website. Corresponds to the websites chart in this action's manage page. Action Network-only. |
Links
Link Name | Description |
---|---|
self | A link to this individual attendance resource. |
osdi:person | A link to the person who made this attendance. Click here for people documentation. |
osdi:event | A link to the event this attendance is associated with. Note: If this attendance was created via a referral code, this link may not be accessible because your API key does not give you permission to access the event itself. Click here for event documentation. |
Scenario: Retrieving a collection of attendance resources (GET)
Attendance resources are sometimes presented as collections of attendance. For example, calling the attendance endpoint on a specific event will return a collection of all the attendance associated with that event.
Request
GET https://actionnetwork.org/api/v1/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendance
Header:
api-key:[your api key here]
Response
Back To Top ↑200 OK Content-Type: application/hal+json Cache-Control: max-age=0, private, must-revalidate
{ "total_pages": 1, "per_page": 25, "page": 1, "total_records": 20, "_links": { "self": { "href": "https://actionnetwork.org/api/v1/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendance" }, "record_attendance_helper": { "href": "https://actionnetwork.org/api/v1/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendance" }, "osdi:attendance": [ { "href": "https://actionnetwork.org/api/v1/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendance/d51ca19e-9fe9-11e3-a2e9-12313d316c29" }, { "href": "https://actionnetwork.org/api/v1/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendance/d51c9b4a-9fe9-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:attendance": [ { "identifiers": [ "action_network:d51ca19e-9fe9-11e3-a2e9-12313d316c29" ], "created_at": "2014-02-18T20:52:59Z", "modified_at": "2014-02-18T20:53:00Z", "status": "accepted", "action_network:person_id": "ceef7e23-4617-4af8-bd0f-60029299d8cd", "action_network:event_id": "12c9a105-1ab6-472e-ac04-667c521a5968", "_links": { "self": { "href": "https://actionnetwork.org/api/v1/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendance/d51ca19e-9fe9-11e3-a2e9-12313d316c29" }, "osdi:event": { "href": "https://actionnetwork.org/api/v1/events/12c9a105-1ab6-472e-ac04-667c521a5968" }, "osdi:person": { "href": "https://actionnetwork.org/api/v1/people/ceef7e23-4617-4af8-bd0f-60029299d8cd" } } }, { "identifiers": [ "action_network:d51c9b4a-9fe9-11e3-a2e9-12313d316c29" ], "created_at": "2014-02-18T20:23:42Z", "modified_at": "2014-02-18T20:23:42Z", "status": "accepted", "action_network:person_id": "06d13a33-6824-493b-a922-95e793f269d3", "action_network:event_id": "12c9a105-1ab6-472e-ac04-667c521a5968", "_links": { "self": { "href": "https://actionnetwork.org/api/v1/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendance/d51c9b4a-9fe9-11e3-a2e9-12313d316c29" }, "osdi:event": { "href": "https://actionnetwork.org/api/v1/events/12c9a105-1ab6-472e-ac04-667c521a5968" }, "osdi:person": { "href": "https://actionnetwork.org/api/v1/people/06d13a33-6824-493b-a922-95e793f269d3" } } }, //truncated for brevity ] } }
Scenario: Retrieving an individual attendance resource (GET)
Calling an individual attendance resource will return the resource directly, along with all associated fields and appropriate links to additional information about the attendance.
Request
GET https://actionnetwork.org/api/v1/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendance/d51ca19e-9fe9-11e3-a2e9-12313d316c29
Header:
api-key:[your api key here]
Response
Back To Top ↑200 OK Content-Type: application/hal+json Cache-Control: max-age=0, private, must-revalidate
{ "identifiers": [ "action_network:d51ca19e-9fe9-11e3-a2e9-12313d316c29" ], "created_at": "2014-02-18T20:52:59Z", "modified_at": "2014-02-18T20:53:00Z", "status": "accepted", "action_network:person_id": "ceef7e23-4617-4af8-bd0f-60029299d8cd", "action_network:event_id": "12c9a105-1ab6-472e-ac04-667c521a5968", "_links": { "self": { "href": "https://actionnetwork.org/api/v1/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendance/d51ca19e-9fe9-11e3-a2e9-12313d316c29" }, "osdi:event": { "href": "https://actionnetwork.org/api/v1/events/12c9a105-1ab6-472e-ac04-667c521a5968" }, "osdi:person": { "href": "https://actionnetwork.org/api/v1/people/ceef7e23-4617-4af8-bd0f-60029299d8cd" }, "curies": [ { "name": "osdi", "href": "https://actionnetwork.org/docs/v1/{rel}", "templated": true }, { "name": "action_network", "href": "https://actionnetwork.org/docs/v1/{rel}", "templated": true } ] } }
Scenario: Creating a new attendance (POST)
You can POST a new attendance to an event with that event's attendance endpoint and an attendance resource will be created in our system.
When you post an attendance, you can either link to an existing person to register that this person RSVPed for this event, or you can post information about a new person inline to the special record_attendance_helper
endpoint, to both create a new person and register that they RSVPed to the event at the same time.
Either way, attendance are deduplicated by person, so a person can only RSVP to an event once. Posting a new attendance by a person who previously RSVPed to the event will replace the old attendance resource with the new one.
Here is an example of posting an attendance linking to an existing person:
Request
POST https://actionnetwork.org/api/v1/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendance/ Header: Content-Type: application/json api-key:[your api key here]
{ "identifiers": [ "free_events:1" ], "originating_system" : "FreeEvents.com", "_links" : { "osdi:person" : { "href" : "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29" } } }
Response
200 OK Content-Type: application/hal+json Cache-Control: max-age=0, private, must-revalidate
{ "identifiers": [ "free_events:1", "action_network:be9c5df3-389a-488a-af7c-d0132dff8192" ], "originating_system": "FreeEvents.com", "created_at": "2014-03-26T21:21:47Z", "modified_at": "2014-03-26T21:21:47Z", "status": "accepted", "action_network:person_id": "c945d6fe-929e-11e3-a2e9-12313d316c29", "action_network:event_id": "12c9a105-1ab6-472e-ac04-667c521a5968", "_links": { "osdi:person": { "href": "https://actionnetwork.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29" }, "self": { "href": "https://actionnetwork.org/api/v1/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendance/be9c5df3-389a-488a-af7c-d0132dff8192" }, "osdi:event": { "href": "https://actionnetwork.org/api/v1/events/12c9a105-1ab6-472e-ac04-667c521a5968" }, "curies": [ { "name": "osdi", "href": "https://actionnetwork.org/docs/v1/{rel}", "templated": true }, { "name": "action_network", "href": "https://actionnetwork.org/docs/v1/{rel}", "templated": true } ] } }
And here is an example of posting an attendance with person data inlined to the special record_attendance_helper
link on the attendance collection:
Request
POST https://actionnetwork.org/api/v1/petitions/9f837109-710d-442f-8a99-857a21f36d25/signatures/ Header: Content-Type: application/json api-key:[your api key here]
{ "identifiers": [ "free_events:2" ], "originating_system" : "FreeEvents.com", "person" : { "family_name" : "Smith", "given_name" : "John", "postal_addresses" : [ { "postal_code" : "20009" }], "email_addresses" : [ { "address" : "jsmith@mail.com" }] } }
Response
200 OK Content-Type: application/hal+json Cache-Control: max-age=0, private, must-revalidate
{ "identifiers": [ "free_events:2", "action_network:dcd21938-0ccf-4d7c-98ef-e4fcd54ea7a3" ], "originating_system": "FreeEvents.com", "created_at": "2014-03-26T21:22:36Z", "modified_at": "2014-03-26T21:22:36Z", "status": "accepted", "action_network:person_id": "17be9a36-bb9a-4f68-94a8-40523b9dab27", "action_network:event_id": "12c9a105-1ab6-472e-ac04-667c521a5968", "_links": { "self": { "href": "https://actionnetwork.org/api/v1/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendance/dcd21938-0ccf-4d7c-98ef-e4fcd54ea7a3" }, "osdi:event": { "href": "https://actionnetwork.org/api/v1/events/12c9a105-1ab6-472e-ac04-667c521a5968" }, "osdi:person": { "href": "https://actionnetwork.org/api/v1/people/17be9a36-bb9a-4f68-94a8-40523b9dab27" }, "curies": [ { "name": "osdi", "href": "https://actionnetwork.org/docs/v1/{rel}", "templated": true }, { "name": "action_network", "href": "https://actionnetwork.org/docs/v1/{rel}", "templated": true } ] } }
In the above example, a new person was created and their attendance added to the event at the same time. We deduplicate new people added this way by email address, so if the email posted corresponded with a person already in the system, we would update their record instead of creating a new person. The required fields for person remain the same -- email address and postal code -- and any posts missing that information will fail.
Note: The record_attendance_helper
link is currently the same as the attendance collection, but that may not always be the case. Check the link to know exactly where to post.
And of course you can POST an attendance with more fields (such as address lines for your inline person data) if you'd like, but they are not required.
Back To Top ↑Scenario: Modifying an attendance (PUT)
You can modify an existing attendance by using PUT on its individual endpoint.
Request
PUT https://actionnetwork.org/api/v1/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendance/dcd21938-0ccf-4d7c-98ef-e4fcd54ea7a3 Header: Content-Type: application/json api-key:[your api key here]
{ "identifiers": [ "free_events:5" ] }
Response
200 OK Content-Type: application/hal+json Cache-Control: max-age=0, private, must-revalidate
{ "identifiers": [ "free_events:2", "action_network:dcd21938-0ccf-4d7c-98ef-e4fcd54ea7a3", "free_events:5" ], "originating_system": "FreeEvents.com", "created_at": "2014-03-26T21:22:36Z", "modified_at": "2014-03-26T21:25:22Z", "status": "accepted", "action_network:person_id": "17be9a36-bb9a-4f68-94a8-40523b9dab27", "action_network:event_id": "12c9a105-1ab6-472e-ac04-667c521a5968", "_links": { "self": { "href": "https://actionnetwork.org/api/v1/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendance/dcd21938-0ccf-4d7c-98ef-e4fcd54ea7a3" }, "osdi:event": { "href": "https://actionnetwork.org/api/v1/events/12c9a105-1ab6-472e-ac04-667c521a5968" }, "osdi:person": { "href": "https://actionnetwork.org/api/v1/people/17be9a36-bb9a-4f68-94a8-40523b9dab27" }, "curies": [ { "name": "osdi", "href": "https://actionnetwork.org/docs/v1/{rel}", "templated": true }, { "name": "action_network", "href": "https://actionnetwork.org/docs/v1/{rel}", "templated": true } ] } }
The above example added a new identifier to the attendance.
Editing of certain fields via PUT is not allowed, and is noted in the field names table above. For example, you can't change the person who is associated with this attendance. Invalid entries will be ignored.
Back To Top ↑Scenario: Deleting an attendance (DELETE)
Deleting attendance is not allowed via the API. DELETE requests will return an error.
Back To Top ↑