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

Support jsonData when adding a file to a dataset (api.upload_file) #32

Closed
pdurbin opened this issue Jul 3, 2019 · 2 comments
Closed
Assignees
Labels
pkg:api api related activities type:feature New feature

Comments

@pdurbin
Copy link
Member

pdurbin commented Jul 3, 2019

The example at http://guides.dataverse.org/en/4.15/api/native-api.html#add-a-file-to-a-dataset illustrates that jsonData can be uploaded when adding a file:

curl -H "X-Dataverse-key:$API_TOKEN" -X POST -F 'file=@data.tsv' -F 'jsonData={"description":"My description.","directoryLabel":"data/subdir1","categories":["Data"], "restrict":"true"}' "https://example.dataverse.edu/api/datasets/:persistentId/add?persistentId=$PERSISTENT_ID"

The jsonData object allows the user to add additional metadata about the file:

  • description
  • file hierarchy ("directoryLabel")
  • tags ("categories")

It would be great if api.upload_file supported this jsonData object.

@skasberger skasberger self-assigned this Jul 3, 2019
@skasberger skasberger added pkg:api api related activities type:feature New feature labels Jul 3, 2019
@pdurbin
Copy link
Member Author

pdurbin commented Sep 5, 2019

Here's a real world use case: IQSS/dataverse-sample-data#5

@skasberger
Copy link
Member

Partly implemented here: AUSSDA@ebdba4d

skasberger added a commit that referenced this issue Mar 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:api api related activities type:feature New feature
Projects
None yet
Development

No branches or pull requests

2 participants