{"library":"qase-api-v2-client","title":"Qase TestOps API V2 Client","description":"The `qase-api-v2-client` library provides a Python client for interacting with the Qase TestOps API V2. It allows users to programmatically manage projects, test cases, runs, and other entities within Qase. The current version is 2.0.6, and it is part of a larger `qase-python` monorepo, with updates typically occurring when the Qase API specification changes or bug fixes are introduced across the ecosystem.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install qase-api-v2-client"],"cli":null},"imports":["from qase_api_v2_client import ApiClient","from qase_api_v2_client import Configuration","from qase_api_v2_client.api.projects_api import ProjectsApi","from qase_api_v2_client.exceptions import ApiException"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom qase_api_v2_client import ApiClient, Configuration\nfrom qase_api_v2_client.api.projects_api import ProjectsApi\nfrom qase_api_v2_client.exceptions import ApiException\n\n# Configure API key authentication\nconfiguration = Configuration()\nconfiguration.api_key['TokenAuth'] = os.environ.get('QASE_API_TOKEN', 'YOUR_QASE_API_TOKEN_HERE')\n\n# IMPORTANT: The client is named 'v2-client' but its default host is 'v1'.\n# Explicitly set the host to the Qase API V2 endpoint.\nconfiguration.host = os.environ.get('QASE_API_BASE_URL', 'https://api.qase.io/v2')\n\n# Create an instance of the API client\napi_client = ApiClient(configuration)\n\n# Create an instance of a specific API service, e.g., ProjectsApi\nprojects_api = ProjectsApi(api_client)\n\ntry:\n    # Example: List projects\n    response = projects_api.get_projects()\n    print(f\"Successfully connected to Qase API V2. Found {response.total} projects.\")\n    if response.entities:\n        print(f\"First project: {response.entities[0].title} (Code: {response.entities[0].code})\")\nexcept ApiException as e:\n    print(f\"Error calling Qase API: {e.status} - {e.body}\")\n    if e.status == 401:\n        print(\"Please check your QASE_API_TOKEN and ensure it's valid for the v2 API.\")\n    elif e.status == 404 and 'v1' in configuration.host:\n        print(\"Consider changing QASE_API_BASE_URL to 'https://api.qase.io/v2'.\")\nexcept Exception as e:\n    print(f\"An unexpected error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to initialize the Qase API V2 client, authenticate using an API token (preferably from environment variables), and make a basic call to list projects. It explicitly highlights and corrects the common pitfall of the default API host.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}