PagerDuty/pdpyras

how can I get the audit records

Closed this issue · 1 comments

Hi @sorin2343 ,

You can do this by calling <session object>.get("/audit/records") and optionally include a params keyword argument (a dictionary object). The return value of that is a Requests.Response object, so <response object>.json() gives you a dictionary object representing the JSON data in the response.

Note that the next_cursor key in the response body, which can be sent in as the cursor parameter in the next request (via params keyword argument) to obtain the next page of results.

The iter_all function doesn't yet natively support cursor-based pagination, although this will likely be the next significant feature that to be added to the library.