Phonebank

This page defines the Phonebank resource.

Phonebank resource represent specific phone banking events planned for a specific time period. The resource contains information about start and end time, people to be called, and a Script that is used for the effort. As people are contacted, Phonebank Result resources are created representing the individual interaction between a volunteer and a person, as well as the data that resulted from that interaction.

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 Phonebank resource is osdi:phonebank for a single Phonebank resource or osdi:phonebanks for a collection of Phonebank 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.

Back to top…

Phonebank Fields

Name Type Description
origin_system string A human readable identifier of the system where this Phonebank was created. (ex: “OSDI System”)
name string The name of the Phonebank. Intended for administrative display rather than a public title, though may be shown to a user.
title string The title of the Phonebank. Intended for public display rather than administrative purposes.
description string A description of the Phonebank, usually displayed publicly. May contain text and/or HTML.
summary string A text-only single paragraph summarizing the Phonebank. Shown on listing pages that have more than titles, but not enough room for full description.
start_time datetime The start date and time for the Phone banking Effort.
end_time datetime The end date and time for the Phone banking Effort.
daily_start_hour integer The hour of the day volunteers should start calling. This is in 24 hour time
daily_stop_hour integer The hour of the day volunteers should stop calling. This is in 24 hour time
caller_id string The phone number that is displayed as the caller-id for this phonebank
status flexenum Status of the Phonebank. Possible values are: “draft”, “paused”, “scheduled”, “started”, or “stopped”
dialing_mode flexenum The type of the dialing for this phonebank. One of “predictive”, “power”, “manual”, or another value.
voicemail_audio_url string A URL string pointing to a audio file used for voice mail audio drops.
administrative_url string A URL string pointing to the Phonebank administrative page on the web.
browser_url string A URL string pointing to the Phonebank public page on the web.
total_completed integer A read-only computed property representing the current count of the total number completed on the Phonebank.

effort 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 Phonebank* A self-referential link to the phone bank.
creator Person* A link to a single Person resource representing the creator of the Phonebank.
modified_by Person* A link to a Person resource representing the last editor of this Phonebank.
taggings Taggings[]* A link to the collection of Tagging resources for this Phonebank.
phone_bank_results Phonebank_results[]* A link to a collection of Phone bank results resources representing the results that occured.
script Script* A link to the Script resource associated with this Phonebank.
target_list List* A link to the List resource that represents the list of People who will receive calls in this phonebank.
advocacy_targets List* A link to the List resource that represents the list of People who will be advocacy targets in this phonebank.
volunteers List* A link to the List resource that represents the list of People who will be the volunteers in this phonebank.
events List* A link to the List resource that represents a collection of events associated with this Phonebank. These are the events volunteers are signing up people for in the phonebank.

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

Phonebank resources are sometimes presented as collections of phonebanks. For example, calling the phone banks endpoint will return a collection of all the phone banks in the system’s database associated with your api key.

