Tuesday, May 14, 2024

As we move closer to an updated Emergency website (emergency.uiowa.edu) on SiteNow, it is necessary to also update the API that lives at that website. We are adopting the same JSON:API standard that Drupal has adopted. There will be changes to the API endpoints and how the data returned by the API is formatted.

Endpoint changes

  • We are removing the XML API entirely. We didn't find significant usage of this version of the API. Consumers are encouraged to switch to the JSON format.
  • The JSON API endpoint will change from /api/active.json to /api/active. The endpoint still delivers a JSON payload but without the file extension. The endpoint won't resolve with .json appended.

Data structure changes

The following data structure changes were necessary to adhere to the JSON:API 1.0 specification:

  • The outside wrapper uihphawkalert becomes data.
  • The inside wrapper hawkalert becomes attributes.
  • date changes from UNIX timestamp to ISO-8601 YYYY-MM-DDThh:mm:ssTZD
  • more_info_link has been updated to output the website URL with https:// prefix rather than directing folks to the shorter https://e.uiowa.edu. This was a requested change from Campus Safety.