-
Notifications
You must be signed in to change notification settings - Fork 533
document preview URL token usage as API key #12140
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
base: develop
Are you sure you want to change the base?
document preview URL token usage as API key #12140
Conversation
pdurbin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A quick review
|
|
||
| .. _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" | ||
|
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Co-authored-by: Philip Durbin <philipdurbin@gmail.com>
Co-authored-by: Philip Durbin <philipdurbin@gmail.com>
…doc from Native API doc
|
As it turns out, if you change a reference name, and leave a dangling reference to the old name and do |
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.