Skip to content

Commit b3b4b45

Browse files
Merge branch 'develop' into 11733-api-get-file-citation-format
2 parents 9b2c07c + cd01fd5 commit b3b4b45

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
@@ -8854,51 +8854,58 @@ Note that this API is probably only useful for testing.
88548854
MyData
88558855
------
88568856
8857-
The MyData API is used to get a list of just the datasets, dataverses or datafiles an authenticated user can edit.
8857+
The MyData API is used to get a list of just the datasets, collections (dataverses), or datafiles an authenticated user has a role on.
88588858
8859-
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.
8859+
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.
88608860
8861-
A curl example listing objects
8861+
Here is a curl example.
88628862
88638863
.. code-block:: bash
88648864
88658865
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
88668866
export SERVER_URL=https://demo.dataverse.org
8867-
export ROLE_IDS=6
8868-
export DVOBJECT_TYPES=Dataset
8869-
export PUBLISHED_STATES=Unpublished
8867+
export ROLE_ID1=6
8868+
export ROLE_ID2=8
8869+
export DVTYPE1=Dataset
8870+
export DVTYPE2=Dataverse
8871+
export PUBLISHED_STATE1=Unpublished
8872+
export PUBLISHED_STATE2=Published
88708873
export PER_PAGE=10
88718874
8872-
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"
8875+
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"
88738876
8874-
Parameters:
8875-
8876-
``role_id`` Roles are customizable. Standard roles include:
8877-
8878-
- ``1`` = Admin
8879-
- ``2`` = File Downloader
8880-
- ``3`` = Dataverse + Dataset Creator
8881-
- ``4`` = Dataverse Creator
8882-
- ``5`` = Dataset Creator
8883-
- ``6`` = Contributor
8884-
- ``7`` = Curator
8885-
- ``8`` = Member
8886-
8887-
``dvobject_types`` Type of object, several possible values among: ``DataFile`` , ``Dataset`` & ``Dataverse`` .
8888-
8889-
``published_states`` State of the object, several possible values among:``Published`` , ``Unpublished`` , ``Draft`` , ``Deaccessioned`` & ``In+Review`` .
8890-
8891-
``per_page`` Number of results returned per page.
8892-
8893-
``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.
8877+
The fully expanded example above (without environment variables) looks like this:
88948878
8895-
``show_collections`` Whether or not to include a list of parent and linked collections for each dataset search result.
8879+
.. code-block:: bash
88968880
8897-
``sort`` The sort field. Supported values include "name", "date" and "relevance".
8881+
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"
88988882
8899-
``order`` The order in which to sort. Can either be "asc" or "desc".
8883+
**Parameters:**
89008884
8901-
``fq`` A filter query to filter the list returned. Multiple "fq" parameters can be used.
8885+
- ``role_ids``: Roles are customizable. Multiple "role_ids" parameters can be used to include several roles. Standard roles include:
8886+
- ``1`` = Admin
8887+
- ``2`` = File Downloader
8888+
- ``3`` = Dataverse + Dataset Creator
8889+
- ``4`` = Dataverse Creator
8890+
- ``5`` = Dataset Creator
8891+
- ``6`` = Contributor
8892+
- ``7`` = Curator
8893+
- ``8`` = Member
8894+
- ``dvobject_types``: Type of object. Multiple "dvobject_types" parameters can be used to include several types. Possible values:
8895+
- ``Dataverse``
8896+
- ``Dataset``
8897+
- ``DataFile``
8898+
- ``published_states``: State of the object. Multiple "published_states" parameters can be used to include several states. Possible values:
8899+
- ``Published``
8900+
- ``Unpublished``
8901+
- ``Draft``
8902+
- ``Deaccessioned``
8903+
- ``In+Review`` (the ``+`` represents a space)
8904+
- ``mydata_search_term``: A string used to search for specific data within the user's MyData collection.
8905+
- ``selected_page``: The page number of results to return (used for pagination).
8906+
- ``per_page``: Number of results returned per page.
8907+
- ``order``: The order in which to sort. Can either be "asc" or "desc".
8908+
- ``fq``: A filter query (Solr syntax) to narrow the list returned. Multiple "fq" parameters can be used.
89028909
89038910
MyData Collection List
89048911
~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)