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 Guide says three endpoints want version ID but giving version ID doesn't work, giving version number does #6626

Closed
jggautier opened this issue Feb 7, 2020 · 7 comments
Assignees

Comments

@jggautier
Copy link
Contributor

jggautier commented Feb 7, 2020

Tested on Dataverse 4.19.1, the API Guide documents three endpoints for (1) listing files in a dataset (2) listing metadata blocks for a dataset, and (3) listing a single metadata block for a dataset. The docs indicate that all three endpoints require that a version ID (the database ID of the dataset version) be included:

Screen Shot 2020-02-07 at 3 40 28 PM

But the endpoint seems to work only when given the version number, not the version ID.

For example, for this dataset:

  • datasetID is 3610475
  • version ID is 176718 for version 1
  • version ID is 176765 for version 3.1

If you want to use the "list files" endpoint, https://dataverse.harvard.edu/api/datasets/3610475/versions/176718/files doesn't work, but https://dataverse.harvard.edu/api/datasets/3610475/versions/1/files does.

To see if any other endpoints ask for $versionId, I did a control find on the Search, Data Access, Metrics, and SWORD API pages, but only found the three endpoints already mentioned.

@jggautier
Copy link
Contributor Author

jggautier commented Feb 7, 2020

Should the docs be changed to say that the endpoints want the $versionNumber number instead?

E.g. GET http://$SERVER/api/datasets/$id/versions/$versionNumber/files?key=$apiKey

@pdurbin
Copy link
Member

pdurbin commented Feb 7, 2020

@jggautier interesting. So it wants "1". You're making me wonder if "1.0" or "1.1" works.

@jggautier
Copy link
Contributor Author

@pdurbin
Copy link
Member

pdurbin commented Feb 7, 2020

@jggautier great! Thanks for checking. Yes, we should document this properly. 😄

@djbrooke djbrooke added the Small label Jul 29, 2020
@pdurbin pdurbin self-assigned this Dec 18, 2020
@pdurbin
Copy link
Member

pdurbin commented Dec 18, 2020

This issue was reported against Dataverse 4.19 but I believe it was fixed in Dataverse 4.20 in pull request #6600.

Here's how the section in question looks now (as of Dataverse 5.3):

Screen Shot 2020-12-18 at 1 03 28 PM

Note that instead of $versionId (which is confusing) the examples now have $VERSION=1.0 to (in my mind) clearly indicate that we are talking about user-facing version numbers like 1.0, 1.1, etc.

I'm going to put this in code review. If there's more that should be done, I'm happy to hack away on it.

@pdurbin pdurbin removed their assignment Dec 18, 2020
@djbrooke
Copy link
Contributor

Thanks @pdurbin !

@jggautier what do you think?

@jggautier
Copy link
Contributor Author

Thanks! I think this makes the documentation clearer :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants