Event
This document defines the Event resource.
Event resources represent an event that a user may attend by submitting their RSVP information. Events have fields to describe them such as names, titles, summaries, descriptions, dates, times, and locations, and when people RSVP to attend an event, Attendance resources are created representing the individual RSVP made by an activist made for that event. Events can be one of two types, open
or ticketed
. Ticketed events typically charge money for tickets when a person RSVPs, while open events do not.
Sections
Endpoints and URL structures
OSDI does not specify specific endpoints and link structures for compliant systems to use. Rather, because OSDI is a HAL+JSON API, endpoints and structures are defined in the links section of each returned resource, starting with the API Entry Point link.
HAL’s link structure lets an API consumer move through API levels, resources, and collections by parsing and following links. While most systems will not change the value of their links often and obey RESTful design principles, the value of each link when that resource is retrieved is the only canonical value, and it can change at any time.
The link relation label for an Event resource is osdi:event
for a single Event resource or osdi:events
for a collection of Event resources.
Fields
The field names for this resource, with standard names, punctuation and capitalization, and values where appropriate.
Note: As with the entire OSDI specification, the specific fields a compliant system implements will vary between each system, as will the fields each system requires when creating or updating resources, which fields are writeable, and the operations you are allowed to perform on each resource.
Common Fields
A set of common fields that appear on all resources is included first, for reference.
Name | Type | Description |
---|---|---|
identifiers | strings[] | A unique string array of identifiers in the format [system name]:[id] . See the general concepts document for more information about identifiers. |
created_date | datetime | A read-only property representing the date and time the resource was created on the local system. |
modified_date | datetime | A read-only property representing the date and time the resource was last modified on the local system. |
Control Headers
An “osdi:control” JSON object may contain common OSDI control headers which can be used on an OSDI POST, PUT, PATCH, Helper or other function calls to modify server behavior. Read More
Name | Type | Description |
---|---|---|
return_response | boolean | Defaults to true, if specified as false, the operation does not need to return the resource representation in the response |
Event Fields
A list of fields specific to the Event resource.
Name | Type | Description |
---|---|---|
origin_system | string | A human readable identifier of the system where this event was created. (ex: “OSDI System”) |
name | string | The name of the event. Intended for administrative display rather than a public title, though may be shown to a user. |
title | string | The title of the event. Intended for public display rather than administrative purposes. |
description | string | A description of the event, usually displayed publicly. May contain text and/or HTML. |
summary | string | A text-only single paragraph summarizing the event. Shown on listing pages that have more than titles, but not enough room for full description. |
browser_url | string | A URL string pointing to the publicly available event page on the web. |
administrative_url | string | A URL string pointing to the event’s administrative page on the web. |
type | enum | Whether the event asks people to purches tickets to RSVP or is an open RSVP. One of “ticketed” or “open”. |
ticket_levels | Ticket Levels[] | An array of object hashes representing the different ticket levels available for purches. (ex: $5 general admission tickets and $50 VIP tickets) |
featured_image_url | string | A URL string pointing to a publicly available featured image file for this event on the web. |
total_accepted | integer | A read-only computed property representing the current count of the total number of attendances on the event. |
total_tickets | integer | A read-only computed property representing the current count of the total number of tickets sold for the event. |
total_amount | float | A read-only computed property representing the current count of the total amount of money generated by selling tickets for the event. |
status | enum | Status of the event. Possible values are: “confirmed”, “tentative”, or “cancelled”. |
instructions | string | The instructions for the event shown to attendees after they have RSVPed. May contain text and/or HTML. |
start_date | datetime | The start time for the event. |
end_date | datetime | The end time for the event. |
all_day_date | date | The date for all day events. |
all_day | boolean | True if the event is an all day event. |
capacity | integer | The max capacity of attendees for the event. |
guests_can_invite_others | boolean | Attendees can invite guests to the event. |
transparence | enum | Whether the event blocks time on online calendar systems. Possible values are “opaque” or “transparent”. Opaque is the default, but this can be overridden by a user. |
visibility | enum | Visibility of the event. Possible values are “public” and “private”. |
location | Location | An object hash representing the location of the event. |
contact | Contact | An object hash representing the who to contact for questions about the event. |
reminders | Reminders[] | An array of object hashes representing the reminders set for this event. |
timezone_identifier | string | The IANA timezone identifier representing the timezone in which the event occurs. See https://www.iana.org/time-zones |
share_url | string | A URL string pointing to the page that will be shared when this content is shared. (This may be subsumed by a particular share_option’s share_url) |
total_shares | integer | A computed property representing the current count of the total number of times the content has been shared by activists. |
share_options | ShareOptions[] | An array of share options objects representing the default language and attributes used when an activist shares this content via various mediums. More than one share_options object is allowed. Depending on server implementations, these could represent different share language variations to test or rotate. |
Related Objects
These JSON hashes included in the table above are broken out into their own tables for readability, rather than independent resources with their own endpoints.
Ticket Levels
Name | Type | Description |
---|---|---|
ticket_level.title | string | The name of the ticket level. (ex: “General admission”) |
ticket_level.description | string | A longer description of the ticket level. (ex: “Gets you access to the convention floor.”) |
ticket_level.amount | float | The price of each ticket for this ticket level, in the specified currency. (ex: “10.50”) |
ticket_level.currency | string | ISO 4217 designation of currency. (ex: “USD”, “JPY”) |
ticket_level.limit | integer | The total amount of tickets available for this ticket level, not including tickets already sold. (ex: There may be 10 tickets of this ticket level available and five already sold, but the limit field would still read “10”.) |
ticket_level.total_tickets | integer | A read-only computed property representing the current count of the total number of tickets sold for the ticket level. |
ticket_level.total_amount | float | A read-only computed property representing the current count of the total amount of money generated by selling tickets for the ticket level. |
Location
Name | Type | Description |
---|---|---|
location.venue | string | Optional venue name at the event address, useful for names of buildings. (ex: Smith Hall) |
location.address_lines | strings[] | An array of strings representing the event’s street address. |
location.locality | string | A city or other local administrative area. |
location.region | string | State or subdivision codes according to ISO 3166-2 (Final 2 alpha digits). |
location.postal_code | string | The region specific postal code, such as a zip code. |
location.country | string | The country code according to ISO 3166-1 Alpha-2. |
location.language | string | Language in which the address is recorded – language code according to ISO 639. |
location.location | object | An object hash representing the geocoded location information for the address. |
location.location.latitude | float | A positive or negative float number representing the latitude of the address. |
location.location.longitude | float | A positive or negative float number representing the longitude of the address. |
location.location.accuracy | enum | A value representing the accuracy of the geocode. One of “Rooftop” or “Approximate”. |
location.public | boolean | Whether the venue’s location should be shared publicly, or if false, only shared with RSVPs (for example, someone’s house) |
Contact
Name | Type | Description |
---|---|---|
contact.name | string | Name of the host or contact person for event (e.g., Jane Doe) |
contact.email_address | string | Email address of the host (jane.doe@hotmail.co.uk) |
contact.phone_number | string | Phone number of the host (214-555-0869) |
contact.additional_info | string | Free form place for information about the event contact |
contact.public | boolean | Whether the host’s info should be shared publicly (if false, should only be shared with RSVPs) |
Reminders
Name | Type | Description |
---|---|---|
reminder.method | enum | The way the reminder is to be delivered. One of “email” or “sms”. |
reminder.minutes | integer | The number of minutes before the start of the event to send the reminder. |
Share Options
Name | Type | Description |
---|---|---|
facebook_share | Facebook Share | An object hash representing the default language and attributes used when an activist shares on Facebook. |
twitter_share | Twitter Share | An object hash representing the default language and attributes used when an activist shares on Twitter. |
email_share | Email Share | An object hash representing the default language and attributes used when an activist shares via email. |
Facebook Share
Name | Type | Description |
---|---|---|
facebook_share.title | string | The title of the post created when an activist shares content on Facebook. |
facebook_share.description | string | The description of the post created when an activist shares content on Facebook. |
facebook_share.image | string | The URL of an image that goes with post created when an activist shares content on Facebook. |
facebook_share.total_shares | integer | A computed property representing the current count of the total number of times the content has been shared on Facebook. |
facebook_share.share_url | string | A URL string pointing to the page that is used specifically for Facebook sharing |
Twitter Share
Name | Type | Description |
---|---|---|
twitter_share.message | string | The text of the post created when an activist shares content on Twitter. Some systems may use templating or appends to insert the share_url into the tweet automatically. |
twitter_share.total_shares | integer | A computed property representing the current count of the total number of times the content has been shared on Twitter. |
twitter_share.share_url | string | A URL string pointing to the page that is used specifically for Twitter sharing |
Email Share
Name | Type | Description |
---|---|---|
email_share.subject | string | The subject line of the email created when an activist shares content via email. |
email_share.body | string | The body text of the email created when an activist shares content via email. Some systems may use templating or appends to insert the share_url into the email body automatically. |
email_share.total_shares | integer | A computed property representing the current count of the total number of times content has been shared via email. |
email_share.share_url | string | A URL string pointing to the page that is used specifically for email sharing |
Links
The links associated with this resource, available in the links section of the resource. Links that are part of the OSDI spec are typically prefixed with the osdi:
namespace to aid in curie matching and readability.
Note: As with the entire OSDI specification, the specific links a compliant system supplies will vary between each system. In addition, systems may choose to embed a linked resource directly in the response in addition to linking to it in the links section, using the standard _embedded
syntax described in the general overview documentation.
Name | Type | Description |
---|---|---|
self | Event* | A self-referential link to the event. |
creator | Person* | A link to a single Person resource representing the creator of the event. |
sponsor | Organization* | A link to an Organization resource that is responsible for creating the event and/or is the primary supporting/sponsoring organization. |
organizer | Person* | A link to a single Person resource representing the organizer of the event. |
modified_by | Person* | A link to a Person resource representing the last editor of this event. |
attendances | Attendances[]* | A link to the collection of Attendance resources for this event. |
taggings | Taggings[]* | A link to the collection of Tagging resources for this event. |
record_attendance_helper | Record Attendance Helper* | A link to the Record Attendance Helper resource endpoint for this event. |
Related Resources
Scenarios
The scenarios below show some common Create, Read, Update, Delete (CRUD) operations that can be performed on this resource, as well as any resource-specific behaviors worth highlighting. The following examples are for informational purposes. The authoritative resource definitions are above in the Fields tables and should be followed in the event of a conflict with the examples.
Scenario: Retrieving a collection of Event resources (GET)
Event resources are sometimes presented as collections of events. For example, calling the events endpoint will return a collection of all the events stored in the system’s database associated with your api key.
Request
GET https://osdi-sample-system.org/api/v1/events/
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": 10,
"per_page": 25,
"page": 1,
"total_records": 250,
"_links": {
"next": {
"href": "https://osdi-sample-system.org/api/v1/events?page=2"
},
"osdi:events": [
{
"href": "https://osdi-sample-system.org/api/v1/events/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3"
},
{
"href": "https://osdi-sample-system.org/api/v1/events/1efc3644-af25-4253-90b8-a0baf12dbd1e"
},
//(truncated for brevity)
],
"curies": [
{
"name": "osdi",
"href": "https://osdi-sample-system.org/docs/v1/{rel}",
"templated": true
}
],
"self": {
"href": "https://osdi-sample-system.org/api/v1/events"
}
},
"_embedded": {
"osdi:events": [
{
"identifiers": [
"osdi_sample_system:d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3",
"foreign_system:1"
],
"origin_system": "OSDI Sample System",
"created_date": "2014-03-20T21:04:31Z",
"modified_date": "2014-03-20T21:04:31Z",
"name": "March 14th Rally",
"title": "Rally for Justice",
"description": "<p>Join us in the park to rally for justice!</p>",
"summary": "Join us in the park to rally for justice!",
"instructions": "<p>Bring a friend and a sign.</p>",
"browser_url": "http://osdi-sample-system.org/events/rally-for-justice",
"administrative_url": "http://osdi-sample-system.org/events/rally-for-justice/manage",
"type": "open",
"featured_image_url": "http://osdi-sample-system.org/images/rally-for-justice-banner.jpg",
"total_accepted": 14,
"status": "confirmed",
"start_date": "2015-03-14T12:00:00Z",
"end_date": "2015-03-14T14:00:00Z",
"all_day": false,
"guests_can_invite_others": true,
"transparence": "opaque",
"visibility": "public",
"location": {
"venue": "Lafayette Square",
"address_lines": [
"1564 H St NW"
],
"locality": "Washington",
"region": "DC",
"postal_code": "20001",
"country": "US",
"language": "EN",
"location": {
"latitude": 38.9002101,
"longitude": -77.0359252,
"accuracy": "Rooftop"
}
},
"reminders": [
{
"method": "email",
"minutes": 1440
},
{
"method": "sms",
"minutes": 60
}
],
"share_url": "http://osdi-sample-system.org/events/my-event/",
"total_shares": 345,
"share_options": [
{
"facebook_share": {
"title": "Debate watch party!",
"description": "Come and watch the debate.",
"image": "http://odsi-sample-system.org/images/event-share-image.jpg",
"total_shares": 100
},
"twitter_share": {
"message": "Watch the debate with @OSDI! Click here: http://osdi-sample-system.org/events/my-event/",
"total_shares": 100
},
"email_share": {
"subject": "Come watch the debate!",
"body": "Can you watch the debate with us? Click here: http://osdi-sample-system.org/events/my-event/",
"total_shares": 145
}
}
],
"_links": {
"self": {
"href": "https://osdi-sample-system.org/api/v1/events/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3"
},
"osdi:attendances": {
"href": "https://osdi-sample-system.org/api/v1/events/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/attendances"
},
"osdi:creator": {
"href": "https://osdi-sample-system.org/api/v1/people/65345d7d-cd24-466a-a698-4a7686ef684f"
},
"osdi:sponsor": {
"href": "https://osdi-sample-system.org/api/v1/organizations/5d7d6534-cd24-566a-98a6-ef684f4a7686"
},
"osdi:organizer": {
"href": "https://osdi-sample-system.org/api/v1/people/8a625981-67a4-4457-8b55-2e30b267b2c2"
},
"osdi:modified_by": {
"href": "https://osdi-sample-system.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29"
},
"osdi:record_attendance_helper": {
"href": "https://osdi-sample-system.org/api/v1/events/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/record_attendance_helper"
}
}
},
{
"identifiers": [
"osdi_sample_system:1efc3644-af25-4253-90b8-a0baf12dbd1e"
],
"origin_system": "OSDI Sample System",
"created_date": "2014-03-20T20:44:13Z",
"modified_date": "2014-03-20T20:44:13Z",
"title": "House Party for Progress",
"description": "<p>Come to my small house party. We'll discuss how we can make more progress.</p>",
"instructions": "<p>This is an invite-only event, but feel free to bring a friend!</p>",
"browser_url": "http://osdi-sample-system.org/events/party-for-progress",
"administrative_url": "http://osdi-sample-system.org/events/party-for-progress/manage",
"type": "ticketed",
"ticket_levels": [
{
"title": "General Admission",
"description": "Gets you into the event and all activities.",
"amount": 5,
"currency": "USD",
"limit": 20,
"total_tickets": 10,
"total_amount": 50
},
{
"title": "VIP",
"description": "Gets you into the event and all activities, plus a special meet and greet with the candidate.",
"amount": 50,
"currency": "USD",
"limit": 5,
"total_tickets": 2,
"total_amount": 100
}
],
"total_tickets": 12,
"total_amount": 150,
"total_accepted": 3,
"status": "tentative",
"start_date": "2015-01-05T19:00:00Z",
"end_date": "2015-01-05T21:00:00Z",
"all_day": false,
"guests_can_invite_others": false,
"capacity": 10,
"transparence": "opaque",
"visibility": "private",
"location": {
"venue": "My House",
"address_lines": [
"1600 Pennsylvania Ave. NW"
],
"locality": "Washington",
"region": "DC",
"postal_code": "20001",
"country": "US",
"language": "EN",
"location": {
"latitude": 38.9002101,
"longitude": -77.0359252,
"accuracy": "Rooftop"
}
},
"reminders": [
{
"method": "email",
"minutes": 1440
}
],
"_links": {
"self": {
"href": "https://osdi-sample-system.org/api/v1/events/1efc3644-af25-4253-90b8-a0baf12dbd1e"
},
"osdi:attendances": {
"href": "https://osdi-sample-system.org/api/v1/events/1efc3644-af25-4253-90b8-a0baf12dbd1e/attendances"
},
"osdi:taggings": {
"href": "https://osdi-sample-system.org/api/v1/events/1efc3644-af25-4253-90b8-a0baf12dbd1e/taggings"
},
"osdi:creator": {
"href": "https://osdi-sample-system.org/api/v1/people/65345d7d-cd24-466a-a698-4a7686ef684f"
},
"osdi:sponsor": {
"href": "https://osdi-sample-system.org/api/v1/organizations/5d7d6534-cd24-566a-98a6-ef684f4a7686"
},
"osdi:organizer": {
"href": "https://osdi-sample-system.org/api/v1/people/8a625981-67a4-4457-8b55-2e30b267b2c2"
},
"osdi:modified_by": {
"href": "https://osdi-sample-system.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29"
},
"osdi:record_attendance_helper": {
"href": "https://osdi-sample-system.org/api/v1/events/1efc3644-af25-4253-90b8-a0baf12dbd1e/record_attendance_helper"
}
}
},
//(truncated for brevity)
]
}
}
Scenario: Scenario: Retrieving an individual Event resource (GET)
Calling an individual Event resource will return the resource directly, along with all associated fields and appropriate links to additional information about the event.
Request
GET https://osdi-sample-system.org/api/v1/events/d32fcdd6-7366-466d-a3b8-7e0d87c3cd8b
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": [
"osdi_sample_system:d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3",
"foreign_system:1"
],
"origin_system": "OSDI Sample System",
"created_date": "2014-03-20T21:04:31Z",
"modified_date": "2014-03-20T21:04:31Z",
"name": "March 14th Rally",
"title": "Rally for Justice",
"description": "<p>Join us in the park to rally for justice!</p>",
"summary": "Join us in the park to rally for justice!",
"instructions": "<p>Bring a friend and a sign.</p>",
"browser_url": "http://osdi-sample-system.org/events/rally-for-justice",
"administrative_url": "http://osdi-sample-system.org/events/rally-for-justice/manage",
"type": "open",
"featured_image_url": "http://osdi-sample-system.org/images/rally-for-justice-banner.jpg",
"total_accepted": 14,
"status": "confirmed",
"start_date": "2015-03-14T12:00:00Z",
"end_date": "2015-03-14T14:00:00Z",
"all_day": false,
"guests_can_invite_others": true,
"transparence": "opaque",
"visibility": "public",
"location": {
"venue": "Lafayette Square",
"address_lines": [
"1564 H St NW"
],
"locality": "Washington",
"region": "DC",
"postal_code": "20001",
"country": "US",
"language": "EN",
"location": {
"latitude": 38.9002101,
"longitude": -77.0359252,
"accuracy": "Rooftop"
}
},
"reminders": [
{
"method": "email",
"minutes": 1440
},
{
"method": "sms",
"minutes": 60
}
],
"share_url": "http://osdi-sample-system.org/events/my-event/",
"total_shares": 345,
"share_options": [
{
"facebook_share": {
"title": "Debate watch party!",
"description": "Come and watch the debate.",
"image": "http://odsi-sample-system.org/images/event-share-image.jpg",
"total_shares": 100
},
"twitter_share": {
"message": "Watch the debate with @OSDI! Click here: http://osdi-sample-system.org/events/my-event/",
"total_shares": 100
},
"email_share": {
"subject": "Come watch the debate!",
"body": "Can you watch the debate with us? Click here: http://osdi-sample-system.org/events/my-event/",
"total_shares": 145
}
}
],
"_links": {
"self": {
"href": "https://osdi-sample-system.org/api/v1/events/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3"
},
"osdi:attendances": {
"href": "https://osdi-sample-system.org/api/v1/events/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/attendances"
},
"osdi:creator": {
"href": "https://osdi-sample-system.org/api/v1/people/65345d7d-cd24-466a-a698-4a7686ef684f"
},
"osdi:sponsor": {
"href": "https://osdi-sample-system.org/api/v1/organizations/5d7d6534-cd24-566a-98a6-ef684f4a7686"
},
"osdi:organizer": {
"href": "https://osdi-sample-system.org/api/v1/people/8a625981-67a4-4457-8b55-2e30b267b2c2"
},
"osdi:modified_by": {
"href": "https://osdi-sample-system.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29"
},
"osdi:record_attendance_helper": {
"href": "https://osdi-sample-system.org/api/v1/events/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/record_attendance_helper"
}
}
}
Scenario: Creating a new event (POST)
Posting to the event collection endpoint will allow you to create a new event. Optionally adding links to a Person resource will set the organizer or creator. The response is the new event that was created. While each implementing system will require different fields, any optional fields not included in a post operation should not be set at all by the receiving system, or should be set to default values.
Request
POST https://osdi-sample-system.org/api/v1/events/
Header:
OSDI-API-Token:[your api key here]
{
"identifiers": [
"foreign_system:1"
],
"title": "Rally for Justice",
"name": "March 14th Rally",
"origin_system": "OpenSupporter",
"start_date": "2015-03-14T12:00:00Z",
"end_date": "2015-03-14T14:00:00Z",
"location": {
"venue": "Lafayette Square",
"address_lines": [
"1564 H St NW"
],
"locality": "Washington",
"region": "DC",
"postal_code": "20001",
"country": "US",
"language": "EN",
"location": {
"latitude": 38.9002101,
"longitude": -77.0359252,
"accuracy": "Rooftop"
}
},
"_links" : {
"osdi:organizer" : {
"href" : "https://osdi-sample-system.org/api/v1/people/8a625981-67a4-4457-8b55-2e30b267b2c2"
}
}
}
Response
200 OK
Content-Type: application/hal+json
Cache-Control: max-age=0, private, must-revalidate
{
"identifiers": [
"osdi_sample_system:d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3",
"foreign_system:1"
],
"origin_system": "OpenSupporter",
"created_date": "2014-03-20T21:04:31Z",
"modified_date": "2014-03-20T21:04:31Z",
"name": "March 14th Rally",
"title": "Rally for Justice",
"total_accepted": 0,
"status": "confirmed",
"start_date": "2015-03-14T12:00:00Z",
"end_date": "2015-03-14T14:00:00Z",
"all_day": false,
"guests_can_invite_others": true,
"transparence": "opaque",
"visibility": "public",
"type": "open",
"location": {
"venue": "Lafayette Square",
"address_lines": [
"1564 H St NW"
],
"locality": "Washington",
"region": "DC",
"postal_code": "20001",
"country": "US",
"language": "EN",
"location": {
"latitude": 38.9002101,
"longitude": -77.0359252,
"accuracy": "Rooftop"
}
},
"_links": {
"self": {
"href": "https://osdi-sample-system.org/api/v1/events/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3"
},
"osdi:attendances": {
"href": "https://osdi-sample-system.org/api/v1/events/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/attendances"
},
"osdi:creator": {
"href": "https://osdi-sample-system.org/api/v1/people/65345d7d-cd24-466a-a698-4a7686ef684f"
},
"osdi:sponsor": {
"href": "https://osdi-sample-system.org/api/v1/organizations/5d7d6534-cd24-566a-98a6-ef684f4a7686"
},
"osdi:organizer": {
"href": "https://osdi-sample-system.org/api/v1/people/8a625981-67a4-4457-8b55-2e30b267b2c2"
},
"osdi:modified_by": {
"href": "https://osdi-sample-system.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29"
},
"osdi:record_attendance_helper": {
"href": "https://osdi-sample-system.org/api/v1/events/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/record_attendance_helper"
}
}
}
Scenario: Modifying an event (PUT)
You can update an event by calling a PUT operation on that event’s endpoint. Your PUT should contain fields that you want to update. Missing fields will be ignored by the receiving system. Systems may also ignore PUT values, depending on whether fields you are trying to modify are read-only or not. You may set an attribute to nil by including the attribute using nil
for value.
Note: Modifying members of an array separately is not supported. To change the contents of an array, first GET the current contents and then PUT back only those you wish to keep.
Request
PUT https://osdi-sample-system.org/api/v1/events/d91b4b2e-ae0e-4cd3-9ed7-de9uemdse
Header:
OSDI-API-Token:[your api key here]
{
"name": "March 14th Rally",
"start_date": "2015-03-15T12:00:00Z",
"end_date": "2015-03-15T14:00:00Z"
}
Response
200 OK
Content-Type: application/hal+json
Cache-Control: max-age=0, private, must-revalidate
{
"identifiers": [
"osdi_sample_system:d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3",
"foreign_system:1"
],
"origin_system": "OpenSupporter",
"created_date": "2014-03-20T21:04:31Z",
"modified_date": "2014-03-20T22:04:31Z",
"name": "March 15th Rally",
"title": "Rally for Justice",
"total_accepted": 0,
"status": "confirmed",
"start_date": "2015-03-15T12:00:00Z",
"end_date": "2015-03-15T14:00:00Z",
"all_day": false,
"guests_can_invite_others": true,
"transparence": "opaque",
"visibility": "public",
"type": "open",
"location": {
"venue": "Lafayette Square",
"address_lines": [
"1564 H St NW"
],
"locality": "Washington",
"region": "DC",
"postal_code": "20001",
"country": "US",
"language": "EN",
"location": {
"latitude": 38.9002101,
"longitude": -77.0359252,
"accuracy": "Rooftop"
}
},
"_links": {
"self": {
"href": "https://osdi-sample-system.org/api/v1/events/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3"
},
"osdi:attendances": {
"href": "https://osdi-sample-system.org/api/v1/events/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/attendances"
},
"osdi:creator": {
"href": "https://osdi-sample-system.org/api/v1/people/65345d7d-cd24-466a-a698-4a7686ef684f"
},
"osdi:sponsor": {
"href": "https://osdi-sample-system.org/api/v1/organizations/5d7d6534-cd24-566a-98a6-ef684f4a7686"
},
"osdi:organizer": {
"href": "https://osdi-sample-system.org/api/v1/people/8a625981-67a4-4457-8b55-2e30b267b2c2"
},
"osdi:modified_by": {
"href": "https://osdi-sample-system.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29"
},
"osdi:record_attendance_helper": {
"href": "https://osdi-sample-system.org/api/v1/events/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/record_attendance_helper"
}
}
}
Scenario: Deleting an event (DELETE)
You may delete an event by calling the DELETE command on the event’s endpoint.
Request
DELETE https://osdi-sample-system.org/api/v1/events/d32fcdd6-7366-466d-a3b8-7e0d87c3cd8b
Header:
OSDI-API-Token:[your api key here]
Response
200 OK
Content-Type: application/hal+json
Cache-Control: max-age=0, private, must-revalidate
{
"notice": "This event was successfully deleted."
}