Data Services - reading a record ================================ Reading a single record from the Data Services follows the :doc:`general principles for reading data `. You simply extend the web service URL for the entity you want to read from with the ID of the record you want to read. Examples -------- Assuming that your warehouse is installed at www.mywarehouse.com and you have obtained :doc:`valid read authentication tokens `, the following examples illustrate how to read records from the Data Services. Service calls are shown with GET parameters though the parameters can also be sent as POST. Example 1 - basic attributes of occurrence ID 10 in JSON format ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This request uses the default list_occurrences view to return minimal information of a record. Request:: http://www.mywarehouse.com/index.php/services/data/occurrence/10 ?nonce=&auth_token= Example response: .. code-block:: json [{ "survey":"Demonstration Survey", "location":"Poole", "date_start":"1980-01-01", "date_end":"1980-12-31", "date_type":"Y", "entered_sref":"SU012023", "entered_sref_system":"osgb", "taxon":"White Egret", "website_id":"1", "id":"10", "recorder_names":null, "zero_abundance":"f", "taxon_list_id":"2" }] Example 2 - information on a taxon group, including column and count ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This request uses the **wantColumns** and **wantCount** URL parameters. Request:: http://localhost/indicia/index.php/services/data/taxon_group/4 ?nonce=&auth_token=&wantColumns=1&wantCount=1 Example response: .. code-block:: json { "records":[ {"id":"4","title":"Beetles","website_id":null} ], "columns":{ "id":{"type":"int","max":2147483647,"unsigned":false,"null":true}, "title":{"type":"string","null":true}, "website_id":{"type":"int","max":2147483647,"unsigned":false,"null":true} }, "count":1 } Example 3 - detailed attributes of occurrence ID 10 in XML format ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This request uses the default list_occurrences view to return minimal information of a record. Request:: http://www.mywarehouse.com/index.php/services/data/occurrence/10 ?view=detail&mode=xml&nonce=&auth_token= Example response: .. code-block:: xml 10 f 3 5 C Little Egret SU012023 osgb --binary geometry data-- --well known text geometry data 1 1980-01-01 1980-12-31 Y Poole 1 admin 2012-02-10 17:41:03 admin 2012-02-10 17:41:03 N 10 f f 2