document preview URL token usage as API key#12140
Open
pallinger wants to merge 8 commits intoIQSS:developfrom
Open
document preview URL token usage as API key#12140pallinger wants to merge 8 commits intoIQSS:developfrom
pallinger wants to merge 8 commits intoIQSS:developfrom
Conversation
pdurbin
reviewed
Feb 4, 2026
Comment on lines
4004
to
4019
|
|
||
| .. _get-files-using-preview-url-token: | ||
|
|
||
| Get Files Using Preview URL Token | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
| If you want to access a dataset's contents shared by a preview URL (see :ref:`previewUrl`, :ref:`get-dataset-by-preview-url-token` and :ref:`create-a-preview-url-for-a-dataset`) using the API, you can use the token in the preview URL as API_TOKEN. | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| SERVER_URL=https://demo.dataverse.org | ||
| PREVIEW_URL_TOKEN=a56444bc-7697-4711-8964-e0577f055fd2 | ||
| FILE_ID=1111111 | ||
| FILENAME=example.txt | ||
| curl -H "X-Dataverse-key:$PREVIEW_URL_TOKEN" -o "$FILENAME" "$SERVER_URL/api/access/datafile/$FILE_ID" | ||
|
|
Member
There was a problem hiding this comment.
Hmm, I can understand why this is here. At least, I assume it's because there's a section called "Get Citation by Preview URL Token" right above it.
However, since this is an /api/access call, it should probably be documented under Data Access API. What do you think, @pallinger?
Contributor
Author
There was a problem hiding this comment.
I am not sure, maybe?
I will relocate it and put a link here instead, then you can look at it.
Contributor
Author
There was a problem hiding this comment.
I moved it, and left a link in the get-dataset-by-preview-url-token section.
Co-authored-by: Philip Durbin <philipdurbin@gmail.com>
Co-authored-by: Philip Durbin <philipdurbin@gmail.com>
…doc from Native API doc
Contributor
Author
|
As it turns out, if you change a reference name, and leave a dangling reference to the old name and do |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Documents preview URL token usage as API key.
Preview at https://dataverse-guide--12140.org.readthedocs.build/en/12140/api/auth.html#using-preview-url-tokens-as-api-token
Suggestions on how to test this:
Check whether the documentation compiles successfully (
make htmlworks for me), and whether the code examples work.Is there a release notes update needed for this change?:
I do not think so.