IDigBio API v1 Examples: Difference between revisions
Jump to navigation
Jump to search
Line 662: | Line 662: | ||
=== Fetch an Older Version of a Particular Media Record === | === Fetch an Older Version of a Particular Media Record === | ||
Consider an iDigBio Media Record "idigbio:uuid" : "ff5fd841-6bc6-4241-80d3-def7e1b6d5e8" | Consider an iDigBio Media Record "idigbio:uuid" : "ff5fd841-6bc6-4241-80d3-def7e1b6d5e8" that has been updated over time so there are multiple revisions of the record. The API shows that the current version of this particular record is version 1. | ||
<pre> | <pre> | ||
Line 669: | Line 669: | ||
</pre> | </pre> | ||
We would like to look at the previous version (version 0) to see what has changed. | We would like to look at the previous version (version 0) to see what has changed. Version 0 of a record is considered the "original" version of a record. We do this by adding <code>?version=0</code> as a parameter to the URL. | ||
<pre> | <pre> | ||
curl -s http://api.idigbio.org/v1/mediarecords/ff5fd841-6bc6-4241-80d3-def7e1b6d5e8?version=0 | json_pp | grep version | |||
"idigbio:version" : "0", | "idigbio:version" : "0", | ||
</pre> | </pre> | ||
The "version" parameter is available for any endpoint that returns a full entity record. | |||
=== Fetch a list of five MediaRecord IDs === | === Fetch a list of five MediaRecord IDs === |