-
Notifications
You must be signed in to change notification settings - Fork 15
Collections: Create a new collection
##POST /collections Creates a new imeji collection. During collection creation users may explicitly reference or copy an existing metadata profile used by any other collection, or the default imeji metadata profile. For this purpose, JSON Body should contain a snippet referring to the desired metadata profile.
"profile":{
"id":"id-of-existing-metadata-profile",
"method":"copy|reference"
}
If the method is empty or different from "copy" or "reference" new metadata profile will be created.
####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 single collection for example response