Skip to content

document preview URL token usage as API key#12140

Merged
pdurbin merged 10 commits intoIQSS:developfrom
dsd-sztaki-hu:preview-url-token-as-api-token-doc
Feb 17, 2026
Merged

document preview URL token usage as API key#12140
pdurbin merged 10 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. :)

@cmbz cmbz added FY26 Sprint 16 FY26 Sprint 16 (2026-01-28 - 2026-02-11) FY26 Sprint 17 FY26 Sprint 17 (2026-02-11 - 2026-02-25) labels Feb 11, 2026
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.

Looks great! Thanks, @pallinger! Merging!

@github-project-automation github-project-automation bot moved this from In Review 🔎 to Ready for QA ⏩ in IQSS Dataverse Project Feb 17, 2026
@pdurbin pdurbin merged commit 38a4d06 into IQSS:develop Feb 17, 2026
8 checks passed
@github-project-automation github-project-automation bot moved this from Ready for QA ⏩ to Merged 🚀 in IQSS Dataverse Project Feb 17, 2026
@pdurbin pdurbin added this to the 6.10 milestone Feb 17, 2026
@scolapasta scolapasta moved this from Merged 🚀 to Done 🧹 in IQSS Dataverse Project Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY26 Sprint 16 FY26 Sprint 16 (2026-01-28 - 2026-02-11) FY26 Sprint 17 FY26 Sprint 17 (2026-02-11 - 2026-02-25)

Projects

Status: Done 🧹

Development

Successfully merging this pull request may close these issues.

4 participants