DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Data Engineering
  3. Data
  4. Playing With One Possible OpenAPI Spec for the Human Services Data Specification (HSDS)

Playing With One Possible OpenAPI Spec for the Human Services Data Specification (HSDS)

JSON and API Design

Kin Lane user avatar by
Kin Lane
·
Apr. 24, 16 · Review
Like (3)
Save
Tweet
Share
4.70K Views

Join the DZone community and get the full member experience.

Join For Free

As I was preparing for my talk with Dan from Open Referral, I published some of my thoughts on the organization, and the Human Services Data Specification (HSDS). One of the things I did as part of that work was generating of a first draft of an OpenAPI Spec for the Open Referral API. To create that draft, I used the existing Ohana API as the base, exposing the same endpoints as they did in the Code For America project. 

Over the last couple days, I spent some more time getting to know the data model set forth by HSDS, and got to work evolving my draft OpenAPI Spec to be closer in alignment with the data schema. To do this I took the JSON Schema for HSDS that was available on the Github, and generated used it as a framework to add any missing elements to the API definition, resulting in almost 70 API paths, in support of almost 20 separate entities dictated in the HSDS.

Open Referral APIOpenAPI Spec
Categories
Get all categories/categoriesGET
Contacts
Get Contacts/contactsGET
Create New Contact/contactsPOST
Get Contact/contacts/:contact_idGET
Update Contact/contacts/:contact_idPUT
Delete Contact/contacts/:contact_idDELETE
Contact - Phones
Get Phones/contacts/:contact_id/phonesGET
Add Phone/contacts/:contact_id/phonesPOST
Get Phone/contacts/:contact_id/phones/:phone_idGET
Update Phone/contacts/:contact_id/phones/:phone_idPUT
Delete Phone/contacts/:contact_id/phones/:phone_idDELETE
Locations
Get Locations/locationsGET
Add Location/locationsPOST
Get Location/locations/:location_idGET
Update Location/locations/:location_idUPDATE
Delete Location/locations/:location_idDELETE
Location - Holiday Schedule
Get Holiday Schedule/locations/:location_id/holiday_schedule/GET
Add Holiday Schedule/locations/:location_id/holiday_schedule/POST
Get Holiday Schedule/locations/:location_id/holiday_schedule/:holiday_schedule_id/GET
Update Holiday Schedule/locations/:location_id/holiday_schedule/:holiday_schedule_id/PUT
Delete Holiday Schedule/locations/:location_id/holiday_schedule/:holiday_schedule_id/DELETE
Location - Language
Get Languages/locations/:location_id/languages/GET
Add Languages/locations/:location_id/languages/POST
Get Languages/locations/:location_id/languages/:language_id/GET
Update Languages/locations/:location_id/languages/:language_id/PUT
Delete Languages/locations/:location_id/languages/:language_id/DELETE
Location - Postal Address
Get Postal Address/locations/:location_id/postal_addressGET
Add New Postal Adress/locations/:location_id/postal_addressPOST
Get Postal Address/locations/:location_id/postal_address/:postal_address_idGET
Update Postal Address/locations/:location_id/postal_address/:postal_address_idPUT
Delete Postal Address/locations/:location_id/postal_address/:postal_address_idDELETE
Location - Physical Address
Get Physical Address/locations/:location_id/physical_addressGET
Add New Physical Adress/locations/:location_id/physical_addressPOST
Get Physical Address/locations/:location_id/physical_address/:postal_address_idGET
Update Physical Address/locations/:location_id/physical_address/:postal_address_idPUT
Delete Physical Address/locations/:location_id/physical_address/:postal_address_idDELETE
Location - Phones
Get Phones/locations/:location_id/phonesGET
Add Phone/locations/:location_id/phonesPOST
Get Phone/locations/:location_id/phones/:phone_idGET
Update Phone/locations/:location_id/phones/:phone_idPUT
Delete Phone/locations/:location_id/phones/:phone_idDELETE
Location - Regular Schedule
Get Regular Schedule/locations/:location_id/regular_scheduleGET
Add Regular Schedule/locations/:location_id/regular_schedulePOST
Get Regular Schedule/locations/:location_id/regular_schedule/:regular_schedule_id/GET
Update Regular Schedule/locations/:location_id/regular_schedule/:regular_schedule_id/PUT
Delete Regular Schedule/locations/:location_id/regular_schedule/:regular_schedule_id/DELETE
Location - Services
Get Service/locations/:location_id/services/GET
Add Service/locations/:location_id/services/POST
Get Service/locations/:location_id/services/:service_id/GET
Update Service/locations/:location_id/services/:service_id/PUT
Delete Service/locations/:location_id/services/:service_id/DELETE
Location - Accessibility For Disabilities
Get Accessibility For Disabilities/locations/:location_id/accessibility_for_disabilities/GET
Add Accessibility For Disabilities/locations/:location_id/accessibility_for_disabilities/POST
Get Accessibility For Disabilities/locations/:location_id/accessibility_for_disabilities/:accessibility_for_disabilities_id/GET
Update Accessibility For Disabilities/locations/:location_id/accessibility_for_disabilities/:accessibility_for_disabilities_id/PUT
Delete Accessibility For Disabilities/locations/:location_id/accessibility_for_disabilities/:accessibility_for_disabilities_id/DELETE
Metadata
Get Metadata/metadataGET
Add New Metadata/metadataPOST
Get Service/metadata/:metadata_idGET
Delete Metadata/metadata/:metadata_idDELETE
Organizations
Get Locations/organizationsGET
Create a new organization/organizationsPOST
Get Organization/organizations/:organization_idGET
Update Existing Organization/organizations/:organization_idPUT
Delete Organization/organizations/:organization_idDELETE
Organization - Contacts
Get Contacts/organizations/:organization_id/contactsGET
Add Contact/organizations/:organization_id/contactsPOST
Get Contact/organizations/:organization_id/contacts/:contact_id/GET
Update Contact/organizations/:organization_id/contacts/:contact_id/PUT
Delete Contact/organizations/:organization_id/contacts/:contact_id/DELETE
Organization - Funding
Get Funding/organizations/:organization_id/funding/GET
Add Funding/organizations/:organization_id/funding/POST
Get Funding/organizations/:organization_id/funding/:funding_id/GET
Update Funding/organizations/:organization_id/funding/:funding_id/PUT
Delete Funding/organizations/:organization_id/funding/:funding_id/DELETE
Organization - Locations
Get Location/organizations/:organization_id/locationsGET
Create a new location/organizations/:organization_id/locationsPOST
Update Existing Location/organizations/:organization_id/locations/:location_id/GET
Create a new location/organizations/:organization_id/locations/:location_id/PUT
Delete Location/organizations/:organization_id/locations/:location_id/DELETE
Organization - Phones
Get Phones/organizations/:organization_id/phonesGET
Add Phone/organizations/:organization_id/phonesPOST
Get Phone/organizations/:organization_id/phones/:phone_idGET
Update Phone/organizations/:organization_id/phones/:phone_idPUT
Delete Phone/organizations/:organization_id/phones/:phone_idDELETE
Organization - Programs
Get Programs/organizations/:organization_id/programsGET
Add Program/organizations/:organization_id/programsPOST
Get Program/organizations/:organization_id/programs/:program_id/GET
Update Program/organizations/:organization_id/programs/:program_id/PUT
Delete Program/organizations/:organization_id/programs/:program_id/DELETE
Organization - Program Services
Get Service/organizations/:organization_id/programs/:program_id/services/GET
Add Service/organizations/:organization_id/programs/:program_id/services/POST
Get Service/organizations/:organization_id/programs/:program_id/services/:service_idGET
Update Service/organizations/:organization_id/programs/:program_id/services/:service_idPUT
Delete Service/organizations/:organization_id/programs/:program_id/services/:service_idDELETE
Organization - Services
Get Services/organizations/:organization_id/servicesGET
Add Service/organizations/:organization_id/servicesPOST
Get Service/organizations/:organization_id/services/:service_id/GET
Update Service/organizations/:organization_id/services/:service_id/PUT
Delete Service/organizations/:organization_id/services/:service_id/DELETE
Search
Get locations that match certain criteria./searchGET
Service - Categories
Update a service’s categories/services/:service_id/categoriesPUT
Service - Contacts
Get Contacts/services/:service_id/contactsGET
Add Contact/services/:service_id/contactsPOST
Get Contact/services/:service_id/contacts/:contact_id/GET
Update Contact/services/:service_id/contacts/:contact_id/PUT
Delete Contact/services/:service_id/contacts/:contact_id/DELETE
Service - Eligibility
Get Eligibility/services/:service_id/eligibility/GET
Add Eligibility/services/:service_id/eligibility/POST
Get Eligibility/services/:service_id/eligibility/:eligibility_id/GET
Update Eligibility/services/:service_id/eligibility/:eligibility_id/PUT
Eligibility Contact/services/:service_id/eligibility/:eligibility_id/DELETE
Service - Fees
Get Fees/services/:service_id/fees/GET
Add Fees/services/:service_id/fees/POST
Get Fees/services/:service_id/fees/:feed_id/GET
Update Fees/services/:service_id/fees/:feed_id/PUT
Eligibility Fees/services/:service_id/fees/:feed_id/DELETE
Service - Funding
Get Funding/services/:service_id/funding/GET
Add Funding/services/:service_id/funding/POST
Get Funding/services/:service_id/funding/:funding_id/GET
Update Funding/services/:service_id/funding/:funding_id/PUT
Delete Funding/services/:service_id/funding/:funding_id/DELETE
Service - Holiday Schedule
Get Holiday Schedule/services/:service_id/holiday_schedule/GET
Add Holiday Schedule/services/:service_id/holiday_schedule/POST
Get Holiday Schedule/services/:service_id/holiday_schedule/:holiday_schedule_id/GET
Update Holiday Schedule/services/:service_id/holiday_schedule/:holiday_schedule_id/PUT
Delete Holiday Schedule/services/:service_id/holiday_schedule/:holiday_schedule_id/DELETE
Service - Interpretation Services
Get Interpretation Services/services/:service_id/intepretation_services/GET
Add Interpretation Services/services/:service_id/intepretation_services/POST
Get Interpretation Services/services/:service_id/intepretation_services/:intepretation_services_id/GET
Update Interpretation Services/services/:service_id/intepretation_services/:intepretation_services_id/PUT
Delete Interpretation Services/services/:service_id/intepretation_services/:intepretation_services_id/DELETE
Service - Languages
Get Languages/services/:service_id/languages/GET
Add Languages/services/:service_id/languages/POST
Get Languages/services/:service_id/languages/:language_id/GET
Update Languages/services/:service_id/languages/:language_id/PUT
Delete Languages/services/:service_id/languages/:language_id/DELETE
Service - Payment Accepted
Get Payment Accepted/services/:service_id/payment_accepted/GET
Add Payment Accepted/services/:service_id/payment_accepted/POST
Get Payment Accepted/services/:service_id/payment_accepted/:payment_accepted_id/GET
Update Payment Accepted/services/:service_id/payment_accepted/:payment_accepted_id/PUT
Delete Payment Accepted/services/:service_id/payment_accepted/:payment_accepted_id/DELETE
Service - Phones
Get Phones/services/:service_id/phonesGET
Add Phone/services/:service_id/phonesPOST
Get Phone/services/:service_id/phones/:phone_idGET
Update Phone/services/:service_id/phones/:phone_idPUT
Delete Phone/services/:service_id/phones/:phone_idDELETE
Service - Regular Schedule
Get Regular Schedule/services/:service_id/regular_scheduleGET
Add Regular Schedule/services/:service_id/regular_schedulePOST
Get Regular Schedule/services/:service_id/regular_schedule/:required_document_id/GET
Update Regular Schedule/services/:service_id/regular_schedule/:required_document_id/PUT
Delete Regular Schedule/services/:service_id/regular_schedule/:required_document_id/DELETE
Service - Required Document
Get Required Document/services/:service_id/required_document/GET
Add Required Document/services/:service_id/required_document/POST
Get Required Document/services/:service_id/required_document/:required_document_id/GET
Update Required Document/services/:service_id/required_document/:required_document_id/PUT
Delete Required Document/services/:service_id/required_document/:required_document_id/DELETE
Service - Areas
Get Service Area/services/:service_id/service_area/GET
Add Service Area/services/:service_id/service_area/POST
Get Service Area/services/:service_id/service_area/:service_area_idGET
Update Service Area/services/:service_id/service_area/:service_area_idPUT
Delete Service Area/services/:service_id/service_area/:service_area_idDELETE
 
