From 3e791d6a0e2a53f0c3b1a37c4809c4e1ecd0e020 Mon Sep 17 00:00:00 2001 From: Peter Kiraly Date: Fri, 21 Feb 2020 18:49:33 +0100 Subject: [PATCH] #6083 update examples in File part of Native API: 'Editing Variable Level Metadata' section. --- doc/sphinx-guides/source/api/native-api.rst | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/doc/sphinx-guides/source/api/native-api.rst b/doc/sphinx-guides/source/api/native-api.rst index aefe5c66a41..dd33f686628 100644 --- a/doc/sphinx-guides/source/api/native-api.rst +++ b/doc/sphinx-guides/source/api/native-api.rst @@ -1985,11 +1985,24 @@ Also note that dataFileTags are not versioned and changes to these will update t Editing Variable Level Metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Updates variable level metadata using ddi xml ``$file``, where ``$id`` is file id:: +Updates variable level metadata using ddi xml ``FILE``, where ``ID`` is file id. - PUT https://$SERVER/api/edit/$id --upload-file $file +A curl example using an ``ID`` + +.. code-block:: bash + + export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + export SERVER_URL=https://demo.dataverse.org + export ID=24 + export FILE=dct.xml + + curl -H "X-Dataverse-key:$API_TOKEN" -X PUT $SERVER_URL/api/edit/$ID --upload-file $FILE + +The fully expanded example above (without environment variables) looks like this: + +.. code-block:: bash -Example: ``curl -H "X-Dataverse-key:$API_TOKEN" -X PUT http://localhost:8080/api/edit/95 --upload-file dct.xml`` + curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X PUT https://demo.dataverse.org/api/edit/24 --upload-file dct.xml You can download :download:`dct.xml <../../../../src/test/resources/xml/dct.xml>` from the example above to see what the XML looks like.