Jump to content

Search the Community

Showing results for tags 'sdk'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • News
    • The Lounge
  • Community
    • Pre-Sales Questions
    • Support
    • The Marketplace
    • Contribute
    • Show Off
    • Feature Requests
    • Bugs
    • Contests
  • Developer Corner
    • General
    • Extensions
  • BlestaStore's Forum
  • BlestaStore's BlestaCMS
  • BlestaStore's Resellers
  • BlestaStore's BlestaForums
  • BlestaStore's Promotions
  • CubeData's Official Announcements From CubeData
  • CubeData's Peer Support
  • CubeData's Resellers
  • ModulesGarden Club's Topics
  • Blesta Addons's Topics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Wire


Location


Interests

Found 1 result

  1. Much of our company's product development begins as a Python project. Each project has its own request logic and environment variables. By installing blesta_sdk as a project dependency via pip, I can reuse the portable stuff without having to write custom connections and queries for each project. Features The original PHP SDK reimagined using Python's python-dotenv and Requests libraries. Easy setup: Just add a local `.env` file to your project root, install `blesta_sdk` via pip, and you're ready to roll! Installation Step 1 - Install the Package Install the package via pip: pip install blesta-sdk ### Configure the Environment Step 2 - Add a `.env` file to your project root with the following variables: BLESTA_API_URL=https://your-blesta-api-url.com BLESTA_API_USER=your-api-user BLESTA_API_KEY=your-api-key That's it, your ready to make ANY Blesta Model API requests using the CLI or API method illustrated below. Using Blesta SDK Blesta CLI Client The CLI client provides an easy way to interact with Blesta's REST API. For example, this command requests all the active clients: blesta-cli --model clients --method getList --params status=active --last-request Blesta API Client You can pass Blesta API methods directly through the API client. Here's an example import json import os from blesta_sdk import api from dotenv import load_dotenv load_dotenv() # Create an instance of BlestaApi with the required arguments blesta_api_url = os.getenv('BLESTA_API_URL') blesta_api_user = os.getenv('BLESTA_API_USER') blesta_api_key = os.getenv('BLESTA_API_KEY') if not all([blesta_api_url, blesta_api_user, blesta_api_key]): raise ValueError("Missing one or more Blesta API environment variables") blesta_api = api.BlestaApi(blesta_api_url, blesta_api_user, blesta_api_key) # Submit the request try: response = blesta_api.submit(method='getAll', model='clients') print(response.raw) except Exception as e: print(f"An error occurred: {e}") Links - **PyPI**: https://pypi.org/project/blesta_sdk/ - **GitHub**: https://github.com/jwogrady/blesta_sdk The code is published under MIT. Please submit issues, features, etc. on the GitHub repo.
×
×
  • Create New...