palaeoverse / rphylopic

Get Silhouettes of Organisms from PhyloPic
https://rphylopic.palaeoverse.org
GNU General Public License v3.0
91 stars 9 forks source link

Use /collections API endpoint #81

Closed willgearty closed 10 months ago

willgearty commented 1 year ago

Any thoughts about utilizing the /collections endpoints on PhyloPic for attribution? You can link to pages like these: https://www.phylopic.org/collections/39f27cb5-5952-01d2-002a-0721a815ac14

There is also a way to turn those into permalinks, although I still need to document that for public usage.

Originally posted by @keesey in https://github.com/palaeoverse-community/rphylopic/pull/79#issuecomment-1690291905

willgearty commented 11 months ago

@LewisAJones will incorporate this as an option for get_attribution().

@keesey how do we make permalinks for collections through the API?

keesey commented 11 months ago

The API Docs show how to create collections. Once you have the collection UUID, you have to use the website's API, which is not currently documented. It's fairly simple, though.

  1. Make a GET call to https://www.phylopic.org/api/permalinks/collections/<uuid>. This will return a hash string.
  2. Use that hash string to create the permalink URL: https://www.phylopic.org/permalinks/<hash>.