EntitiesJSON Schema
accessibility_for_disabilities 
  • id
  • location_id
  • accessibility
contact 
  • id
  • organization_id
  • service_id
  • name
  • title
  • department
  • email
eligibility 
  • id
  • service_id
  • eligibility
fee
funding 
  • id
  • organization_id
  • service_id
  • source
holiday_schedule 
  • id
  • service_id
  • location_id
  • closed
  • opens_at
  • closes_at
  • start_date
  • end_date
intepretation_services
language 
  • id
  • service_id
  • location_id
  • language
location 
  • id
  • organization_id
  • name
  • alternate_name
  • transportation
  • latitude
  • longitude
metadata 
  • id
  • resource_id
  • last_action_date
  • last_action_type
  • field_name
  • previous_value
  • replacement_value
  • updated_by
organization 
  • id
  • name
  • alternate_name
  • description
  • email
  • url
  • tax_status
  • tax_id
  • year_incorporated
  • legal_status
payment_accepted
phone 
  • id
  • location_id
  • service_id
  • organization_id
  • contact_id
  • number
  • extension
  • type
  • department
physical_address 
  • id
  • location_id
  • attention
  • address_1
  • address_2
  • address_3
  • address_4
  • city
  • state_province
  • postal_code
  • country
postal_address 
  • id
  • location_id
  • attention
  • address_1
  • address_2
  • address_3
  • address_4
  • city
  • state_province
  • postal_code
  • country
