Skip to content

Commit 8a2ea18

Browse files
Merge branch 'develop' into 12258-publish-submit-contains-files
2 parents d2bc7b3 + cd01fd5 commit 8a2ea18

1 file changed

Lines changed: 38 additions & 31 deletions

File tree

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

Lines changed: 38 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8852,51 +8852,58 @@ Note that this API is probably only useful for testing.
88528852
MyData
88538853
------
88548854
8855-
The MyData API is used to get a list of just the datasets, dataverses or datafiles an authenticated user can edit.
8855+
The MyData API is used to get a list of just the datasets, collections (dataverses), or datafiles an authenticated user has a role on.
88568856
8857-
The API excludes dataverses linked to an harvesting client. This results in `a known issue <https://github.com/IQSS/dataverse/issues/11083>`_ where regular datasets in harvesting dataverses are missing from the results.
8857+
The API excludes collections linked to an harvesting client. This results in `a known issue <https://github.com/IQSS/dataverse/issues/11083>`_ where regular datasets in harvesting collections are missing from the results.
88588858
8859-
A curl example listing objects
8859+
Here is a curl example.
88608860
88618861
.. code-block:: bash
88628862
88638863
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
88648864
export SERVER_URL=https://demo.dataverse.org
8865-
export ROLE_IDS=6
8866-
export DVOBJECT_TYPES=Dataset
8867-
export PUBLISHED_STATES=Unpublished
8865+
export ROLE_ID1=6
8866+
export ROLE_ID2=8
8867+
export DVTYPE1=Dataset
8868+
export DVTYPE2=Dataverse
8869+
export PUBLISHED_STATE1=Unpublished
8870+
export PUBLISHED_STATE2=Published
88688871
export PER_PAGE=10
88698872
8870-
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"
8873+
curl -H "X-Dataverse-key:$API_TOKEN" "$SERVER_URL/api/mydata/retrieve?role_ids=$ROLE_ID1&role_ids=$ROLE_ID2&dvobject_types=$DVTYPE1&dvobject_types=$DVTYPE2&published_states=$PUBLISHED_STATE1&published_states=$PUBLISHED_STATE2&per_page=$PER_PAGE"
88718874
8872-
Parameters:
8873-
8874-
``role_id`` Roles are customizable. Standard roles include:
8875-
8876-
- ``1`` = Admin
8877-
- ``2`` = File Downloader
8878-
- ``3`` = Dataverse + Dataset Creator
8879-
- ``4`` = Dataverse Creator
8880-
- ``5`` = Dataset Creator
8881-
- ``6`` = Contributor
8882-
- ``7`` = Curator
8883-
- ``8`` = Member
8884-
8885-
``dvobject_types`` Type of object, several possible values among: ``DataFile`` , ``Dataset`` & ``Dataverse`` .
8886-
8887-
``published_states`` State of the object, several possible values among:``Published`` , ``Unpublished`` , ``Draft`` , ``Deaccessioned`` & ``In+Review`` .
8888-
8889-
``per_page`` Number of results returned per page.
8890-
8891-
``metadata_fields`` Includes the requested fields for each dataset in the response. Multiple "metadata_fields" parameters can be used to include several fields. See :doc:`search` for further information on this parameter.
8875+
The fully expanded example above (without environment variables) looks like this:
88928876
8893-
``show_collections`` Whether or not to include a list of parent and linked collections for each dataset search result.
8877+
.. code-block:: bash
88948878
8895-
``sort`` The sort field. Supported values include "name", "date" and "relevance".
8879+
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" "https://demo.dataverse.org/api/mydata/retrieve?role_ids=6&role_ids=8&dvobject_types=Dataset&published_states=Unpublished&published_states=Published&per_page=10"
88968880
8897-
``order`` The order in which to sort. Can either be "asc" or "desc".
8881+
**Parameters:**
88988882
8899-
``fq`` A filter query to filter the list returned. Multiple "fq" parameters can be used.
8883+
- ``role_ids``: Roles are customizable. Multiple "role_ids" parameters can be used to include several roles. Standard roles include:
8884+
- ``1`` = Admin
8885+
- ``2`` = File Downloader
8886+
- ``3`` = Dataverse + Dataset Creator
8887+
- ``4`` = Dataverse Creator
8888+
- ``5`` = Dataset Creator
8889+
- ``6`` = Contributor
8890+
- ``7`` = Curator
8891+
- ``8`` = Member
8892+
- ``dvobject_types``: Type of object. Multiple "dvobject_types" parameters can be used to include several types. Possible values:
8893+
- ``Dataverse``
8894+
- ``Dataset``
8895+
- ``DataFile``
8896+
- ``published_states``: State of the object. Multiple "published_states" parameters can be used to include several states. Possible values:
8897+
- ``Published``
8898+
- ``Unpublished``
8899+
- ``Draft``
8900+
- ``Deaccessioned``
8901+
- ``In+Review`` (the ``+`` represents a space)
8902+
- ``mydata_search_term``: A string used to search for specific data within the user's MyData collection.
8903+
- ``selected_page``: The page number of results to return (used for pagination).
8904+
- ``per_page``: Number of results returned per page.
8905+
- ``order``: The order in which to sort. Can either be "asc" or "desc".
8906+
- ``fq``: A filter query (Solr syntax) to narrow the list returned. Multiple "fq" parameters can be used.
89008907
89018908
MyData Collection List
89028909
~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)