Skip to content

Commit 77972b2

Browse files
committed
doc updates with info on response formats
1 parent 8ad46ff commit 77972b2

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

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

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,6 +1476,22 @@ The fully expanded example above (without environment variables) looks like this
14761476
14771477
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -H "Accept: application/json" "https://demo.dataverse.org/api/datasets/dvAlias/assignments/history"
14781478
1479+
The response is a JSON array of role assignment history entries with the following structure for each entry:
1480+
1481+
.. code-block:: json
1482+
1483+
{
1484+
"definedOn": "1",
1485+
"assigneeIdentifier": "@user1",
1486+
"roleName": "Admin",
1487+
"assignedBy": "@dataverseAdmin",
1488+
"assignedAt": "2023-01-01T12:00:00Z",
1489+
"revokedBy": null,
1490+
"revokedAt": null
1491+
}
1492+
1493+
For revoked assignments, the "revokedBy" and "revokedAt" fields will contain values instead of null.
1494+
14791495
To retrieve the history in CSV format, change the Accept header to "text/csv":
14801496

14811497
.. code-block:: bash
@@ -1492,6 +1508,8 @@ The fully expanded example above (without environment variables) looks like this
14921508
14931509
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -H "Accept: text/csv" "https://demo.dataverse.org/api/dataverses/3/assignments/history"
14941510
1511+
The CSV response has column headers mirroring the json entries. They are internationalized (when internationalization is configured).
1512+
14951513
Note: This feature requires the "role-assignment-history" feature flag to be enabled (see :ref:`feature-flags`).
14961514

14971515
Datasets
@@ -4100,6 +4118,22 @@ The fully expanded example above (without environment variables) looks like this
41004118
41014119
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -H "Accept: application/json" "https://demo.dataverse.org/api/datasets/:persistentId/assignments/history?persistentId=doi:10.5072/FK2/ABCDEF"
41024120
4121+
The response is a JSON array of role assignment history entries with the following structure for each entry:
4122+
4123+
.. code-block:: json
4124+
4125+
{
4126+
"definedOn": "3",
4127+
"assigneeIdentifier": "@user1",
4128+
"roleName": "Admin",
4129+
"assignedBy": "@dataverseAdmin",
4130+
"assignedAt": "2023-01-01T12:00:00Z",
4131+
"revokedBy": null,
4132+
"revokedAt": null
4133+
}
4134+
4135+
For revoked assignments, the "revokedBy" and "revokedAt" fields will contain values instead of null.
4136+
41034137
To retrieve the history in CSV format, change the Accept header to "text/csv":
41044138
41054139
.. code-block:: bash
@@ -4116,6 +4150,8 @@ The fully expanded example above (without environment variables) looks like this
41164150
41174151
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -H "Accept: text/csv" "https://demo.dataverse.org/api/datasets/3/assignments/history"
41184152
4153+
The CSV response has column headers mirroring the json entries. They are internationalized (when internationalization is configured).
4154+
41194155
Note: This feature requires the "role-assignment-history" feature flag to be enabled (see :ref:`feature-flags`).
41204156
41214157
Dataset Files Role Assignment History
@@ -4153,6 +4189,8 @@ The fully expanded example above (without environment variables) looks like this
41534189
41544190
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -H "Accept: application/json" "https://demo.dataverse.org/api/datasets/:persistentId/files/assignments/history?persistentId=doi:10.5072/FK2/ABCDEF"
41554191
4192+
The JSON response for this call is the same as for the /api/datasets/{id}/assignments/history call above with the exception that definedOn will be a comma separated list of one or more file ids.
4193+
41564194
To retrieve the history in CSV format, change the Accept header to "text/csv":
41574195
41584196
.. code-block:: bash
@@ -4169,6 +4207,8 @@ The fully expanded example above (without environment variables) looks like this
41694207
41704208
curl -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -H "Accept: text/csv" "https://demo.dataverse.org/api/datasets/3/files/assignments/history"
41714209
4210+
The CSV response for this call is the same as for the /api/datasets/{id}/assignments/history call above with the exception that definedOn will be a comma separated list of one or more file ids.
4211+
41724212
Note: This feature requires the "role-assignment-history" feature flag to be enabled (see :ref:`feature-flags`).
41734213
41744214
Files

0 commit comments

Comments
 (0)