Skip to content

document preview URL token usage as API key#12140

Open
pallinger wants to merge 8 commits intoIQSS:developfrom
dsd-sztaki-hu:preview-url-token-as-api-token-doc
Open

document preview URL token usage as API key#12140
pallinger wants to merge 8 commits intoIQSS:developfrom
dsd-sztaki-hu:preview-url-token-as-api-token-doc

Conversation

@pallinger
Copy link
Contributor

@pallinger pallinger commented Feb 3, 2026

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 html works for me), and whether the code examples work.

Is there a release notes update needed for this change?:

I do not think so.

@pdurbin pdurbin moved this to Ready for Triage in IQSS Dataverse Project Feb 3, 2026
@pallinger pallinger closed this Feb 4, 2026
@pallinger pallinger reopened this Feb 4, 2026
@pallinger pallinger marked this pull request as ready for review February 4, 2026 08:09
Copy link
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A quick review

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"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure, maybe?
I will relocate it and put a link here instead, then you can look at it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved it, and left a link in the get-dataset-by-preview-url-token section.

@pdurbin pdurbin moved this from Ready for Triage to In Review 🔎 in IQSS Dataverse Project Feb 4, 2026
@pallinger
Copy link
Contributor Author

pallinger commented Feb 5, 2026

As it turns out, if you change a reference name, and leave a dangling reference to the old name and do make html, you will not get an error until you make clean. :)

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

Labels

None yet

Projects

Status: In Review 🔎

Development

Successfully merging this pull request may close these issues.

2 participants