Welcome to Trend Micro
This website uses cookies for website functionality, traffic analytics, personalization, social media functionality and advertising. Our Cookie Notice provides more information and explains how to amend your cookie settings.
Learn more
Using the API Demo Project for Python

Using the API Demo Project for Python

The Python demo project allows you to explore the basic functionalities of the Apex Central APIs.

Important:

The API demo project requires Python 3.6 (or later).

  1. On a system running Python 3.6 (or later), install the following modules.
    • pycryptodome

    • hashlib

    • PyJWT

  2. Download the API demo project file from:

    http://docs.trendmicro.com/all/ent/tmcm/v7.0/en-us/api/Python3DemoScript.zip

  3. Decompress the Python3DemoScript.zip folder.
  4. In the extracted Python3DemoScript.py file, locate and specify the following settings.
    • use_url_base: The URL of the Apex Central server without the WebApp

      Example: https://192.168.121.223:443

    • use_application_id: The application ID generated by Apex Central

    • use_api_key: The API key generated by Apex Central

  5. Execute the demo script, which will access the APIs and perform the following actions.
    • Attempt to get and print product agents with hostname="BENPFUOSCECLIEN"

      Note:

      You can change the hostname criteria directly in the Python script to specify any product agent.

    • Attempt to uninstall a product agent with entity_id="123456780114-694DBF9D-2018-0618-1930"

      Note:

      You can change the entity_id criteria directly in the Python script to specify any product agent.