IDigBio API v1 Examples: Difference between revisions

Jump to navigation Jump to search
add screenshot of thumbnail and thumbnail into new section →‎Fetch five MediaRecord IDs (endpoints) from the API
(add screenshot of thumbnail and thumbnail into new section →‎Fetch five MediaRecord IDs (endpoints) from the API)
Line 716: Line 716:
http://api.idigbio.org/v1/mediarecords?limit=5&offset=5
http://api.idigbio.org/v1/mediarecords?limit=5&offset=5


Screenshot of Results:
[[File:Screenshot_jsonview_idigbio_api_mediarecords_limit_offset.png]]


Example Results:
Example Results:
Line 781: Line 778:
</pre>
</pre>


Display a thumbnail of the 3rd record in the result:
 
Screenshot of Results:
 
[[File:Screenshot_jsonview_idigbio_api_mediarecords_limit_offset.png]]
 
=== Display a thumbnail image for a mediarecord ===
 
Let's say we wish to display a thumbnail image for the 3rd mediarecord in the previous result list (highlighted in the screenshot).  We will use the media endpoint for that mediarecord's GUID and add the "quality" parameter with "thumbnail" as the value:


http://api.idigbio.org/v1/mediarecords/00002091-4fb3-410a-9307-bd3e917dfcca/media?quality=thumbnail
http://api.idigbio.org/v1/mediarecords/00002091-4fb3-410a-9307-bd3e917dfcca/media?quality=thumbnail
Accessing that URL results in a number of HTTP Redirects to the target thumbnail image, illustrated here with the Chrome Developer Tools visible:
[[File:Screenshot_thumbnail_00002091-4fb3-410a-9307-bd3e917dfcca.png]]
''Note that the final image URL should not be considered stable or permanent. Images can be moved around to various storage platforms. The Mediarecord has a GUID that will remain contstant but the containing data, including the image location, may be updated over time.''


=== Curculionidae Image Example ===
=== Curculionidae Image Example ===
1,554

edits

Navigation menu