-
Notifications
You must be signed in to change notification settings - Fork 0
V1 ‐ V2 Migration Guide
We have been hard at work to bring you an all-new Yalies, including a new website and API. As part of this process, we are making breaking API changes—meaning your projects using the Yalies API may no longer work unless you update your code.
We will communicate a timeline to all API key holders via email. The Yalies V1 API will eventually be shut down; however, before this happens, both the V1 and V2 APIs will remain online during an advisory period, during which you can migrate and test your code.
This document is a summary of how to migrate your code from V1 to V2. It should take less than 30 minutes to change your code.
In your project, run:
pip install yalies --upgradeGenerate a V2 API key here.
All breaking changes described below still apply. In particular, take note of the changes to page and the removal of some response fields.
In your project, run:
npm install yalies@latestGenerate a V2 API key here.
All breaking changes described below still apply. In particular, take note of the changes to page and the removal of some response fields.
The base URL of the Yalies V2 API is:
https://api.yalies.io/v2/
Important: the protocol must be https, i.e. you must use an encrypted TLS connection for all requests to the API. If your API key is ever used over HTTP unencrypted, it will be automatically revoked.
Change all instances of https://yalies.io/api/ to https://api.yalies.io/v2/.
V1 API keys will not work in the V2 API. You can generate a V2 API key here.
Generate a V2 API key, and replace all instances of your V1 API key with the new one.
The following fields have been removed from the response JSON of the /people endpoint:
residencebuilding_codeentrywayfloorsuiteroom
This is due to a change of the Yale Face Book in which this data is no longer publicized. We are investigating alternative ways to obtain this data, and we may add it back in a future minor (i.e. non-breaking) API version.
If you are using any of the removed fields in your project, you must change your project to no longer expect these fields to be returned by the API.
The birthday field has been removed from the response JSON of the /people endpoint. This change was made because the birthday field is redundant and locale-specific.
If you are using the birthday field in your project, change your code to compute the desired string using the birth_month and birth_day fields.
Remember that birth_month is one-indexed (think Python, not JS)—that means January = 1.
Some sample code to compute the birthday string:
const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
const birthday = `${months[birth_month - 1]} ${birth_day}`;months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
birthday = months[birth_month - 1] + " " + str(birth_day)The /people endpoint now applies pagination by default.
You can specify a page_size field in your request body; this field now has a maximum value of 100. If no page_size field is provided, it will default to 100.
The request body field page is now zero-indexed, meaning the first page of results is at page: 0.
If you are already using pagination in your /people API calls, ensure that page_size is no greater than 100, and change page to start at 0.
If you are not using pagination in your /people API calls, and you need more than 100 results, you must now call the API multiple times, each time with an increasing page value.
The /events route has been removed from the Yalies API. This change was made because the /events route has been broken for quite some time; we may bring it back in a future minor (i.e. non-breaking) API version.
If you have a specific use case for the /events route in mind, please email the Yalies team lead at eric[dot]yoon[at]yale.edu.