Fundraising Page

This document defines the Fundraising Page resource.

Fundraising pages represent a page on a website that can take donations or other types of payment from end users. Fundraising pages have fields to describe them such as names, titles, summaries, and descriptions, and when activists submit a fundraising page and are charged money, Donation resources are created representing the individual donation an activist made on that fundraising page.

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 a Fundraising Page resource is osdi:fundraising_page for a single Fundraising Page resource or osdi:fundraising_pages for a collection of Fundraising Page resources.

Back to top…

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

Back to top…

Fundraising Page Fields

A list of fields specific to the Fundraising Page resource.

Name Type Description
origin_system string A human readable identifier of the system where this fundraising page was created. (ex: “OSDI System”)
name string The name of the fundraising page. Intended for administrative display rather than a public title, though may be shown to a user.
title string The title of the fundraising page. Intended for public display rather than administrative purposes.
description string A description of the fundraising page, usually displayed publicly. May contain text and/or HTML.
summary string A text-only single paragraph summarizing the fundraising page. 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 fundraising page on the web.
administrative_url string A URL string pointing to the fundraising page’s administrative page on the web.
featured_image_url string A URL string pointing to a publicly available featured image file for this fundraising page on the web.
total_donations integer A read-only computed property representing the current count of the total number of donations on the fundraising page.
total_amount float A read-only computed property representing the current count of the total amount of money raised on the fundraising page.
currency string ISO 4217 designation of currency. (ex: “USD” or “JPY”)
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.

Back to top…

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.

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

Back to top…

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 Fundraising Page* A self-referential link to the fundraising page.
creator Person* A link to a single Person resource representing the creator of the fundraising page.
modified_by Person* A link to a Person resource representing the last editor of this fundraising page.
taggings Taggings[]* A link to the collection of Tagging resources for this fundraising page.
donations Donations[]* A link to the collection of Donation resources for this fundraising page.
record_donation_helper Record Donation Helper* A link to the Record Donation Helper resource endpoint for this fundraising page.

Back to top…

Back to top…

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 Fundraising Page resources (GET)

Fundraising page resources are sometimes presented as collections of fundraising pages. For example, calling the fundraising pages endpoint will return a collection of all the fundraising pages stored in the system’s database associated with your api key.

Request

GET https://osdi-sample-system.org/api/v1/fundraising_pages/

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/fundraising_pages?page=2"
        },
        "osdi:fundraising_pages": [
            {
                "href": "https://osdi-sample-system.org/api/v1/fundraising_pages/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3"
            },
            {
                "href": "https://osdi-sample-system.org/api/v1/fundraising_pages/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/fundraising_pages"
        }
    },
    "_embedded": {
        "osdi:fundraising_pages": [
            {
                "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": "2014 End Of Year Donations",
                "title": "Give to support us at the end of the year!",
                "description": "<p>It's time for our end of year fundraising push.</p><p>Please give generously!</p>",
                "summary": "It's time for our end of year fundraising push.",
                "browser_url": "http://osdi-sample-system.org/fundraising_pages/give-to-support-us",
                "administrative_url": "http://osdi-sample-system.org/fundraising_pages/give-to-support-us/manage",
                "featured_image_url": "http://osdi-sample-system.org/images/donate-image.jpg",
                "total_donations": 345,
                "total_amount": 4567.21,
                "currency": "USD",
                "share_url": "http://osdi-sample-system.org/fundraising_pages/my-fundraiser/",
                "total_shares": 345,
                "share_options": [
                    {
                        "facebook_share": {
                            "title": "Support us at the end of the year!",
                            "description": "Please give generously.",
                            "image": "http://odsi-sample-system.org/images/fundraiser-share-image.jpg",
                            "total_shares": 100
                        },
                        "twitter_share": {
                            "message": "Give to @OSDI at the end of the year! Click here: http://osdi-sample-system.org/fundraising_pages/my-fundraiser/",
                            "total_shares": 100
                        },
                        "email_share": {
                            "subject": "Give to us at the end of the year!",
                            "body": "Can you give? Click here: http://osdi-sample-system.org/fundraising_pages/my-fundraiser/",
                            "total_shares": 145
                        }
                    }
                ],
                "_links": {
                    "self": {
                        "href": "https://osdi-sample-system.org/api/v1/fundraising_pages/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3"
                    },
                    "osdi:donations": {
                        "href": "https://osdi-sample-system.org/api/v1/fundraising_pages/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/donations"
                    },
                    "osdi:creator": {
                        "href": "https://osdi-sample-system.org/api/v1/people/65345d7d-cd24-466a-a698-4a7686ef684f"
                    },
                    "osdi:modified_by": {
                        "href": "https://osdi-sample-system.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29"
                    },
                    "osdi:record_donation_helper": {
                        "href": "https://osdi-sample-system.org/api/v1/fundraising_pages/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/record_donation_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": "Become a monthly donor",
                "description": "<p>Please become a monthly donor today!</p>",
                "total_donations": 43,
                "total_amount": 1298.25,
                "currency": "USD",
                "_links": {
                    "self": {
                        "href": "https://osdi-sample-system.org/api/v1/fundraising_pages/1efc3644-af25-4253-90b8-a0baf12dbd1e"
                    },
                    "osdi:donations": {
                        "href": "https://osdi-sample-system.org/api/v1/fundraising_pages/1efc3644-af25-4253-90b8-a0baf12dbd1e/donations"
                    },
                    "osdi:taggings": {
                        "href": "https://osdi-sample-system.org/api/v1/fundraising_pages/1efc3644-af25-4253-90b8-a0baf12dbd1e/taggings"
                    },
                    "osdi:creator": {
                        "href": "https://osdi-sample-system.org/api/v1/people/65345d7d-cd24-466a-a698-4a7686ef684f"
                    },
                    "osdi:modified_by": {
                        "href": "https://osdi-sample-system.org/api/v1/people/65345d7d-cd24-466a-a698-4a7686ef684f"
                    },
                    "osdi:record_donation_helper": {
                        "href": "https://osdi-sample-system.org/api/v1/fundraising_pages/1efc3644-af25-4253-90b8-a0baf12dbd1e/record_donation_helper"
                    }
                }
            },
            //(truncated for brevity)
        ]
    }
}

Back to top…

Scenario: Scenario: Retrieving an individual Fundraising Page resource (GET)

Calling an individual Fundraising Page resource will return the resource directly, along with all associated fields and appropriate links to additional information about the fundraising page.

Request

GET https://osdi-sample-system.org/api/v1/fundraising_pages/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": "2014 End Of Year Donations",
    "title": "Give to support us at the end of the year!",
    "description": "<p>It's time for our end of year fundraising push.</p><p>Please give generously!</p>",
    "summary": "It's time for our end of year fundraising push.",
    "browser_url": "http://osdi-sample-system.org/fundraising_pages/give-to-support-us",
    "administrative_url": "http://osdi-sample-system.org/fundraising_pages/give-to-support-us/manage",
    "featured_image_url": "http://osdi-sample-system.org/images/donate-image.jpg",
    "total_donations": 345,
    "total_amount": 4567.21,
    "currency": "USD",
    "share_url": "http://osdi-sample-system.org/fundraising_pages/my-fundraiser/",
    "total_shares": 345,
    "share_options": [
        {
            "facebook_share": {
                "title": "Support us at the end of the year!",
                "description": "Please give generously.",
                "image": "http://odsi-sample-system.org/images/fundraiser-share-image.jpg",
                "total_shares": 100
            },
            "twitter_share": {
                "message": "Give to @OSDI at the end of the year! Click here: http://osdi-sample-system.org/fundraising_pages/my-fundraiser/",
                "total_shares": 100
            },
            "email_share": {
                "subject": "Give to us at the end of the year!",
                "body": "Can you give? Click here: http://osdi-sample-system.org/fundraising_pages/my-fundraiser/",
                "total_shares": 145
            }
        }
    ],
    "_links": {
        "self": {
            "href": "https://osdi-sample-system.org/api/v1/fundraising_pages/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3"
        },
        "osdi:donations": {
            "href": "https://osdi-sample-system.org/api/v1/fundraising_pages/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/donations"
        },
        "osdi:creator": {
            "href": "https://osdi-sample-system.org/api/v1/people/65345d7d-cd24-466a-a698-4a7686ef684f"
        },
        "osdi:modified_by": {
            "href": "https://osdi-sample-system.org/api/v1/people/c945d6fe-929e-11e3-a2e9-12313d316c29"
        },
        "osdi:record_donation_helper": {
            "href": "https://osdi-sample-system.org/api/v1/fundraising_pages/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/record_donation_helper"
        }
    }
}

