diff --git a/source/includes/overview/_quickstart.md b/source/includes/overview/_quickstart.md index 0350ccb..da42b4c 100644 --- a/source/includes/overview/_quickstart.md +++ b/source/includes/overview/_quickstart.md @@ -95,6 +95,7 @@ access token): "edit": "https://zenodo.org/api/deposit/depositions/1234/actions/edit", "files": "https://zenodo.org/api/deposit/depositions/1234/files", "publish": "https://zenodo.org/api/deposit/depositions/1234/actions/publish", + "newversion": "https://zenodo.org/api/deposit/depositions/1234/actions/newversion", "self": "https://zenodo.org/api/deposit/depositions/1234" }, "metadata": { diff --git a/source/includes/resources/_changes.md b/source/includes/resources/_changes.md index a1d74e9..d149daa 100644 --- a/source/includes/resources/_changes.md +++ b/source/includes/resources/_changes.md @@ -1,5 +1,9 @@ ## Changes +**2017-06-15** + +- Added support for DOI versioning as part of deposit actions. + **2016-09-12** - Added support for search, pagination, sorting and filtering. diff --git a/source/includes/resources/deposit-actions/_newversion.md b/source/includes/resources/deposit-actions/_newversion.md new file mode 100644 index 0000000..14ea2df --- /dev/null +++ b/source/includes/resources/deposit-actions/_newversion.md @@ -0,0 +1,39 @@ +### New version + +Create a new version of a deposition. + +This action will create a new deposit, which will be a snapshot of the current resouce, inheriting the metadata as well as snapshot of files. +The new version deposit will have a state similar to a new, unpublished deposit, most importantly its files will be modifiable as for a new deposit. + +Only one unpublished new version deposit can be available at any moment, i.e.: calling new version action multiple times will have no effect, as long as the resulting new version deposit from the first call is not published or deleted. + +NOTE: The response body of this action is NOT the new version deposit, but the original resource. +The new version deposition can be accessed through the ``"latest_draft"`` under ``"links"`` in the response body. + +```shell +curl -i -X POST https://zenodo.org/api/deposit/depositions/1234/actions/newversion?access_token=ACCESS_TOKEN +``` + +```python +import requests +r = requests.post('https://zenodo.org/api/deposit/depositions/1234/actions/newversion', + params={'access_token': ACCESS_TOKEN}) +``` + +#### HTTP Request + +`POST /api/deposit/depositions/:id/actions/newversion` + +#### Scopes + +`deposit:actions` + +#### Success response + +* **Code:** `201 Created` +* **Body**: a [deposition](#deposit) resource. + +#### Error response + +See [HTTP status codes](#http-status-codes) (400 and 500 series errors) and +[error responses](#errors). diff --git a/source/index.html.md b/source/index.html.md index c0a97f1..c594062 100644 --- a/source/index.html.md +++ b/source/index.html.md @@ -34,6 +34,7 @@ includes: - resources/deposit-actions/publish - resources/deposit-actions/edit - resources/deposit-actions/discard + - resources/deposit-actions/newversion - resources/changes - oai-pmh/root search: true