document preview URL token usage as API key#12140
Conversation
|
|
||
| .. _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.
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.
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.
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 |
pdurbin
left a comment
There was a problem hiding this comment.
Looks great! Thanks, @pallinger! Merging!
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.