Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: DOI versioning documentation #9

Merged
merged 1 commit into from
Jul 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions source/includes/overview/_quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
4 changes: 4 additions & 0 deletions source/includes/resources/_changes.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
39 changes: 39 additions & 0 deletions source/includes/resources/deposit-actions/_newversion.md
Original file line number Diff line number Diff line change
@@ -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).
1 change: 1 addition & 0 deletions source/index.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down