You can see sample code to access the LeagueApps private API which is hosted in a public Github repository. The easiest option is to download the raw file linked below, but the repository is also linked.
Raw file:
Github:
https://github.com/LeagueApps/api-example
This file supports the parameters last-updated and last-id both default to 0. If you would like to test other values for these fields, you can provide these as parameters when running the script, see below for more details.
To run the file:
Save the Python file in the same folder that the Private API Key (p12 file) for your site is located
Make sure that you have converted the p12 file to a PEM file, and that it's also located in that same folder
openssl pkcs12 -nodes -in <client-id>.p12 -out <client-id>.pemnotasecretRun the following from the command line (the type flag can also be members-2, transactions-2, or accountingCodes):
python sample.py --site-id <site-id> --client-id <client-id> --pem-file <client-id>.pem --type registrations-2
Optional parameters:
last-updated (defaults to 0) - Provide this value if you intentionally want to control how recently the data you want to pull. This DOES NOT apply when type is accountingCodes.last-id (defaults to 0) - Provide this value to help tie break if more than one records has the same last-updated value, normally not required.additional-params - Provide a list of key=value values separated with spaces. Check each supported Export APIs for possible values. e.g.--additional-params includeDeleted=true program-id=123 backgroundCheckCode=AN
Running this script is creates a new file in the same folder called records.json , which contains the result of that API call to the registrations endpoint. If records.json already existed in the folder, it will be overwritten with new results.
Note on Windows
This sample code works via Windows Subsystem for Linux (WSL). It should work from a Windows command shell as well, but there will be extra setup steps needed to get openssl installed on Windows to do the certificate conversion from p12 to PEM.