Request

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

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/phone_bank?page=2"
        },
        "osdi:phone_bank": [
            {
                "href": "https://osdi-sample-system.org/api/v1/phone_bank/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3"
            },
            {
                "href": "https://osdi-sample-system.org/api/v1/phone_bank/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/phone_bank"
        }
    },
    "_embedded":
    {
        "osdi:phone_bank": [
            {
                "identifiers": [
                    "osdi_sample_system:a91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bca",
                    "foreign_system:1"
                ],
                "origin_system": "OSDI Sample System",
                "created_date": "2017-03-20T21:04:31Z",
                "modified_date": "2017-03-20T21:04:31Z",
                "name": "Rally for Mountains",
                "title": "Rally for Mountains Team 2",
                "description": "Rally for Mountains phone bank for Team 2",
                "summary": "Rally for Mountains phone bank effort 1 for Team 2",
                "start_time": "2018-02-19T8:00:00Z",
                "end_time": "2018-02-20T8:00:00Z",
                "type": "power",
                "daily_start_hour": 9,
                "daily_stop_hour": 17,
                "caller_id": "18552345678",
                "status": "started",
                "administrative_url": "http://osdi-sample-system.org/pb-campaigns/rally-v1/manage",
                "browser_url": "http://osdi-sample-system.org/pb-campaigns/rally-v1",
                "voicemail_audio_url": "http://osdi-sample-system.org/audio-files/rally-voicemail.mp3",
                "total_completed": 100,
                "_links": {
                    "self": {
                        "href": "https://osdi-sample-system.org/api/v1/phone_bank/a91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bca"
                    },
                    "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:taggings": {
                        "href": "https://osdi-sample-system.org/api/v1/phone_bank/a91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bca/taggings"
                    },
                    "osdi:script": {
                        "href": "https://osdi-sample-system.org/api/v1/script/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0ba3"
                    },
                    "osdi:target_list": {
                        "href": "https://osdi-sample-system.org/api/v1/lists/1efc3644-af25-4253-90b8-a0baf12dbd1e"
                    },
                    "osdi:advocacy_targets": {
                        "href": "https://osdi-sample-system.org/api/v1/lists/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3"
                    },
                    "osdi:volunteers": {
                        "href": "https://osdi-sample-system.org/api/v1/lists/65345d7d-cd24-466a-a698-4a7686ef684f"
                    },
                    "osdi:events": {
                        "href": "https://osdi-sample-system.org/api/v1/lists/1efc3644-af25-4253-90b8-a0baf12dbd1e"
                    },
                    "osdi:phone_bank_results": {
                        "href": "https://osdi-sample-system.org/api/v1/phone_bank/a91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bca/phone_bank_results"
                    }
                }
            },
            {
                "identifiers": [
                    "osdi_sample_system:d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3",
                    "foreign_system:1"
                ],
                "origin_system": "OSDI Sample System",
                "created_date": "2017-03-20T21:04:31Z",
                "modified_date": "2017-03-20T21:04:31Z",
                "name": "Rally for Rivers",
                "title": "Rally for Rivers Team 1",
                "description": "Rally for Rivers phone bank for Team 1",
                "summary": "Rally for Rivers phone bank effort 1 for Team 1",
                "start_time": "2016-02-19T8:00:00Z",
                "end_time": "2016-02-20T8:00:00Z",
                "type": "power",
                "daily_start_hour": 9,
                "daily_stop_hour": 17,
                "caller_id": "18552345678",
                "status": "started",
                "administrative_url": "http://osdi-sample-system.org/pb-campaigns/rally-v1/manage",
                "browser_url": "http://osdi-sample-system.org/pb-campaigns/rally-v1",
                "voicemail_audio_url": "http://osdi-sample-system.org/audio-files/rally-voicemail.mp3",
                "total_completed": 100,
                "_links": {
                    "self": {
                        "href": "https://osdi-sample-system.org/api/v1/phone_bank/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3"
                    },
                    "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:script" : {
                        "href": "https://osdi-sample-system.org/api/v1/script/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0ba3"
                    },
                    "osdi:target_list": {
                        "href": "https://osdi-sample-system.org/api/v1/lists/1efc3644-af25-4253-90b8-a0baf12dbd1e"
                    },
                    "osdi:advocacy_targets": {
                        "href": "https://osdi-sample-system.org/api/v1/lists/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3"
                    },
                    "osdi:volunteers": {
                        "href": "https://osdi-sample-system.org/api/v1/lists/65345d7d-cd24-466a-a698-4a7686ef684f"
                    },
                    "osdi:events": {
                        "href": "https://osdi-sample-system.org/api/v1/lists/1efc3644-af25-4253-90b8-a0baf12dbd1e"
                    },
                    "osdi:phone_bank_results": {
                        "href": "https://osdi-sample-system.org/api/v1/phone_bank/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/phone_bank_results"
                    }
                }
            },   
            //truncated for brevity
        ]
    }
}

Back to top…

Scenario: Retrieving an individual Phone bank resource (GET)

Calling an individual Phonebank resource will return the resource directly.

Request

