Skip to content

Commit ca526ad

Browse files
committed
Added: docs for dataverse template creation
1 parent 9229795 commit ca526ad

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,6 +1419,27 @@ The fully expanded example above (without environment variables) looks like this
14191419
14201420
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X GET "https://demo.dataverse.org/api/dataverses/1/templates"
14211421
1422+
Create a Template for a Collection
1423+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1424+
1425+
Creates a template for a given Dataverse collection ``id``.
1426+
1427+
To create the template, you must send a JSON file. Your JSON file might look like :download:`dataverse-template.json <../_static/api/dataverse-template.json>` which you would send to the Dataverse installation like this:
1428+
1429+
.. code-block:: bash
1430+
1431+
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
1432+
export SERVER_URL=https://demo.dataverse.org
1433+
export ID=1
1434+
1435+
curl -H "X-Dataverse-key: $API_TOKEN" -X POST "$SERVER_URL/api/dataverses/{ID}/templates" --upload-file dataverse-template.json
1436+
1437+
The fully expanded example above (without environment variables) looks like this:
1438+
1439+
.. code-block:: bash
1440+
1441+
curl -H "X-Dataverse-key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X POST "https://demo.dataverse.org/api/dataverses/1/templates" --upload-file dataverse-template.json
1442+
14221443
Datasets
14231444
--------
14241445

0 commit comments

Comments
 (0)