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

Albums: Update an album

Natasa Bulatovic edited this page Jul 8, 2015 · 3 revisions

####Response status codes #####200 OK Successful update of the album with provided :id

#####404 Not found The album with provided :id is not found (does not exist)

#####401 Unauthorized Authentication is necessary to update this album

#####403 Forbidden Wrong credentials provided to update this album (e.g. pending album, but a user who is not creator of this collection or does not have a share for this collection tries to update it)

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

#####422 Unprocessable Entity Wrong data provided for the album e.g. user did not provide a title for the album (title is mandatory attribute)

##PUT /albums/:id

  • Updates an album with this album id
  • If user does not provide any value for some metadata of the album, the system will remove these metadata (e.g. description).
  • If user provides any value for some system generated metadata (see request body example below), the system will ignore these values

####Example request

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

#####Example request body

  {  
 "id":"YgzeK4cLp5LTpA_9",
 /* 
  Following album data in the comment are not editable, they are automatically provided by 
  the system.
 */
 /*
"createdBy":{  
    "fullname":"imeji, admin",
    "userId":"WuExL7x5lGcyZpU"
},
"modifiedBy":{  
    "fullname":"imeji, admin",
    "userId":"WuExL7x5lGcyZpU"
},
"createdDate":"2015-07-08T17:26:36 +0200",
"modifiedDate":"2015-07-08T17:26:36 +0200",
"versionDate":"",
"status":"PENDING",
"version":0,
"discardComment":"",
 */
"title":"Research Data Album",
"description":"Test for research data album",
"contributors":[  
    {  
        "id":"in_1EhUzpdZrF_",
        "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":"Yu1qAWi0ZZrx54n",
                "name":"Innovations, Max Planck Digital Library, Max Planck Society",
                "description":"",
                "identifiers":[  
                    {  
                        "type":"imeji",
                        "value":"someveryspecificIdentifier"
                    }
                ],
                "city":"München",
                "country":"Deutschland"
            }
        ]
    }
]

}

####Example response body

Clone this wiki locally