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

API to add multiple files to the dataset. #7900

Closed
JayanthyChengan opened this issue May 25, 2021 · 1 comment
Closed

API to add multiple files to the dataset. #7900

JayanthyChengan opened this issue May 25, 2021 · 1 comment
Milestone

Comments

@JayanthyChengan
Copy link
Contributor

JayanthyChengan commented May 25, 2021

Hi Team:

At Scholars Portal, as we were integrating Globus with Dataverse for large file transfer, a new API is created to add metadata of multiple files to the dataset. The existing API $SERVER_URL/api/datasets/:persistentId/add gives us limitation since it adds only one file to the dataset.

Once the files are transferred to S3 bucket, the new API /addfiles is invoked with “jsonData” (an array containing the files information)

jsonData:

[{"description":"","directoryLabel":"","restrict":"false","storageIdentifier":"s3://gcs5-bucket1:179a489cb24-769e2d9456fc123","fileName":"1951b.csv","md5Hash":"0056bf95d5f98ab9a930e38b69c14295","mimeType":"text/comma-separated-values"},{"description":"","directoryLabel":"","restrict":"false","storageIdentifier":"s3://gcs5-bucket1:179a489cb24-ed5edbe7b75fa","fileName":"BooksTDRv2a.pdf","md5Hash":"0cabd29624c9ea80d32c0355418197ba","mimeType":"application/pdf"}]

API call:
curl -X POST -H 'X-Dataverse-key: $API_TOKEN' "$SERVER_URL/api/datasets/:persistentId/addFiles?persistentId=#PERSISTENT_IDENTIFIER" -F 'jsonData=$JSON_DATA'

I will submit pull request for this issue.

@pdurbin
Copy link
Member

pdurbin commented Oct 1, 2022

Huh. PR #7901 was merged but the automatic close didn't happen. Closing! Thanks for the PR, @JayanthyChengan!

@pdurbin pdurbin closed this as completed Oct 1, 2022
@pdurbin pdurbin added this to the 5.6 milestone Oct 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants