You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/sphinx-guides/source/api/native-api.rst
+51-4Lines changed: 51 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4208,24 +4208,24 @@ Delete files from a dataset. This API call allows you to delete multiple files f
4208
4208
4209
4209
curl -H "X-Dataverse-key:$API_TOKEN" -X PUT "$SERVER_URL/api/datasets/:persistentId/deleteFiles?persistentId=$PERSISTENT_IDENTIFIER" \
4210
4210
-H "Content-Type: application/json" \
4211
-
-d '{"fileIds": [1, 2, 3]}'
4211
+
-d '[1, 2, 3]'
4212
4212
4213
4213
The fully expanded example above (without environment variables) looks like this:
4214
4214
4215
4215
.. code-block:: bash
4216
4216
4217
4217
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X PUT "https://demo.dataverse.org/api/datasets/:persistentId/deleteFiles?persistentId=doi:10.5072/FK2ABCDEF" \
4218
4218
-H "Content-Type: application/json" \
4219
-
-d '{"fileIds": [1, 2, 3]}'
4219
+
-d '[1, 2, 3]'
4220
4220
4221
-
The ``fileIds``in the JSON payload should be an array of file IDs that you want to delete from the dataset.
4221
+
The JSON payload should be an array of file IDs that you want to delete from the dataset.
4222
4222
4223
4223
You must have the appropriate permissions to delete files from the dataset.
4224
4224
4225
4225
Upon success, the API will return a JSON response with a success message and the number of files deleted.
4226
4226
4227
4227
The API call will report a 400 (BAD REQUEST) error if any of the files specified do not exist or are not in the latest version of the specified dataset.
4228
-
The ``fileIds``in the JSON payload should be an array of file IDs that you want to delete from the dataset.
4228
+
The JSON payload should be an array of file IDs that you want to delete from the dataset.
4229
4229
4230
4230
.. _api-dataset-role-assignment-history:
4231
4231
@@ -4357,6 +4357,53 @@ The CSV response for this call is the same as for the /api/datasets/{id}/assignm
4357
4357
4358
4358
Note: This feature requires the "role-assignment-history" feature flag to be enabled (see :ref:`feature-flags`).
4359
4359
4360
+
Update Dataset License
4361
+
~~~~~~~~~~~~~~~~~~~~~~
4362
+
4363
+
Updates the license of a dataset by applying it to the draft version, or by creating a draft if none exists.
4364
+
4365
+
The JSON representation of a license can take two forms, depending on whether you want to specify a predefined license or define custom terms of use and access.
4366
+
4367
+
To set a predefined license (e.g., CC BY 4.0), provide a JSON body with the license name:
4368
+
4369
+
.. code-block:: json
4370
+
4371
+
{
4372
+
"name": "CC BY 4.0"
4373
+
}
4374
+
4375
+
To define custom terms of use and access, provide a JSON body with the following properties. All fields within ``customTerms`` are optional, except for the ``termsOfUse`` field, which is required:
0 commit comments