TNS Internal:NDR/API/2.0/specification/addCollection

From NSDLWiki

Jump to: navigation, search


 NDR Project Documentation   Conceptual Framework   v1.0 NDR-API Index   v2.0 NDR-API Index   Model 

Under Construction
Proposed method for inclusion in NDR/API 2.0.

Please provide feedback and comments in the NSDL Data Repository (NDR) API 2.0 Forum of the NSDL Community Forums.


NDR API Documentation - addCollection

Create a collection for aggregating objects providing provenience that identifies the provider(s) of metadata and information stored as a part of this collection.



Request URL

http://ndr.nsdlib.org/api/addCollection


Must be an HTTP POST request.


Arguments

Structure of input:

  • inputXML (required)
    • collection (required)
      • parentCollection (optional) - the externally resolvable identifier (handle) for another Collection that serves as the parent of this collection. NOTE: A collection can be a member of more than one collection, so more than one parent element is allowed.
      • title (required) - User friendly title of the collection.
      • description (required) - Brief description of the purpose of the collection.
      • contacts (optional) - List of contacts for the collection
        • contact (optional) - Name of contact person for the collection.
          • email attribute (optional) - Email of contact person for the collection
      • resourceURL (optional) - URL to a resource that represents the collection as a whole
      • externalIdentifier (optional) - identifier that has meaning to the application that is responsible for the creation of the collection.



InputXML Example

Below is example inputXML for adding a collection to the NDR.


<?xml version="1.0" encoding="UTF-8"?>
<inputXML 
    xmlns="http://ns.nsdlib.org/ndr/request_v2.00/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://ns.nsdlib.org/ndr/request_v2.00/ http://ns.nsdlib.org/schemas/ndr/request_v2.00.xsd" 
    schemaVersion="1.00.000">
  <collection>
    <parentCollection>2200/2010030201T</parentCollection>
    <title>Middle School Portal (MSP2)</title> 
    <description>The MSP2 collection</description>
    <contacts>
      <contact email="ginger@ucar.edu">Katy Ginger</contact>
    </contacts>
    <resourceURL>http://msteacher2.org</resourceURL>
    <externalIdentifier>NDR-000-000-000-0001</externalIdentifier>
  </collection>
</inputXML>




Response

Structure of response:

  • handle - the externally resolvable identifier for the Collection. NOTE: All Collection related API calls that manipulate a specific collection expect this handle as a parameter.
  • handleURL - the permanent URL to an XML representation of the Collection in the NDR.


Common Errors

  • permissions do not allow adding a collection


Response Example

Below is an example response for this request.

<?xml version="1.0" encoding="UTF-8"?>
<NSDLDataRepository schemaVersion="1.00.000" 
    xmlns="http://ns.nsdlib.org/ndr/response_v2.00/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://ns.nsdlib.org/ndr/response_v2.00/ http://ns.nsdlib.org/schemas/ndr/response_v2.00.xsd">
  <responseTime>2006-04-10T18:07:53Z</responseTime>
  <requestURL>http://ndr.nsdlib.org/api/addCollection</requestURL>
  
  <resultData>
    <handle>2200/20061212656</handle>
    <handleURL>http://ndr.nsdl.org/api/getCollectionRecord/2200/20061212656</handleURL>
  <resultData>
</NSDLDataRespository>



API Links:


Additional Links Related to This Call:

Personal tools