Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This API is used to export the list of revisions satisfying the request criteria. Remember a revision represents an act of creating, modifying or deleting an OpenSpecimen object/record.

Request

Export revisions effected by the user identified by userId = 1 during the time period March 1 (startDate) to March 15 (endDate). The exported list should include the list of modified record attributes/properties during each revision. The exported file contains the list of revisions arranged in reverse chronological order i.e. the latest revision at the top and ancient revision at the bottom of the file. 

URL
/openspecimen/rest/ng/audit/export-revisions
Method
POST
Body


Code Block
{
  "startDate": 1551398400000,
  "endDate": 1552608000000
  "userId": 1
  "includeModifiedProps": true
}



Response

The response contains the file ID that can be used to download the exported revisions file.

Code Block
{
  "fileId": "0a24ef05-c1aa-4641-b2a0-4d4f060b8f75_20190325_1645"
}


The exported revisions file can downloaded using the below API request

Code Block
GET /openspecimen/rest/ng/audit/revisions-file?fileId=0a24ef05-c1aa-4641-b2a0-4d4f060b8f75_20190325_1645


Request parameters

ParameterDescription
startDateStart date of the interval for which the revisions list is queried. If not specified, startDate = endDate - 30 days 
endDateEnd date of the interval for which the revisions list is queried. If not specified endDate = end of today.
userIdRestrict the exported list to revisions effected by the user identified by userId.
includeModifiedPropsSpecifies whether the exported list should include modified attributes list for each revision.


Response parameters

ParameterDescription
fileIdUnique file ID to use for downloading the exported revisions file.