Skip to content

Commit

Permalink
IQSS#6083 update examples in File part of Native API: 'Editing Variab…
Browse files Browse the repository at this point in the history
…le Level Metadata' section.
  • Loading branch information
pkiraly committed Feb 21, 2020
1 parent afcd2aa commit 3e791d6
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions doc/sphinx-guides/source/api/native-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 3e791d6

Please sign in to comment.