layout | title |
---|---|
default |
Organization |
Experimental areas of the specification are published to illustrate the design direction, allow implementers to prototype, while taking additional feedback.
This document defines the Organization resource.
Organizations are political/legal entities that generally organize a group of people that are stored in the OSDI system's database in some way.
The Organization resource is as similar as possible to the Person* resource, removing some fields that only apply to people (e.g. family name, gender identity, etc) and adding others like legal status and logo. However, the similarities are much greater. Organizations have email and postal addresses, facebook and twitter pages, etc. Many systems will store Organizations and People in the same database table and separate them by a type field or otherwise.
{% include endpoints_and_url_structures.md %}
The link relation label for a Person resource is osdi:organization
for a single Organization resource or osdi:organizations
for a collection of Organization resources.
{% include fields_intro.md %}
{% include global_fields.md %}
A list of fields specific to the Organization resource. A few things are
purposefully distinct from Person and other objects. For instance,
organization
for the organization's name is unique so an organization
resource is easily distinguishable from other resource types.
Name | Type | Description |
---|---|---|
organization | string | The organization's human-readable common name. This may not be a full name, if the organization, for instance mostly goes by an acronym -- it should be the value that would be in a listing for the organization and in prose. |
legal_status | flexenum | The organization's legal status, or "unofficial" if the organization does not have a corresponding legal entity. Common values will be "llc", "sole prop", "c3", "c4", and "pac". |
logo_image_url | string | A URL string pointing to a publicly available image file of the organization's logo. It should be a format supported in the <img> html tag. |
site_url | string | A URL pointing to the organization's own public homepage. Whereas browser_url (below) may be to a local page contextual to the system, site_url should always be the organization's own site. |
summary | string | A short one-line description of the organization. If the organization key contains an acronym, this would be where you include the full name. |
description | string | A longer description of the organization, possibly contextual to the origin_system the record comes from. |
A list of fields common to the Person resource. These fields are preserved in both so processing data can largely be the same for each. Some of these fields have different connotations in the Organization resource. For instance party_identification and languages_spoken are more about the official support/affiliation from the organization rather than about the total or average of all the organization's members.
Name | Type | Description |
---|---|---|
party_identification | flexenum | Flexenum describing the organization's politcal party identification. One of "None", "Democratic", "Republican", etc. Note that this is not about the organization's political 'tilt' but only if it has direct association with the political party |
source | string | Information about the source where this organization record was acquired. Example: "facebook-ad-october" |
languages_spoken | strings[] | Unique string array of RFC5646 tags representing the languages spoken by the organization. Example: en, en-US, fr-CA, pt-BR |
browser_url | string | A URL string pointing to the publicly available organization page on the web, such as a public profile page. |
administrative_url | string | A URL string pointing to the organization's administrative page on the web, such as a page for managing this organization's record. |
postal_addresses | Postal Addresses[] | An array of postal address object hashes associated with the organization. |
email_addresses | Email Addresses[] | An array of email address object hashes associated with the organization. |
phone_numbers | Phone Numbers[] | An array of phone number object hashes associated with the organization. |
profiles | Profiles[] | An array of profile object hashes for online services related to the organization. |
custom_fields | Custom Fields | An object hash of key/value pairs associated with the organization created by a user rather than a service or vendor. |
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.
{% include addresses.md %}
Name | Type | Description |
---|---|---|
profiles.provider | string | The provider name of the profile. Example: "Facebook" |
profiles.id | string | The unique identifier provided by the provider for the profile. Example: "135165" |
profiles.url | string | The URL to the organization's web viewable profile. Example: "http://facebook.com/john.doe" |
profiles.handle | string | The handle name of the profile. Twitter handles should not include the "@" Example: "johndoe" |
Name | Type | Description |
---|---|---|
custom_fields.[key] | string | The key associated with this custom field, with a corresponding value as a string. May be prefixed by servers based on naming conventions they document to control how collisions across systems and data sets occur. |
{% include links_intro.md %}
Name | Type | Description |
---|---|---|
self | Organization* | A self-referential link to the organization. |
events | Events[]* | A link to the collection of events the organization has sponsored. |
petitions | Petitions[]* | A link to the collection of petitions the organization has sponsored. |
donations | Donations[]* | A link to the collection of donations associated with the organization. |
submissions | Submissions[]* | A link to the collection of form submissions associated with the organization. |
attendances | Attendances[]* | A link to the collection of event attendances associated with the organization. |
signatures | Signatures[]* | A link to the collection of petition signatures associated with the organization. |
outreaches | Outreaches[]* | A link to the collection of advocacy campaign outreaches associated with the organization. |
answers | Answers[]* | A link to the collection of answers to questions associated with the organization. |
taggings | Taggings[]* | A link to the collection of taggings associated with the organization. |
items | Items[]* | A link to the collection of list items associated with the organization. |
modified_by | Person* | A link to a Person resource representing the last editor of this organization record. |
{% include scenarios_intro.md %}
Organization resources are sometimes presented as collections of organizations. For example, calling the organizations endpoint will return a collection of all the organizations stored in the system's database associated with your api key.
GET https://osdi-sample-system.org/api/v1/organizations/
Header:
OSDI-API-Token:[your api key here]
200 OK
Content-Type: application/hal+json
Cache-Control: max-age=0, private, must-revalidate
{
"total_pages": 88,
"per_page": 25,
"page": 1,
"total_records": 2188,
"_links": {
"next": {
"href": "https://osdi-sample-system.org/api/v1/organizations?page=2"
},
"osdi:organizations": [
{
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3"
},
{
"href": "https://osdi-sample-system.org/api/v1/organizations/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/organizations"
}
},
"_embedded": {
"osdi:organizations": [
{
"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",
"organization": "F.O.O.",
"legal_status": "c3",
"summary": "For Our Opinions - helping people who have opinions everywhere",
"site_url": "https://foo.example/",
"logo_image_url": "https://foo.example/images/200x200/logo.png",
"source": "october_canvass",
"browser_url": "http://osdi-sample-system.org/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3",
"administrative_url": "http://osdi-sample-system.org/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/manage",
"postal_addresses": [
{
"primary": true,
"address_lines": [
"1900 Pennsylvania Ave"
],
"locality": "Washington",
"region": "DC",
"postal_code": "20009",
"country": "US",
"language": "en",
"location": {
"latitude": 38.919,
"longitude": -77.0379,
"accuracy": "Rooftop"
},
"last_verified_date": "2014-03-20T21:04:31Z"
}
],
"email_addresses": [
{
"primary": true,
"address": "[email protected]",
"status": "subscribed"
}
],
"phone_numbers": [
{
"primary": true,
"number": "11234567890",
"extension": "432",
"description": "Worksite line",
"number_type": "Work",
"operator": "ATT",
"country": "US",
"sms_capable": false,
"do_not_call": true
}
],
"profiles": [
{
"provider": "Facebook",
"id": "john.doe.1234",
"url": "https://facebook.com/john.doe"
},
{
"provider": "Twitter",
"id": "eds34d8j2kddfd45",
"url": "https://twitter.com/johndoe",
"handle": "johndoe"
}
],
"custom_fields": {
"most_important_issue": "Equal pay"
},
"_links": {
"self": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3"
},
"osdi:answers": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/answers"
},
"osdi:attendance": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/attendance"
},
"osdi:signatures": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/signatures"
},
"osdi:submissions": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/submissions"
},
"osdi:donations": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/donations"
},
"osdi:outreaches": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/outreaches"
},
"osdi:taggings": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/taggings"
},
"osdi:items": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/items"
}
}
},
{
"organization": "Bars For Justice",
"legal_status": "c4",
"logo_image_url": "https://bar.example/images/logo.svg",
"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",
"browser_url": "http://osdi-sample-system.org/organizations/1efc3644-af25-4253-90b8-a0baf12dbd1e",
"administrative_url": "http://osdi-sample-system.org/organizations/1efc3644-af25-4253-90b8-a0baf12dbd1e/manage",
"email_addresses": [
{
"primary": true,
"address": "[email protected]",
"status": "unsubscribed"
}
],
"postal_addresses": [
{
"primary": true,
"locality": "Washington",
"region": "DC",
"postal_code": "20009",
"country": "US",
"language": "en",
"location": {
"latitude": 38.919,
"longitude": -77.0379,
"accuracy": "Approximate"
}
}
],
"_links": {
"self": {
"href": "https://osdi-sample-system.org/api/v1/organizations/1efc3644-af25-4253-90b8-a0baf12dbd1e"
},
"osdi:answers": {
"href": "https://osdi-sample-system.org/api/v1/organizations/1efc3644-af25-4253-90b8-a0baf12dbd1e/answers"
},
"osdi:attendance": {
"href": "https://osdi-sample-system.org/api/v1/organizations/1efc3644-af25-4253-90b8-a0baf12dbd1e/attendance"
},
"osdi:signatures": {
"href": "https://osdi-sample-system.org/api/v1/organizations/1efc3644-af25-4253-90b8-a0baf12dbd1e/signatures"
},
"osdi:submissions": {
"href": "https://osdi-sample-system.org/api/v1/organizations/1efc3644-af25-4253-90b8-a0baf12dbd1e/submissions"
},
"osdi:donations": {
"href": "https://osdi-sample-system.org/api/v1/organizations/1efc3644-af25-4253-90b8-a0baf12dbd1e/donations"
},
"osdi:outreaches": {
"href": "https://osdi-sample-system.org/api/v1/organizations/1efc3644-af25-4253-90b8-a0baf12dbd1e/outreaches"
},
"osdi:taggings": {
"href": "https://osdi-sample-system.org/api/v1/organizations/1efc3644-af25-4253-90b8-a0baf12dbd1e/taggings"
},
"osdi:items": {
"href": "https://osdi-sample-system.org/api/v1/organizations/1efc3644-af25-4253-90b8-a0baf12dbd1e/items"
}
}
},
//(truncated for brevity)
]
}
}
Calling an individual Organization resource will return the resource directly, along with all associated fields and appropriate links to additional information about the organization.
GET https://osdi-sample-system.org/api/v1/organizations/d32fcdd6-7366-466d-a3b8-7e0d87c3cd8b
Header:
OSDI-API-Token:[your api key here]
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",
"organization": "F.O.O.",
"legal_status": "c3",
"summary": "For Our Opinions - helping people who have opinions everywhere",
"site_url": "https://foo.example/",
"logo_image_url": "https://foo.example/images/200x200/logo.png",
"source": "october_canvass",
"browser_url": "http://osdi-sample-system.org/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3",
"administrative_url": "http://osdi-sample-system.org/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/manage",
"postal_addresses": [
{
"primary": true,
"address_lines": [
"1900 Pennsylvania Ave"
],
"locality": "Washington",
"region": "DC",
"postal_code": "20009",
"country": "US",
"language": "en",
"location": {
"latitude": 38.919,
"longitude": -77.0379,
"accuracy": "Rooftop"
}
}
],
"email_addresses": [
{
"primary": true,
"address": "[email protected]",
"status": "subscribed"
}
],
"phone_numbers": [
{
"primary": true,
"number": "11234567890",
"extension": "432",
"description": "Worksite line",
"number_type": "Work",
"operator": "ATT",
"country": "US",
"sms_capable": false,
"do_not_call": true
}
],
"profiles": [
{
"provider": "Facebook",
"id": "john.doe.1234",
"url": "https://facebook.com/john.doe"
},
{
"provider": "Twitter",
"id": "eds34d8j2kddfd45",
"url": "https://twitter.com/johndoe",
"handle": "johndoe"
}
],
"custom_fields": {
"most_important_issue": "Equal pay"
},
"_links": {
"self": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3"
},
"osdi:answers": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/answers"
},
"osdi:attendance": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/attendance"
},
"osdi:signatures": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/signatures"
},
"osdi:submissions": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/submissions"
},
"osdi:donations": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/donations"
},
"osdi:outreaches": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/outreaches"
},
"osdi:taggings": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/taggings"
},
"osdi:items": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/items"
}
}
}
Posting to the organizations collection endpoint will allow you to create a new organization. The response is the new organization 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.
POST https://osdi-sample-system.org/api/v1/organizations/
Header:
OSDI-API-Token:[your api key here]
{
"identifiers": [
"foreign_system:1"
],
"organization": "Labadabadoo",
"origin_system": "OpenSupporter",
"email_addresses": [
{
"address":"[email protected]",
"primary": true,
"status": "subscribed"
}
],
"postal_addresses": [
{
"primary": true,
"address_lines": [
"935 Ed Lock"
],
"locality": "New Dudley",
"region": "MN",
"postal_code": "17678",
"country": "RU",
"status": "Verified"
}
],
"phone_numbers": [
{
"primary": true,
"number": 19876543210,
"number_type": "Mobile",
"sms_capable": true
}
]
}
200 OK
Content-Type: application/hal+json
Cache-Control: max-age=0, private, must-revalidate
{
"identifiers": [
"osdi_sample_system:d91b4b2e-ae0e-4cd3-9ed7-de9uemdse",
"foreign_system:1"
],
"created_date": "2014-03-20T21:04:31Z",
"modified_date": "2014-03-20T21:04:31Z",
"organization": "Labadabadoo",
"origin_system": "OpenSupporter",
"browser_url": "http://osdi-sample-system.org/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3",
"administrative_url": "http://osdi-sample-system.org/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/manage",
"email_addresses": [
{
"address":"[email protected]",
"primary": true,
"status": "subscribed"
}
],
"postal_addresses": [
{
"primary": true,
"address_lines": [
"935 Ed Lock"
],
"locality": "New Dudley",
"region": "MN",
"postal_code": "17678",
"country": "RU",
"status": "Verified"
}
],
"phone_numbers": [
{
"primary": true,
"number": 19876543210,
"number_type": "Mobile",
"sms_capable": true
}
],
"_links": {
"self": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-de9uemdse"
},
"osdi:answers": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-de9uemdse/answers"
},
"osdi:attendance": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-de9uemdse/attendance"
},
"osdi:signatures": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-de9uemdse/signatures"
},
"osdi:submissions": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-de9uemdse/submissions"
},
"osdi:donations": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-de9uemdse/donations"
},
"osdi:outreaches": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-de9uemdse/outreaches"
},
"osdi:taggings": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-de9uemdse/taggings"
},
"osdi:items": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-de9uemdse/items"
}
}
}
You can update a organization by calling a PUT operation on that organization'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.
{% include array_warning.md %}
PUT https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-de9uemdse
Header:
OSDI-API-Token:[your api key here]
{
"organization": "Doctors for Education",
"email_addresses": [
{
"address":"[email protected]",
"primary": true
}
]
}
200 OK
Content-Type: application/hal+json
Cache-Control: max-age=0, private, must-revalidate
{
"identifiers": [
"osdi_sample_system:d91b4b2e-ae0e-4cd3-9ed7-de9uemdse",
"foreign_system:1"
],
"created_date": "2014-03-20T21:04:31Z",
"modified_date": "2014-03-20T22:04:31Z",
"organization": "Labadabadoo",
"origin_system": "OpenSupporter",
"browser_url": "http://osdi-sample-system.org/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3",
"administrative_url": "http://osdi-sample-system.org/organizations/d91b4b2e-ae0e-4cd3-9ed7-d0ec501b0bc3/manage",
"email_addresses": [
{
"address":"[email protected]",
"primary": true,
"status": "subscribed"
}
],
"postal_addresses": [
{
"primary": true,
"address_lines": [
"935 Ed Lock"
],
"locality": "New Dudley",
"region": "MN",
"postal_code": "17678",
"country": "RU",
"status": "Verified"
}
],
"phone_numbers": [
{
"primary": true,
"number": 19876543210,
"number_type": "Mobile",
"sms_capable": true
}
],
"_links": {
"self": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-de9uemdse"
},
"osdi:answers": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-de9uemdse/answers"
},
"osdi:attendance": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-de9uemdse/attendance"
},
"osdi:signatures": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-de9uemdse/signatures"
},
"osdi:submissions": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-de9uemdse/submissions"
},
"osdi:donations": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-de9uemdse/donations"
},
"osdi:outreaches": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-de9uemdse/outreaches"
},
"osdi:taggings": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-de9uemdse/taggings"
},
"osdi:items": {
"href": "https://osdi-sample-system.org/api/v1/organizations/d91b4b2e-ae0e-4cd3-9ed7-de9uemdse/items"
}
}
}
You may delete a organization by calling the DELETE command on the organization's endpoint.
DELETE https://osdi-sample-system.org/api/v1/organizations/d32fcdd6-7366-466d-a3b8-7e0d87c3cd8b
Header:
OSDI-API-Token:[your api key here]
200 OK
Content-Type: application/hal+json
Cache-Control: max-age=0, private, must-revalidate
{
"notice": "This organization was successfully deleted."
}