Sisense Community logo
    • Community Feedback
    • Chapters
    • Events
    • Forums
      • Help and How To
      • Product Feedback Forum
      • Strategy & Use Cases
    • Blogs
    • KB Docs
      • KB Docs
      • Add-Ons & Plug-Ins
      • APIs
      • Best Practices
      • Blox
      • CDT
      • Cloud Managed Service
      • Data Models
      • Data Sources
      • Embedding Analytics
      • How-Tos & FAQs
      • Onboarding
      • PySisense
      • Security
      • Sisense Administration
      • Sisense Intelligence & AI
      • Troubleshooting
      • Widget & Dashboard Scripts
    • Support
    • Learning
      • Sisense Academy: Free Courses and Certifications
      • Official Developer Documentation
      • Official Product Documentation
      • Official Sisense Youtube Channel
      • Sisense Compose SDK Playground
      • Official Sisense Discord
    • Use Case Gallery
    Discussions
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
    •                    
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
    Discussions
    • TagsChevronRightIcon
    users management
      • PySisenseChevronRightIcon

      Export users with PySisense(Python SDK)

                               

        What the Solution Does Creates a single, enriched users table— id, name, email, role_name, role_id, groups[{id,name}], status, last_login —ready for audits, governance reviews, and downstream workflows Simplifies multi-step Sisense API flows into one readable SDK call that runs steps in the correct order Automatically resolves cross-endpoint details: get_users_all() fetches users, looks up role and group names, and applies safe retries/backoff with consistent logging Returns structured results that can be exported or analyzed immediately Why It’s Useful Easily produces a complete, human-readable user inventory Reduces time and errors in access reviews, onboarding/offboarding, and compliance checks Improves governance with predictable runs, traceable logs, and consistent output across environments Setup While you can use the SDK in any environment, this guide uses VS Code for simplicity. Prerequisites Python: >= 3.9 VS Code with the Python extension If you don’t have them, install Python and VS Code first. 1) Create a project folder # choose a location and create the folder mkdir PySisense && cd PySisense (Optional) Create a virtual environment Use a dedicated venv named pysisense. macOS/Linux python3 -m venv pysisense source pysisense/bin/activate Windows (PowerShell) python -m venv pysisense pysisense\Scripts\Activate.ps1 2) Installation Install PySisense from PyPI. pip install pysisense Tip: If you just created a venv, ensure it’s activated before running pip . 3) Authentication To interact with your Sisense instance using PySisense, authentication is required. You'll need an Admin API token, which can be generated here . Copy the generated token value. 4) Configuration In the project's root directory, create a file named config.yaml and populate it with the provided template. # config.yaml # Domain can be an IP (e.g., 192.168.1.1) or hostname (e.g., example.com) domain: "" # Whether to use SSL (https). Set true if your Sisense is on HTTPS. is_ssl: false # Sisense Admin API token (keep this secure) token: "" Fill in your details and save the file. 5) Create a starter script To initialize the client and call a method, create main.py with the following code: import os from pysisense import AccessManagement, SisenseClient # Path to config.yaml in the same directory as this script config_path = os.path.join(os.path.dirname(__file__), "config.yaml") # Initialize the API client (set debug=True for verbose logs) api_client = SisenseClient(config_file=config_path, debug=True) # Initialize the AccessManagement module access_mgmt = AccessManagement(api_client=api_client) # Example: Get all users response = access_mgmt.get_users_all() print(response) # Optional: Convert to a DataFrame and print try: df = api_client.to_dataframe(response) print(df) except Exception as e: print(f"DataFrame conversion skipped: {e}") # Optional: Export to CSV api_client.export_to_csv(response, file_name="all_users.csv") To run the program, execute python main.py. RECORDING LINK Explore the full documentation and examples in the GitHub repository: GitHub: https://github.com/sisense/pysisense Windows and Linux

      Himanshu Negi
      Himanshu NegiPosted 7 months ago
      0
               
      • APIsChevronRightIcon

      How to unblock users after failed login attempts

               

      How to unblock users after failed login attempts  Protecting user credentials can't be overstated in any secure system. Security measures such as locking users after multiple failed login attempts are critical in preventing brute-force attacks. However, while this feature strengthens security, it can also become a source of frustration for legitimate users who mistakenly enter the wrong password multiple times. In this article, we’ll walk you through the process of unblocking users who have been locked out after multiple failed login attempts using Sisense’s REST API. We will explore the challenges this feature presents and how API calls can streamline the user management process for administrators. Why Are Users Locked Out? Sisense, like many other platforms, implements security protocols to temporarily lock users out after a series of incorrect password attempts. The aim is to prevent unauthorized access to sensitive data by blocking brute-force attacks. While this is a necessary security measure, it can also affect valid users who may have simply mistyped their passwords several times.  The lockout settings can be managed under Admin -> Security&Access -> Security Settings Using the REST API to Unblock Users To allocate the blocked user ID, simply go to Admin -> Users perform the email search, click on the pencil icon on the right side, and copy the user identifier. With Sisense's REST API, you can easily unblock the users. To perform unblocking go to Admin -> REST API -> v1 -> default  Expand the POST request /account/remove_lockout/{user_id}, click “Try It Out”, paste the user's ID into the user_id field, and click execute After this user will be unblocked.  Related Content: REST API Dev Docs:  https://sisense.dev/guides/restApi/v1/?platform=linux&spec=L2023.11#/account

      Vadim Pidgornyi
      Vadim PidgornyiPosted 1 year ago
      0