Files : API changes for 5.5 - Require API to get audit history of a file
OVERVIEW
Specification :
Method used to get version history
Endpoint : /api/12/files/{fileid}/audit
Method : (GET)
Require Fields:
- User detail (including User id, name, email)
- Action
- Audit date and time
- IP address
Parameters:
Parameter Name | Type | Mandatory/Optional | Detail |
---|---|---|---|
fileid | string | Mandatory | The ID of file to get the version for |
offset | string | Optional |
The starting point for each record returned Default value : 0 |
limit | string | Optional |
The maximum number of records to show per request Default value : 25 |
Description:
- Please note that this API should give the response by verifying the current user's role in the site.
- Use existing auditDBO if possible
- User detail should be given from UserDBO format.
- Action would be actionname like viewed, downloaded etc and given in a string and actionalias would be FILE_VIEWED, FILE_DOWNLOADED etc and given in a string.
- Audit date and time will be given in UTC
- IP Address will be given in a string
The value of parameter limit will behave as per the following:
- limit =25 is the default value
- if limit>0 then the number of items returned is equal to limit
- if limit=-1 then the response will return all records
- if limit <-1 then the system returns the default number of items i.e 25
The value of the offset parameter will behave as per the following:
- (Default) offset =0
- if offset > 0 then the records are returned from the offset value
- if offset < 0 then offset value of 0 is set
Response XML:
<audits>
<audit>
<actionuser>
<firstname>tom</firstname>
<lastname>chick</lastname>
<email>tom.chick@highq.com</email>
<userid>101</userid>
</actionuser>
<actionname>viewed</actionname>
<actionalias>FILE_VIEWED</actionalias>
<date>28 Aug 2019 11:13</date>
<ipaddress>192.168.152.44</ipaddress>
</audit>
<audit>
<actionuser>
<firstname>tom</firstname>
<lastname>chick</lastname>
<email>tom.chick@highq.com</email>
<userid>101</userid>
</actionuser>
<actionname>download</actionname>
<actionalias>FILE_DOWNLOADED</actionalias>
<date>28 Aug 2019 11:13</date>
<ipaddress>192.168.152.44</ipaddress>
</audit>
</audits>
Comments
0 Comments