Attendances Version 2

This document describes the OSDI attendances collection and attendance resource as implemented by the Action Network.

Attendances represents the action an activist took when they RSVPed for a specific event.

Attendances are linked to the person resource corresponding to the activist who RSVPed.

Note: Attendances are deduplicated based on person, so a specific person can only RSVP to an event once. And POSTing attendances will not send autoresponses.

Sections:

Endpoints and URL structures

Endpoints:

https://actionnetwork.org/api/v2/events/[event_id]/attendances

https://actionnetwork.org/api/v2/people/[person_id]/attendances

https://actionnetwork.org/api/v2/event_campaigns/[event_campaign_id]/events/[event_id]/attendances

Attendance resources live at endpoints relating to the person who RSVPed and the event they RSVPed to. The endpoints return a collection of all attendances associated with either that person or that event.

URL Structures:

https://actionnetwork.org/api/v2/events/[event_id]/attendances/[attendance_id]

https://actionnetwork.org/api/v2/people/[person_id]/attendances/[attendance_id]

To address a specific attendance, use the identifier without the action_network: prefix to construct a URL, like https://actionnetwork.org/api/v2/events/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/attendances/167ce1d2-70b7-423e-b480-914981cbeaff

Back To Top ↑

Field names and descriptions

Attendance fields:
Field Name Type Required on POST Description
identifiers strings[] An array of identifiers in the format [system name]:[id]. Must be globally unique. See the general concepts document for more information about identifiers.
created_date datetime The date and time the resource was created. System generated, not editable.
modified_date 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 Referrer Data A hash of referrer data such as source code and referrer code. Action Network-only.
Referrer Data fields:
Field Name Type Required on POST Description
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.
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.
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.
email_referrer string The id of the email that brought someone to the link to take action. Action Networks adds the ?email_referrer=[your email referrer] URL parameter on the links sent through the emailer. Pass that value back in your API calls here to mark this action as having taken place because of a response to that email.
mobile_message_referrer string The id of the mobile message that brought someone to the link to take action. Action Networks adds the ?mobile_message_referrer=[your mobile referrer] URL parameter on the links sent through mobile messages. Pass that value back in your API calls here to mark this action as having taken place because of a response to that message.
Back To Top ↑

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 events documentation.
Back To Top ↑

Related resources

Back To Top ↑

Scenario: Retrieving a collection of attendance resources (GET)

Attendance resources are sometimes presented as collections of attendances. For example, calling the attendance endpoint on a specific event will return a collection of all the attendances associated with that event.

Request

						
GET https://actionnetwork.org/api/v2/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendances

Header:
OSDI-API-Token: your_api_key_here
					

Response

						
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/v2/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendances"
    },
    "osdi:attendance": [
      {
        "href": "https://actionnetwork.org/api/v2/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendances/d51ca19e-9fe9-11e3-a2e9-12313d316c29"
      },
      {
        "href": "https://actionnetwork.org/api/v2/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendances/d51c9b4a-9fe9-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:attendances": [
      {
        "identifiers": [
	      "action_network:d51ca19e-9fe9-11e3-a2e9-12313d316c29"
        ],
        "created_date": "2014-02-18T20:52:59Z",
        "modified_date": "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/v2/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendances/d51ca19e-9fe9-11e3-a2e9-12313d316c29"
          },
          "osdi:event": {
            "href": "https://actionnetwork.org/api/v2/events/12c9a105-1ab6-472e-ac04-667c521a5968"
          },
          "osdi:person": {
            "href": "https://actionnetwork.org/api/v2/people/ceef7e23-4617-4af8-bd0f-60029299d8cd"
          }
        }
      },
      {
        "identifiers": [
	      "action_network:d51c9b4a-9fe9-11e3-a2e9-12313d316c29"
        ],
        "created_date": "2014-02-18T20:23:42Z",
        "modified_date": "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/v2/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendances/d51c9b4a-9fe9-11e3-a2e9-12313d316c29"
          },
          "osdi:event": {
            "href": "https://actionnetwork.org/api/v2/events/12c9a105-1ab6-472e-ac04-667c521a5968"
          },
          "osdi:person": {
            "href": "https://actionnetwork.org/api/v2/people/06d13a33-6824-493b-a922-95e793f269d3"
          }
        }
      },
      //truncated for brevity
    ]
  }
}
					
Back To Top ↑

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/v2/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendances/d51ca19e-9fe9-11e3-a2e9-12313d316c29

Header:
OSDI-API-Token: your_api_key_here
					

Response

						
200 OK

