Skip to content

Commit 78e8241

Browse files
docs: fix JSON payload format in deleteFiles API example (fixes #11896) (#11946)
Updated the API documentation to correct the format of the `deleteFiles` payload. Co-authored-by: Steven Winship <[email protected]>
1 parent 1fd4edb commit 78e8241

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/sphinx-guides/source/api/native-api.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4208,24 +4208,24 @@ Delete files from a dataset. This API call allows you to delete multiple files f
42084208
42094209
curl -H "X-Dataverse-key:$API_TOKEN" -X PUT "$SERVER_URL/api/datasets/:persistentId/deleteFiles?persistentId=$PERSISTENT_IDENTIFIER" \
42104210
-H "Content-Type: application/json" \
4211-
-d '{"fileIds": [1, 2, 3]}'
4211+
-d '[1, 2, 3]'
42124212
42134213
The fully expanded example above (without environment variables) looks like this:
42144214
42154215
.. code-block:: bash
42164216
42174217
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" \
42184218
-H "Content-Type: application/json" \
4219-
-d '{"fileIds": [1, 2, 3]}'
4219+
-d '[1, 2, 3]'
42204220
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.
42224222
42234223
You must have the appropriate permissions to delete files from the dataset.
42244224
42254225
Upon success, the API will return a JSON response with a success message and the number of files deleted.
42264226
42274227
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.
42294229
42304230
.. _api-dataset-role-assignment-history:
42314231

0 commit comments

Comments
 (0)