Python classes to leverage Zscaler Internet Access API
The ZIA API talker is divided into two Class objects: ZiaTalker and ZiaPortalTalker. ZiaTalker interacts with ZIA via the published APIs; whereas ZiaPortalTalker interacts with ZIA via the URLs presented in the Portal (aka, the ZIA configuration website).
Python classes to leverage Zscaler Private Access API
The ZPA API talker is divided into two Class objects: ZpaTalker and ZpaPortalTalker. ZpaTalker interacts with ZPA via the published APIs; whereas ZpaPortalTalker interacts with ZPA via the URLs presented in the Portal (aka, the ZPA configuration website).
A Python class to leverage Zscaler Client Connector API. (Currently in Beta status.)
The Client Connector API talker is accessed via the Class object named: ClientConnectorTalker
A Python class to leverage Zscaler Digital Experience API. (Currently in development.)
This class is interacts with ZDX via the URLs presented in the Portal (aka, the ZDX configuration website). It is named: ZdxPortalTalker
- Create a virtual Environment:
python3 -m venv .zs_api_talkers
- Activate virtual environment:
- Linux:
source .zs_api_talkers/bin/activate
- Windows:
.\.zs_api_talkers\Scripts\activate
- Linux:
- Install Zscaler API talkers:
pip install zscaler-api-talkers
We provide two methods to build a Docker container. Either using the code hosted on GitHub or the code published to PyPi.
- Download Dockerfile
- Linux:
curl -O https://raw.githubusercontent.com/sergitopereira/zscaler_api_talkers/sergiodevelop/Dockerfile
- Windows:
wget -O Dockerfile https://raw.githubusercontent.com/sergitopereira/zscaler_api_talkers/sergiodevelop/Dockerfile
- Linux:
- Build Image and Run Container
docker build -t zscaler_api_talkers .
docker run -it zscaler_api_talkers bash
- Usage (program is in /zscaler_api_talkers/)
cd zscaler_api_talkers
- Download Dockerfile
- Linux:
curl -O https://raw.githubusercontent.com/sergitopereira/zscaler_api_talkers/sergiodevelop/git_version.Dockerfile
- Windows:
wget -O Dockerfile https://raw.githubusercontent.com/sergitopereira/zscaler_api_talkers/sergiodevelop/git_version.Dockerfile
- Linux:
- Build Image and Run Container
docker build -f git_version.Dockerfile -t zscaler_api_talkers .
docker run -it zscaler_api_talkers bash
- Usage (program is in /zscaler_api_talkers/)
cd zscaler_api_talkers
from zscaler_api_talkers import ZiaTalker
zia=ZiaTalker('<Zscaler Cloud Name>')
zia.authenticate(apikey='API_KEY', username='USERNAME', password='PASSWORD')
zia.list_urlcategories()
zia.list_users()
# To view all methods available
print(dir(zia))
from zscaler_api_talkers import ZiaTalker
a=ZiaTalker('<Zscaler Cloud Name>', '<Bear oauth2.0 token>')
a.list_url_categorie.url_categories()
a.list_users()
# To view all methods available
print(dir(a))
from zscaler_api_talkers import ZpaTalker
a=ZpaTalker('customerID')
a.authenticate(client_id='clientID',client_secret='clientSecret')
# To view all methods available
print(dir(a))
from zscaler_api_talkers import ClientConnectorTalker
a=ClientConnectorTalker('<Zscaler Cloud Name>')
a.authenticate(clientid='clientID',secretkey='clientSecret')
a.list_devices('companyID')
a.list_OTP('companyID','user device id')
# To view all methods available
print(dir(a))
from zscaler_api_talkers import ZdxTalker
a=ZdxTalker(username='<username>', password='<password>', zia_cloud='<zia_cloud_domain>')
result = a.get_alerts()
print(result.json())
print(dir(a))
- https://github.com/sergitopereira/zscaler_api_talkers#usage-example
- https://github.com/sergitopereira/zscaler_api_talkers/blob/main/example.py
Feel free to open an issues using GitHub Issues
Sergio Pereira: Zscaler Professional Services