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 ####Example response

  {  
"id":"FKMxUpYdV9N2J4XG",
"createdBy":{  
    "fullname":"White, John",
    "userId":"zhcQKsMR0A9SiC6x"
},
"modifiedBy":{  
    "fullname":"admin, admin",
    "userId":"w7ZfmmC5LQR8KJIN"
},
"createdDate":"2014-10-09T13:01:49 +0200",
"modifiedDate":"2014-12-02T15:43:31 +0100",
"versionDate":"2014-10-16T11:15:53 +0200",
"status":"RELEASED",
"version":1,
"discardComment":"",
"title":"Research Data",
"description":"Test for research data",
"contributors":[  
    {  
        "position":0,
        "id":"Od6MTBSdXYPWYSU1",
        "familyName":"White",
        "givenName":"John",
        "completeName":"White, John",
        "alternativeName":"",
        "role":"author",
        "identifiers":[  
            {  
                "type":"imeji",
                "value":"http://pubman.mpdl.mpg.de/cone/persons/resource/persons96343"
            }
        ],
        "organizations":[  
            {  
                "position":0,
                "id":"94zMk2OtjJAWtXIH",
                "name":"Innovations, Max Planck Digital Library, Max Planck Society",
                "description":"",
                "identifiers":[  
                    {  
                        "type":"imeji",
                        "value":"escidoc:persistent1"
                    }
                ],
                "city":"",
                "country":""
            },
            {  
                "position":0,
                "id":"U7Gclp2tILtS43tN",
                "name":"MaibornWollf",
                "description":"",
                "identifiers":[  
                    {  
                        "type":"imeji",
                        "value":"MaibornWollf"
                    }
                ],
                "city":"",
                "country":""
            }
        ]
    },
    {  
        "position":0,
        "id":"bV9XLcmWw4D6tfMH",
        "familyName":"Smith",
        "givenName":"John",
        "completeName":"Smith, John",
        "alternativeName":"",
        "role":"author",
        "identifiers":[  
            {  
                "type":"imeji",
                "value":"http://pubman.mpdl.mpg.de/cone/persons/resource/persons96314"
            }
        ],
        "organizations":[  
            {  
                "position":0,
                "id":"6wsiRwDxeuMX1wy",
                "name":"Max Planck Digital Library, Max Planck Society",
                "description":"",
                "identifiers":[  
                    {  
                        "type":"imeji",
                        "value":"escidoc:persistent25"
                    }
                ],
                "city":"",
                "country":""
            }
        ]
    },
    {  
        "position":0,
        "id":"4S34HiEj6qvvgTV1",
        "familyName":"White",
        "givenName":"Snow",
        "completeName":"Snow, White",
        "alternativeName":"",
        "role":"author",
        "identifiers":[  
            {  
                "type":"imeji",
                "value":"http://pubman.mpdl.mpg.de/cone/persons/resource/persons96308"
            }
        ],
        "organizations":[  
            {  
                "position":0,
                "id":"OSCfm3llkE3Foa4",
                "name":"Innovations, Max Planck Digital Library, Max Planck Society",
                "description":"",
                "identifiers":[  
                    {  
                        "type":"imeji",
                        "value":"escidoc:persistent1"
                    }
                ],
                "city":"",
                "country":""
            }
        ]
    }
],
"profile":{  
    "profileId":"dhV6XK39_UPrItK5",
    "method":""
    }
}

####Example response

  {  
"id":"FKMxUpYdV9N2J4XG",
"createdBy":{  
    "fullname":"White, John",
    "userId":"zhcQKsMR0A9SiC6x"
},
"modifiedBy":{  
    "fullname":"admin, admin",
    "userId":"w7ZfmmC5LQR8KJIN"
},
"createdDate":"2014-10-09T13:01:49 +0200",
"modifiedDate":"2014-12-02T15:43:31 +0100",
"versionDate":"2014-10-16T11:15:53 +0200",
"status":"RELEASED",
"version":1,
"discardComment":"",
"title":"Research Data",
"description":"Test for research data",
"contributors":[  
    {  
        "position":0,
        "id":"Od6MTBSdXYPWYSU1",
        "familyName":"White",
        "givenName":"John",
        "completeName":"White, John",
        "alternativeName":"",
        "role":"author",
        "identifiers":[  
            {  
                "type":"imeji",
                "value":"http://pubman.mpdl.mpg.de/cone/persons/resource/persons96343"
            }
        ],
        "organizations":[  
            {  
                "position":0,
                "id":"94zMk2OtjJAWtXIH",
                "name":"Innovations, Max Planck Digital Library, Max Planck Society",
                "description":"",
                "identifiers":[  
                    {  
                        "type":"imeji",
                        "value":"escidoc:persistent1"
                    }
                ],
                "city":"",
                "country":""
            },
            {  
                "position":0,
                "id":"U7Gclp2tILtS43tN",
                "name":"MaibornWollf",
                "description":"",
                "identifiers":[  
                    {  
                        "type":"imeji",
                        "value":"MaibornWollf"
                    }
                ],
                "city":"",
                "country":""
            }
        ]
    },
    {  
        "position":0,
        "id":"bV9XLcmWw4D6tfMH",
        "familyName":"Smith",
        "givenName":"John",
        "completeName":"Smith, John",
        "alternativeName":"",
        "role":"author",
        "identifiers":[  
            {  
                "type":"imeji",
                "value":"http://pubman.mpdl.mpg.de/cone/persons/resource/persons96314"
            }
        ],
        "organizations":[  
            {  
                "position":0,
                "id":"6wsiRwDxeuMX1wy",
                "name":"Max Planck Digital Library, Max Planck Society",
                "description":"",
                "identifiers":[  
                    {  
                        "type":"imeji",
                        "value":"escidoc:persistent25"
                    }
                ],
                "city":"",
                "country":""
            }
        ]
    },
    {  
        "position":0,
        "id":"4S34HiEj6qvvgTV1",
        "familyName":"White",
        "givenName":"Snow",
        "completeName":"Snow, White",
        "alternativeName":"",
        "role":"author",
        "identifiers":[  
            {  
                "type":"imeji",
                "value":"http://pubman.mpdl.mpg.de/cone/persons/resource/persons96308"
            }
        ],
        "organizations":[  
            {  
                "position":0,
                "id":"OSCfm3llkE3Foa4",
                "name":"Innovations, Max Planck Digital Library, Max Planck Society",
                "description":"",
                "identifiers":[  
                    {  
                        "type":"imeji",
                        "value":"escidoc:persistent1"
                    }
                ],
                "city":"",
                "country":""
            }
        ]
    }
],
"profile":{  
    "profileId":"dhV6XK39_UPrItK5",
    "method":""
    }
}
Clone this wiki locally