GET https://osdi-sample-system.org/api/v1/phone_bank/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0baa

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:a91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bca",
        "foreign_system:1"
    ],
    "origin_system": "OSDI Sample System",
    "created_date": "2017-03-20T21:04:31Z",
    "modified_date": "2017-03-20T21:04:31Z",
    "name": "Rally for Rivers",
    "title": "Rally for Rivers Team 1",
    "description": "Rally for Rivers phone bank for Team 1",
    "summary": "Rally for Rivers phone bank effort 1 for Team 1",
    "start_time": "2018-02-19T8:00:00Z",
    "end_time": "2018-02-20T8:00:00Z",
    "type": "power",
    "daily_start_hour": 9,
    "daily_stop_hour": 17,
    "caller_id": "18552345678",
    "status": "started",
    "administrative_url": "http://osdi-sample-system.org/pb-campaigns/rally-v1/manage",
    "browser_url": "http://osdi-sample-system.org/pb-campaigns/rally-v1",
    "voicemail_audio_url": "http://osdi-sample-system.org/audio-files/rally-voicemail.mp3",
    "total_completed": 100,
    "_links": {
        "self": {
            "href": "https://osdi-sample-system.org/api/v1/phone_bank/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3"
        },
        "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:script" : {
            "href": "https://osdi-sample-system.org/api/v1/script/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0ba3"
        },
        "osdi:target_list": {
            "href": "https://osdi-sample-system.org/api/v1/lists/1efc3644-af25-4253-90b8-a0baf12dbd1e"
        },
        "osdi:advocacy_targets": {
            "href": "https://osdi-sample-system.org/api/v1/lists/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3"
        },
        "osdi:volunteers": {
            "href": "https://osdi-sample-system.org/api/v1/lists/65345d7d-cd24-466a-a698-4a7686ef684f"
        },
        "osdi:events": {
            "href": "https://osdi-sample-system.org/api/v1/lists/1efc3644-af25-4253-90b8-a0baf12dbd1e"
        },
        "osdi:phone_bank_results": {
            "href": "https://osdi-sample-system.org/api/v1/phone_bank/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/phone_bank_results"
        }
    }
}

Back to top…

Scenario: Creating a new Phonebank resource (POST)

Posting to the effort collection endpoint will allow you to create a new Phonebank. The response is the new Phonebank resource 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/phone_bank/

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

{
    "identifiers": [
        "foreign_system:1"
    ],
    "origin_system": "OSDI Sample System",
    "name": "Rally for Rivers",
    "title": "Rally for Rivers Team 1",
    "description": "Rally for Rivers phone bank for Team 1",
    "summary": "Rally for Rivers phone bank effort 1 for Team 1",
    "start_time": "2018-02-19T8:00:00Z",
    "end_time": "2018-02-20T8:00:00Z",
    "daily_start_hour": 9,
    "daily_stop_hour": 17,
    "type": "power",
    "caller_id": "18552345678",
    "voicemail_audio_url": "http://osdi-sample-system.org/audio-files/rally-voicemail.mp3",
    "_links": {
        "osdi:script": {
            "href": "https://osdi-sample-system.org/api/v1/script/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0ba3"
        },
        "osdi:target_list": {
            "href": "https://osdi-sample-system.org/api/v1/lists/1efc3644-af25-4253-90b8-a0baf12dbd1e"
        },
        "osdi:volunteers": {
            "href": "https://osdi-sample-system.org/api/v1/lists/65345d7d-cd24-466a-a698-4a7686ef684f"
        },
    }
}

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": "2017-03-20T21:04:31Z",
    "modified_date": "2017-03-20T21:04:31Z",
    "name": "Rally for Rivers",
    "title": "Rally for Rivers Team 1",
    "description": "Rally for Rivers phone bank for Team 1",
    "summary": "Rally for Rivers phone bank effort 1 for Team 1",
    "start_time": "2018-02-19T8:00:00Z",
    "end_time": "2018-02-20T8:00:00Z",
    "type": "power",
    "daily_start_hour": 9,
    "daily_stop_hour": 17,
    "caller_id": "18552345678",
    "status": "pending",
    "administrative_url": "http://osdi-sample-system.org/pb-campaigns/rally-v1/manage",
    "browser_url": "http://osdi-sample-system.org/pb-campaigns/rally-v1",
    "voicemail_audio_url": "http://osdi-sample-system.org/audio-files/rally-voicemail.mp3",
    "total_completed": 0,
    "_links": {
        "self": {
            "href": "https://osdi-sample-system.org/api/v1/phone_bank/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3"
        },
        "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:script" : {
            "href": "https://osdi-sample-system.org/api/v1/script/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0ba3"
        },
        "osdi:target_list": {
            "href": "https://osdi-sample-system.org/api/v1/lists/1efc3644-af25-4253-90b8-a0baf12dbd1e"
        },
        "osdi:volunteers": {
            "href": "https://osdi-sample-system.org/api/v1/lists/65345d7d-cd24-466a-a698-4a7686ef684f"
        },
        "osdi:phone_bank_results": {
            "href": "https://osdi-sample-system.org/api/v1/phone_bank/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/phone_bank_results"
        }
    }
}

