Update Sample Metadata

  • The web service https://app.geosamples.org/webservices/update.php allows the client program to update registered sample(s) metadata profile(s).
  • It only accepts POST requests from client programs. GET, PUT and DELETE are not supported.
  • Notes
    • The user should use the following test URI during client program testing, so production sample profiles are not accidentally edited.
    • New: The user can replace an existing URL using ‘old_url’ element. See document in updateSample.xsd schema file
    E.G. <external_urls>
             <old_url>http://oneurl.tobereplaced.org </old_url>

URI: https://app.geosamples.org/webservices/update.php
TEST URI: https://sesardev.geosamples.org/webservices/update.php

Request Headers
  • Requires HTTP Basic Authentication header. http://en.wikipedia.org/wiki/Basic_access_authentication
  • Accept: text/xml, application/xml
    Request Body
username={yourusername} password={yourpassword} content={sampleinformation} 

where {sampleinformation} is the xml text.

Example XML format for updating one sample profile:

<?xml version="1.0" encoding="UTF-8"?> <samples xmlns="http://app.geosamples.org"
xsi:schemaLocation="http://app.geosamples.org/4.0/updateSample.xsd "> 
  <sample_subtype>Thin Section</sample_subtype> 
  <!-- Required. --> <!-- If no classification.xsd is specified, the older format for classification is still supported e.g., Igneous>Plutonic>Felsic --> 
  <classification xmlns="http://app.geosamples.org" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  </classification> <description>arkose</description>
  <primary_location_name>Lava Mountains, Mojave Desert, California </primary_location_name> 
  <country>United States</country>
  <county>San Bernardino</county> 
  <collector>J. E. Andrew</collector>
  <collection_start_date>2002-05-30T09:30:10Z </collection_start_date>
  <original_archive>University of Kansas</original_archive> 
</sample> </samples>
  • You can update multiple samples by adding the block nested into the tag.
Response Body

HTTP status codes:

  • 200 Sample registered successfully. The response text is as follows:
    <status>Sample [Lulin Update Status Sample test] was updated successfully with IGSN [LLS00009I].</status> 
    <name>Lulin Update Status Sample test</name> 
  • 400 Bad Request - Request body either has syntax errors or xml content has errors. Error messages will look like the following.
    • XML Syntax error:
      <valid code="InvalidXML">no</valid> 
      <error>Element '{http://app.geosamples.org}user_code':......</error> 
    • XML Content error:
      <sample> name="your sample name"> 
        <valid code="InvalidSample">no</valid>
        <status>Not Saved</status> 
        <error>You do not have permission to edit the sample metadata.</error> ...... 
  • 401 Unauthorized - A login failure will return text as follows.
  <valid code="InvalidAuth">no</valid> 
  <error>Invalid login, username not known or password not matched</error> 

For more information, please visit the IEDA web services page or its technical API documentation.

Currently, web services are used for sample registration or update by the GEOCHRON data system, Smithsonian Institution, etc.

If you are interested in establishing interoperability with SESAR, please contact info@geosamples.org.