Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/release-notes/5042-add-mydata-doc-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
An API named 'MyData' is supported by Dataverse. A documentation has been added describing its use (PR #9596)
This API is used to get a list of only the objects (datasets, dataverses or datafiles) that an authenticated user can modify.
40 changes: 40 additions & 0 deletions doc/sphinx-guides/source/api/native-api.rst

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have a release note snippet as well, please? For now (sorry), please see this issue:

Original file line number Diff line number Diff line change
Expand Up @@ -4505,6 +4505,7 @@ A curl example using allowing access to a dataset's metadata
Please see :ref:`dataverse.api.signature-secret` for the configuration option to add a shared secret, enabling extra
security.


.. _send-feedback:

Send Feedback To Contact(s)
Expand All @@ -4530,3 +4531,42 @@ A curl example using an ``ID``
curl -X POST -H 'Content-Type:application/json' -d "$JSON" $SERVER_URL/api/admin/feedback

Note that this call could be useful in coordinating with dataset authors (assuming they are also contacts) as an alternative/addition to the functionality provided by :ref:`return-a-dataset`.


MyData
------

The MyData API is used to get a list of just the datasets, dataverses or datafiles an authenticated user can edit.

A curl example listing objects

.. code-block:: bash

export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
export SERVER_URL=https://demo.dataverse.org
export ROLE_IDS=6
export DVOBJECT_TYPES=Dataset
export PUBLISHED_STATES=Unpublished
export PER_PAGE=10

curl -H "X-Dataverse-key:$API_TOKEN" "$SERVER_URL/api/mydata/retrieve?role_ids=$ROLE_IDS&dvobject_types=$DVOBJECT_TYPES&published_states=$PUBLISHED_STATES&per_page=$PER_PAGE"

Parameters:

``role_id`` Roles are customizable. Standard roles include:

- ``1`` = Admin
- ``2`` = File Downloader
- ``3`` = Dataverse + Dataset Creator
- ``4`` = Dataverse Creator
- ``5`` = Dataset Creator
- ``6`` = Contributor
- ``7`` = Curator
- ``8`` = Member

``dvobject_types`` Type of object, several possible values among: ``DataFile`` , ``Dataset`` & ``Dataverse`` .

``published_states`` State of the object, several possible values among:``Published`` , ``Unpublished`` , ``Draft`` , ``Deaccessioned`` & ``In+Review`` .

``per_page`` Number of results returned per page.