program 
  • id
  • organization_id
  • name
  • alternate_name
regular_schedule 
  • id
  • service_id
  • location_id
  • weekday
  • opens_at
  • closes_at
required_document
service 
  • id
  • organization_id
  • program_id
  • location_id
  • name
  • alternate_name
  • url
  • email
  • status
  • application_process
  • wait_time
service_area 
  • id
  • service_id
  • service_area

This is a very formulaic, generated, representation of what the Open Referral API could look like. While I have lots of ideas on how to improve on the design, I want to be cautious to not project too much of my own views on the API design--something the community should do together. I can tell a lot of work went into the current specification, and the same amount of energy should go into evolving the API design.

I accomplished what I wanted. Learn more about HSDS, get more familiar with the entities at play, while also producing a fairly robust representation of what an API could look like for Open Referral. It has way more details than the average implementation will need, but I wanted to cover all the bases, providing full control over every entity, and relationship represented in HSDS. Most importantly I was able to get more intimate with the specification, while also producing an OpenAPI Spec that will playing a central role throughout this project.

Next I'm going to play with some minimum viable representations, and other ways to tell stories and talk about the HSDS. I'd like to eventually have a whole toolbox of YAML / JSON driven UI elements, like the one I pasted in this post, allowing me to describe all the moving parts of the Open Referral work. More posts to come, as I work through my thoughts, and play possible designs for the Human Services Data Specification (HSDS).

POST (HTTP) Schedule (computer science) Contacts (Apple) Data (computing) Physical address API

Published at DZone with permission of Kin Lane, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Real-Time Analytics for IoT
  • 5 Software Developer Competencies: How To Recognize a Good Programmer
  • Front-End Troubleshooting Using OpenTelemetry
  • Key Elements of Site Reliability Engineering (SRE)

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: