Update "change dataset citation date" curl examples#7294
Conversation
Changes the curl examples for "Set Citation Date Field Type for a Dataset" and "Revert Citation Date Field Type to Default for Dataset" endpoints to use the dataset's persistentId instead of its database ID.
pdurbin
left a comment
There was a problem hiding this comment.
--data ":dateOfDeposit" seems to be missing in one example
| .. code-block:: bash | ||
|
|
||
| curl -H "X-Dataverse-key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X PUT https://demo.dataverse.org/api/datasets/24/citationdate --data ":dateOfDeposit" | ||
| curl -H "X-Dataverse-key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X PUT https://demo.dataverse.org/api/datasets/:persistentId/citationdate?persistentId=doi:10.5072/FK2/J8SJZB |
There was a problem hiding this comment.
| curl -H "X-Dataverse-key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X PUT https://demo.dataverse.org/api/datasets/:persistentId/citationdate?persistentId=doi:10.5072/FK2/J8SJZB | |
| curl -H "X-Dataverse-key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X PUT https://demo.dataverse.org/api/datasets/:persistentId/citationdate?persistentId=doi:10.5072/FK2/J8SJZB --data ":dateOfDeposit" |
|
When I try the command with the colon in front of the field name, like ":dateOfDeposit", I get an error: "Dataset Field Type Name :dateOfDeposit not found." When I remove the colon, "dateOfDeposit", the API works:
Before I change this PR, is there a reason why there's a colon in front of the field name? Should it not work if there's no colon? |
|
@jggautier Pull request #3000 is where this "change the date in the citation" feature was originally added. I only mention this because it was helpful for me to wrap my head around it. |
Removed colon from field name "dateOfDeposit", and completed the curl examples.
Changes the curl examples for "Set Citation Date Field Type for a Dataset" and "Revert Citation Date Field Type to Default for Dataset" endpoints to use the dataset's persistentId instead of its database ID.
What this PR does / why we need it: A dataset's database ID can be a pain to get for users who just want to use an API endpoint to do something once, like change the year shown in their dataset's citation. This PR changes the curl examples in the API guide for the "Set Citation Date Field Type for a Dataset" and "Revert Citation Date Field Type to Default for Dataset" endpoints, so that they show how to use the dataset PID instead.
Which issue(s) this PR closes:
Closes #7293
Special notes for your reviewer:
Suggestions on how to test this: Check out the diff
Does this PR introduce a user interface change? If mockups are available, please link/include them here: No
Is there a release notes update needed for this change?: I don't think so
Additional documentation: