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

Items: Update an item

Natasa Bulatovic edited this page Jul 16, 2015 · 13 revisions

Update of complete item, including item file

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

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

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

#####403 Forbidden Wrong credentials provided to update this item

#####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 item e.g. badly formatted file name

##PUT /items/:id Full update of an existing item completely. Metadata not provided in the json body will be removed from the item. Only metadata where values are specified will remain after the item update.

This method supports both raw and default formats and supports update of the item file (via new upload, reference or fetch).

###Parameters

  • file (multipart/form-data) - file to be uploaded when new item is updated (optional)
  • json - the JSON formatted item (containing collection URI, metadata or optionally, fetch/reference URL in case when file parameter is not provided i.e. file is not explicitly uploaded). Note that JSON body must contain element "collectionId" with valid collection identifier.

####Example request (update item file)

curl --user admin:admin -X PUT \
       -v include --form json='{<see_example_request_body_below>}' \
       --form=upload=<yourfilename-to-upload> \
       http://<base-url-rest-api>/items/DPVkdrApVu11zFeT

#####Example request body See examples for request body for creation of new item

#####Example response *For example response see the output of GET single item

Clone this wiki locally