Closed vagarwal77 closed 2 years ago
This is actually in the example but could be pointed out better maybe. You're looking for the "Link" in the last_request.headers:
>>> audits = r.send_request(AuditRecordsRequest('MEDIFLEX','DEV'))
>>> r.last_request.headers["Link]
https://innovate.mdsol.com/RaveWebServices/datasets/ClinicalAuditRecords.odm?studyoid=MEDIFLEX%28DEV%29&startid=3842&per_page=1000>; rel="next"'
The startid is in that response (3842). You have to parse it yourself to get that value. There is some code in audit event which you could steal for this:
from urllib.parse import urlparse, parse_qs
result = rws.send_request(AuditRecordsRequest('TG_TEST','Dev'))
link = rws.last_result.links.get("next", None)
if link:
link = link['url']
p = urlparse(link)
start_id = int(parse_qs(p.query)['startid'][0])
print(start_id)
This seems ok to close
https://rwslib.readthedocs.io/en/latest/odm_adapter.html#auditrecordsrequest-project-name-environment-name
audits = r.send_request(AuditRecordsRequest('MEDIFLEX','DEV'))
I don't see a way to get startid which can be used with subsequent AuditRecordsRequest calls. Please suggest how to get startid value which is (startid=1 | The audit ID to start on. Defaults to 1. The first Audit ID)
Sample response of audits -