Skip to content
This repository has been archived by the owner on Jul 2, 2018. It is now read-only.

Collections: Create a new collection

natasab edited this page Dec 22, 2014 · 10 revisions

##POST /collections *Creates a new imeji collection

####Response status codes #####201 Created Successful creation of the collection

#####400 Bad request The body of the request is not syntactically correct, user provided false body for the request

#####401 Unauthorized Authentication is necessary to create a collection, and user is not authenticated or provided invalid credentials

#####403 Forbidden Wrong credentials provided to create a collection (User does not have a right to create a collection)

#####422 Unprocessable Entity The body of the request is syntactically correct, but data are not semantically correct e.g. missing a mandatory field such as the title of the collection, or user provided a reference to a non-existing metadata profile as a metadata profile for the collection.

####Example request

curl --user admin:admin \
       --header "Content-Type:application/json" \
       --header "Accept: application/json" \
       --request POST \
       --data '{<see_example_request_body_below>}' \
       http://<baseurl>/collections

#####Example request body {
"title":"Research Data", "description":"Test for research data", "versionOf":"", "profile":{ "id":"", "method":"" }, "contributors":[
{
"familyName":"White", "givenName":"John", "completeName":"White, John", "alternativeName":"Lucky Tester", "role":"author", "identifiers":[
{
"type":"imeji", "value":"http://pubman.mpdl.mpg.de/cone/persons/resource/persons96343" } ], "organizations":[
{
"id":"94zMk2OtjJAWtXIH", "name":"Innovations, Max Planck Digital Library, Max Planck Society", "description":"", "identifiers":[
{
"type":"imeji", "value":"someveryspecificIdentifier" } ], "city":"München", "country":"Deutschland" }, {
"name":"Testing organization", "description":"There is no description for the Testing organization", "identifiers":[
{
"type":"imeji", "value":"veryspecific" } ], "city":"Some great city", "country":"Some nice country" } ] }, {
"familyName":"Smith", "givenName":"John", "completeName":"Smith, John", "alternativeName":"", "role":"author", "identifiers":[
{
"type":"imeji", "value":"http://pubman.mpdl.mpg.de/cone/persons/resource/persons96314" } ], "organizations":[
{
"id": "yoKdu0PjrJKWLXRN",
"name":"Max Planck Digital Library, Max Planck Society", "description":"", "identifiers":[
{
"type":"imeji", "value":"nicePersistentId" } ], "city":"", "country":"" } ] } ] }

#####Response

  • See Get a collection for example response
Clone this wiki locally