Back to top…

Scenario: Creating a new fundraising page (POST)

Posting to the fundraising page collection endpoint will allow you to create a new fundraising page. The response is the new fundraising page 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/fundraising_pages/

Header:
OSDI-API-Token:[your api key here]

{
    "identifiers": [
        "foreign_system:1"
    ],
    "name": "2014 End Of Year Donations",
    "title": "Give to support us at the end of the year!",
    "origin_system": "OpenSupporter"
}

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": "2014 End Of Year Donations",
    "title": "Give to support us at the end of the year!",
    "total_donations": 0,
    "total_amount": 0,
    "currency": "USD",
    "_links": {
        "self": {
            "href": "https://osdi-sample-system.org/api/v1/fundraising_pages/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3"
        },
        "osdi:donations": {
            "href": "https://osdi-sample-system.org/api/v1/fundraising_pages/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/donations"
        },
        "osdi:creator": {
            "href": "https://osdi-sample-system.org/api/v1/people/65345d7d-cd24-466a-a698-4a7686ef684f"
        },
        "osdi:record_donations_helper": {
            "href": "https://osdi-sample-system.org/api/v1/fundraising_pages/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/record_donations_helper"
        }
    }
}

Back to top…

Scenario: Modifying a fundraising page (PUT)

You can update a fundraising page by calling a PUT operation on that fundraising page’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/fundraising_pages/d91b4b2e-ae0e-4cd3-9ed7-de9uemdse

Header:
OSDI-API-Token:[your api key here]

{
    "name": "2014 End Of Year Donations (version 1)"
}

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": "2014 End Of Year Donations (version 1)",
    "title": "Give to support us at the end of the year!",
    "total_donations": 0,
    "total_amount": 0,
    "currency": "USD",
    "_links": {
        "self": {
            "href": "https://osdi-sample-system.org/api/v1/fundraising_pages/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3"
        },
        "osdi:donations": {
            "href": "https://osdi-sample-system.org/api/v1/fundraising_pages/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/donations"
        },
        "osdi:creator": {
            "href": "https://osdi-sample-system.org/api/v1/people/65345d7d-cd24-466a-a698-4a7686ef684f"
        },
        "osdi:record_donations_helper": {
            "href": "https://osdi-sample-system.org/api/v1/fundraising_pages/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/record_donations_helper"
        }
    }
}

Back to top…

Scenario: Deleting a fundraising page (DELETE)

You may delete a fundraising page by calling the DELETE command on the fundraising page’s endpoint.

Request

DELETE https://osdi-sample-system.org/api/v1/fundraising_pages/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 fundraising page was successfully deleted."
}

Back to top…