Unverified Commit 7de1d350 authored by Stephen Rees's avatar Stephen Rees Committed by GitHub
Browse files

Update README.md

parent a7004c78
......@@ -6,7 +6,7 @@ Zenodo is part of CERN and provides permanent archive and Digital Object Identif
You will need to have an account with Zenodo to utilize this library for their REST API, which is documented at https://developers.zenodo.org. This library follow the documentation posted as of April 2020, with the exception of a couple minor details that Zenodo had not yet updated their documentation with.
# Example 1 - Retrieve all existing depositions
```php
include_once('zenodoPHP.php');
$sandboxtoken = '';//your sandbox token
......@@ -28,17 +28,18 @@ try{
return;
}
echo var_export($collection);
```
# Example 2 - Retrieve a specific deposition
```php
//leaving off the exception handling this time
$connection = new zenodoConnection('your_sandbox_token', 'sandbox');
$deposition = new zenodoDeposition($connection);
$deposition->retrieve_deposition(12345);//whatever your deposition ID is...
echo var_export($deposition->clean());//clean returns a cloned object stripped of extraneous data such as the connection
```
# Example 3 - Create a deposition
```php
$connection = new zenodoConnection('your_sandbox_token', 'sandbox');
$deposition = new zenodoDeposition($connection);
$deposition->create_deposition();//deposition object is now created with Zenodo and ready to be populated with metadata
......@@ -57,3 +58,4 @@ $deposition->update_deposition();
//Want to publish it? This locks it against changes and deletion permanently
$deposition->publish_deposition();
```
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment