Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: SI: Added userIds param information.

...

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


Code Block
{
  "startDate": 1551398400000,
  "endDate": 1552608000000,
  "userId": 1,
  "includeModifiedProps": true,
  "entities": ["Participant", "ParticipantMedicalIdentifier", "CollectionProtocolRegistration", "ParticipantExtension"]
}


...

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.
userIdsRestrict the exported list to revisions effected by the users identified by the list of userIds. (Supported from v6.3)
entities

Optional parameter. Specifies the list of entities or record types whose revisions need to be exported. This is very useful when the requestor intends to review the revisions of only certain record types say Shipment and ShipmentSpecimen.

This parameter was added in v6.1.RC5.

includeModifiedPropsSpecifies whether the exported list should include modified attributes list for each revision.

...

Given below is an example of the CSV file created when includeModifiedProps = true. Notice the change log column, it includes the list of properties that got modified during the op along with their new values.

Revision IDRevision TimeUserUser Email IDOperationRecord TypeRecordChange Log

169879

09 Jul 2019 15:26John Doejohn.doe@openspecimen.orgEditSpecimen244004collectionStatus=Collected,createdOn=Tue Jul 09 15:26:00 IST 2019,position={id=295350}
16987909 Jul 2019 15:26John Doejohn.doe@openspecimen.orgAddStorage Container Position295354blocked=false,container={id=514},occupyingSpecimen={id=244010},posOne=8,posOneOrdinal=8,posTwo=3,posTwoOrdinal=3


When includeModifiedProps = false, the generated CSV file is as below. Notice the change log column is empty. It goes without saying that generating this kind of file is much faster than the above one as the API has to do lesser work.

Revision IDRevision TimeUserUser Email IDOperationRecord TypeRecord

Change Log

16987909 Jul 2019 15:26John Doejohn.doe@openspecimen.orgEditSpecimen244004
16987909 Jul 2019 15:26John Doejohn.doe@openspecimen.orgAddStorage Container Position295354