-
Notifications
You must be signed in to change notification settings - Fork 493
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Also "add" example to phoenix scripts.
- Loading branch information
Showing
3 changed files
with
20 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -204,11 +204,15 @@ Delete a Private URL from a dataset (if it exists):: | |
|
||
DELETE http://$SERVER/api/datasets/$id/privateUrl?key=$apiKey | ||
|
||
Add a file to an existing Dataset. Description and tags are optional:: | ||
Add a file to an existing Dataset. Description and tags are optional:: | ||
|
||
POST http://$SERVER/api/datasets/$id/add?key=$apiKey | ||
|
||
Example python code to add a file. This may be run by changing these parameters in the sample code: | ||
A more detailed "add" example using curl:: | ||
|
||
curl -H "X-Dataverse-key:$API_TOKEN" -X POST -F '[email protected]' -F 'jsonData={"description":"My description.","categories":["Data"]}' "https://example.dataverse.edu/api/datasets/:persistentId/add?persistentId=$PERSISTENT_ID" | ||
|
||
Example python code to add a file. This may be run by changing these parameters in the sample code: | ||
|
||
* ``dataverse_server`` - e.g. https://dataverse.harvard.edu | ||
* ``api_key`` - See the top of this document for a description | ||
|
@@ -295,10 +299,14 @@ In practice, you only need one the ``dataset_id`` or the ``persistentId``. The e | |
Files | ||
~~~~~~~~~~~ | ||
|
||
Replace an existing file where ``id`` is the Database id of the file to replace. Note that metadata such as description and tags are not carried over from the file being replaced:: | ||
Replace an existing file where ``id`` is the database id of the file to replace. Note that metadata such as description and tags are not carried over from the file being replaced:: | ||
|
||
POST http://$SERVER/api/files/{id}/replace?key=$apiKey | ||
|
||
A more detailed "replace" example using curl:: | ||
|
||
curl -H "X-Dataverse-key:$API_TOKEN" -X POST -F '[email protected]' -F 'jsonData={"description":"My description.","categories":["Data"]}' "https://localhost:8181/api/files/$FILE_ID/replace" | ||
|
||
Example python code to replace a file. This may be run by changing these parameters in the sample code: | ||
|
||
* ``dataverse_server`` - e.g. https://dataverse.harvard.edu | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
[ | ||
"files:data.tsv", | ||
"datasets:Darwin's Finches", | ||
"dataverses:Birds", | ||
"dataverses:Finches", | ||
|