Content-Type: application/hal+json
Cache-Control: max-age=0, private, must-revalidate


{
  "identifiers": [
    "action_network:d51ca19e-9fe9-11e3-a2e9-12313d316c29"
  ],
  "created_date": "2014-02-18T20:52:59Z",
  "modified_date": "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/v2/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendances/d51ca19e-9fe9-11e3-a2e9-12313d316c29"
    },
    "osdi:event": {
      "href": "https://actionnetwork.org/api/v2/events/12c9a105-1ab6-472e-ac04-667c521a5968"
    },
    "osdi:person": {
      "href": "https://actionnetwork.org/api/v2/people/ceef7e23-4617-4af8-bd0f-60029299d8cd"
    },
    "curies": [
      {
        "name": "osdi",
        "href": "https://actionnetwork.org/docs/v2/{rel}",
        "templated": true
      },
      {
        "name": "action_network",
        "href": "https://actionnetwork.org/docs/v2/{rel}",
        "templated": true
      }
    ]
  }
}
					
Back To Top ↑

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. You can learn more about the record attendance helper here.

Either way, attendances 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. Posting will also subscribe the person to the lists associated with the event. For example, if the event lists an individual account as a creator, a group as a sponsor, and is part of an event campaign sponsored by another group, the person will be subscribed to all three lists when the attendance is created. Currently multiple sponsors are not supported.

Background processing is available on this operation via the background_request=true URL argument. You can learn more about background processing here.

Note: POSTing attendances will not send autoresponses.

Here is an example of posting an attendance linking to an existing person:

Request

						
POST https://actionnetwork.org/api/v2/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendances/

Header:
Content-Type: application/json
OSDI-API-Token: your_api_key_here


{
  "_links" : {
    "osdi:person" : { "href" : "https://actionnetwork.org/api/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29" }
  }
}
					

Response

						
200 OK

Content-Type: application/hal+json
Cache-Control: max-age=0, private, must-revalidate


{
  "identifiers": [
    "action_network:be9c5df3-389a-488a-af7c-d0132dff8192"
  ],
  "created_date": "2014-03-26T21:21:47Z",
  "modified_date": "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/v2/people/c945d6fe-929e-11e3-a2e9-12313d316c29"
    },
    "self": {
      "href": "https://actionnetwork.org/api/v2/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendances/be9c5df3-389a-488a-af7c-d0132dff8192"
    },
    "osdi:event": {
      "href": "https://actionnetwork.org/api/v2/events/12c9a105-1ab6-472e-ac04-667c521a5968"
    },
    "curies": [
      {
        "name": "osdi",
        "href": "https://actionnetwork.org/docs/v2/{rel}",
        "templated": true
      },
      {
        "name": "action_network",
        "href": "https://actionnetwork.org/docs/v2/{rel}",
        "templated": true
      }
    ]
  }
}
					

And of course you can POST an attendance with more fields (such as referrer 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.

Background processing is available on this operation via the background_request=true URL argument. You can learn more about background processing here.

Request

						
PUT https://actionnetwork.org/api/v2/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendances/dcd21938-0ccf-4d7c-98ef-e4fcd54ea7a3

Header:
Content-Type: application/json
OSDI-API-Token: your_api_key_here


{
  "identifiers": [
    "other-system:230125a"
  ]
}
					

Response

						
200 OK

Content-Type: application/hal+json
Cache-Control: max-age=0, private, must-revalidate


{
  "identifiers": [
    "action_network:dcd21938-0ccf-4d7c-98ef-e4fcd54ea7a3",
    "other-system:230125a"
  ],
  "created_date": "2014-03-26T21:22:36Z",
  "modified_date": "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",
  "action_network:referrer_data": {
     "source": "api",
   },
  "_links": {
    "self": {
      "href": "https://actionnetwork.org/api/v2/events/12c9a105-1ab6-472e-ac04-667c521a5968/attendances/dcd21938-0ccf-4d7c-98ef-e4fcd54ea7a3"
    },
    "osdi:event": {
      "href": "https://actionnetwork.org/api/v2/events/12c9a105-1ab6-472e-ac04-667c521a5968"
    },
    "osdi:person": {
      "href": "https://actionnetwork.org/api/v2/people/17be9a36-bb9a-4f68-94a8-40523b9dab27"
    },
    "curies": [
      {
        "name": "osdi",
        "href": "https://actionnetwork.org/docs/v2/{rel}",
        "templated": true
      },
      {
        "name": "action_network",
        "href": "https://actionnetwork.org/docs/v2/{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 attendances is not allowed via the API. DELETE requests will return an error.

Back To Top ↑