IDigBio API v1 Examples: Difference between revisions

Line 1,057: Line 1,057:
==== Curculionidae Search Example ====
==== Curculionidae Search Example ====


Let us say we are looking for an image of a particular Curculionidae specimen (a family of weevils).  
Let us say we are looking for images associated with specimen records for Family Curculionidae (a family of weevils).  


If we already know the iDigBio UUID of the specimen we can simply use the <code>/media</code> endpoint for the record:
If we already know the iDigBio UUID of a specimen we can simply use the <code>/media</code> endpoint for the record:


<code>
<code>
http://api.idigbio.org/v1/records/354210ae-4aa3-49d2-8a66-78a86b019c7b/media?quality=webview
http://api.idigbio.org/v1/records/c2e34bda-0405-48ea-b7b2-76f893777f20/media?quality=webview
</code>
</code>


But how did we find the proper iDigBio UUID for this specimen record in the first place?
But how did we find the proper iDigBio UUID for this specimen record in the first place?


The iDigBio search portal is of course built just for this purpose.  If we wanted to search for these specimens via a software program, we could use the iDigBio Elasticsearch interface.


The full JSON Specimen Record::
<pre># EXAMPLE GOES HERE</pre>
 
<pre>
{
  "idigbio:uuid" : "354210ae-4aa3-49d2-8a66-78a86b019c7b",
  "idigbio:etag" : "02736fd7318eafed62a4a5ff35175a27fa63983e",
  "idigbio:links" : {
      "mediarecord" : [
        "http://api.idigbio.org/v1/mediarecords/59141135-813a-4db1-a527-009ae6d17101"
      ],
      "owner" : [
        "872733a2-67a3-4c54-aa76-862735a5f334"
      ],
      "recordset" : [
        "http://api.idigbio.org/v1/recordsets/69037495-438d-4dba-bf0f-4878073766f1"
      ]
  },
  "idigbio:version" : 2,
  "idigbio:createdBy" : "872733a2-67a3-4c54-aa76-862735a5f334",
  "idigbio:recordIds" : [
      "urn:uuid:b036a012-ba1e-41e0-a39a-76fc253640cf"
  ],
  "idigbio:dateModified" : "2014-04-22T07:33:16.129Z",
  "idigbio:data" : {
      "dwc:day" : "16",
      "dwc:identifiedBy" : "CPMAB",
      "idigbio:recordId" : "urn:uuid:b036a012-ba1e-41e0-a39a-76fc253640cf",
      "dwc:catalogNumber" : "NAUF4A0013309",
      "dwc:locality" : "Box Cyn. Santa Rita Mts.",
      "dwc:occurrenceID" : "1063507",
      "dwc:year" : "1967",
      "dwc:recordedBy" : "C.D. Johnson",
      "dwc:scientificName" : "Curculionidae",
      "dwc:basisOfRecord" : "PreservedSpecimen",
      "dwc:family" : "Curculionidae",
      "symbiotaverbatimScientificName" : "Curculionidae",
      "dwc:collectionCode" : "NAUF",
      "dcterms:modified" : "2013-12-20 13:00:36",
      "dwc:country" : "USA",
      "dcterms:references" : "http://symbiota4.acis.ufl.edu/scan/portal/collections/individual/index.php?occid=1063507",
      "dwc:eventDate" : "1967-08-16",
      "dwc:scientificNameAuthorship" : "Latreille, 1802",
      "dwc:collectionID" : "urn:uuid:c87a0756-fdd7-4cb6-9921-ca5774f8330e",
      "dwc:minimumElevationInMeters" : "1524",
      "dwc:verbatimElevation" : "5000'",
      "dwc:startDayOfYear" : "228",
      "dwc:month" : "8",
      "dwc:rights" : "http://creativecommons.org/licenses/by-nc-sa/3.0/",
      "dwc:stateProvince" : "Arizona",
      "dwc:genus" : "Curculionidae",
      "dwc:institutionCode" : "NAU",
      "dwc:county" : "Pima"
  }
}
</pre>
 
'''TO DO:'''
  '''# here goes the rest of the example...'''


=== Mapping Example ===
=== Mapping Example ===
1,554

edits