Skip to content

Commit 92463aa

Browse files
authored
Update native-api.rst
1 parent 61d0594 commit 92463aa

1 file changed

Lines changed: 63 additions & 0 deletions

File tree

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

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,6 +1639,69 @@ The fully expanded example above (without environment variables) looks like this
16391639
16401640
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
16411641
1642+
Update the Metadata and Instructions of a Template
1643+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1644+
1645+
Updates the metadata and instructions of a template with a given ``id``.
1646+
1647+
To update the template, you must send a JSON file. Your JSON file might look like :download:`template-update-metadata.json <../_static/api/template-update-metadata.json>` which you would send to the Dataverse installation like this:
1648+
1649+
.. code-block:: bash
1650+
1651+
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
1652+
export SERVER_URL=https://demo.dataverse.org
1653+
export ID=1
1654+
1655+
curl -H "X-Dataverse-key: $API_TOKEN" -X PUT "$SERVER_URL/api/dataverses/{ID}/metadata" --upload-file template-update-metadata.json
1656+
1657+
The fully expanded example above (without environment variables) looks like this:
1658+
1659+
.. code-block:: bash
1660+
1661+
curl -H "X-Dataverse-key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X PUT "https://demo.dataverse.org/api/dataverses/1/metadata" --upload-file template-update-metadata.json
1662+
1663+
Update the License or Terms Of Use of a Template
1664+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1665+
1666+
Updates the license or custom terms of use of a template with a given ``id``.
1667+
1668+
To update the template, you must send a JSON file containing either the name of an active license or custom terms of use. Your JSON file might look like :download:`template-update-license.json <../_static/api/template-update-license.json>` or :download:`template-update-terms.json <../_static/api/template-update-terms.json>` which you would send to the Dataverse installation like this:
1669+
1670+
.. code-block:: bash
1671+
1672+
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
1673+
export SERVER_URL=https://demo.dataverse.org
1674+
export ID=1
1675+
1676+
curl -H "X-Dataverse-key: $API_TOKEN" -X PUT "$SERVER_URL/api/dataverses/{ID}/licenseTerms" --upload-file template-update-license.json
1677+
1678+
The fully expanded example above (without environment variables) looks like this:
1679+
1680+
.. code-block:: bash
1681+
1682+
curl -H "X-Dataverse-key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X PUT "https://demo.dataverse.org/api/dataverses/1/licenseTerms" --upload-file template-update-license.json
1683+
1684+
Update the Terms Of Access of a Template
1685+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1686+
1687+
Updates the terms of access of a template with a given ``id``.
1688+
1689+
To update the template, you must send a JSON file containing either the name of an active license or custom terms of use. Your JSON file might look like :download:`template-update-access.json <../_static/api/template-update-access.json>` which you would send to the Dataverse installation like this:
1690+
1691+
.. code-block:: bash
1692+
1693+
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
1694+
export SERVER_URL=https://demo.dataverse.org
1695+
export ID=1
1696+
1697+
curl -H "X-Dataverse-key: $API_TOKEN" -X PUT "$SERVER_URL/api/dataverses/{ID}/access" --upload-file template-update-access.json
1698+
1699+
The fully expanded example above (without environment variables) looks like this:
1700+
1701+
.. code-block:: bash
1702+
1703+
curl -H "X-Dataverse-key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -X PUT "https://demo.dataverse.org/api/dataverses/1/access" --upload-file template-update-access.json
1704+
16421705
Set a Default Template for a Collection
16431706
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16441707

0 commit comments

Comments
 (0)