Back to top…

Scenario: Modifying a Phonebank resource (PUT)

You can update a phonebank resource by calling a PUT operation on that phone bank’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/phone_bank/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0baa

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

{
    "name": "Rally for Mountains",
    "title": "Rally for Mountains Team 2",
    "description": "Rally for Mountains phone bank for Team 2",
    "summary": "Rally for Mountains phone bank effort 1 for Team 2",
    "status": "started"
}

Response

200 OK

Content-Type: application/hal+json
Cache-Control: max-age=0, private, must-revalidate
{
    "identifiers": [
        "osdi_sample_system:a91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bca",
        "foreign_system:1"
    ],
    "origin_system": "OSDI Sample System",
    "created_date": "2017-03-20T21:04:31Z",
    "modified_date": "2017-03-20T21:04:31Z",
    "name": "Rally for Mountains",
    "title": "Rally for Mountains Team 2",
    "description": "Rally for Mountains phone bank for Team 2",
    "summary": "Rally for Mountains phone bank effort 1 for Team 2",
    "start_time": "2018-02-19T8:00:00Z",
    "end_time": "2018-02-20T8:00:00Z",
    "type": "power",
    "daily_start_hour": 9,
    "daily_stop_hour": 17,
    "caller_id": "18552345678",
    "status": "started",
    "administrative_url": "http://osdi-sample-system.org/pb-campaigns/rally-v1/manage",
    "browser_url": "http://osdi-sample-system.org/pb-campaigns/rally-v1",
    "voicemail_audio_url": "http://osdi-sample-system.org/audio-files/rally-voicemail.mp3",
    "total_completed": 100,
    "_links": {
        "self": {
            "href": "https://osdi-sample-system.org/api/v1/phone_bank/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3"
        },
        "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:script" : {
            "href": "https://osdi-sample-system.org/api/v1/script/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0ba3"
        },
        "osdi:target_list": {
            "href": "https://osdi-sample-system.org/api/v1/lists/1efc3644-af25-4253-90b8-a0baf12dbd1e"
        },
        "osdi:advocacy_targets": {
            "href": "https://osdi-sample-system.org/api/v1/lists/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3"
        },
        "osdi:volunteers": {
            "href": "https://osdi-sample-system.org/api/v1/lists/65345d7d-cd24-466a-a698-4a7686ef684f"
        },
        "osdi:events": {
            "href": "https://osdi-sample-system.org/api/v1/lists/1efc3644-af25-4253-90b8-a0baf12dbd1e"
        },
        "osdi:phone_bank_results": {
            "href": "https://osdi-sample-system.org/api/v1/phone_bank/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/phone_bank_results"
        }
    }
}

Back to top…

Scenario: Deleting a Phonebank Resource (DELETE)

You may delete an effort by calling the DELETE command on the Phonebank’s endpoint.

Request

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

Back to top…