Jump to content

jwogrady

Members
  • Posts

    95
  • Joined

  • Last visited

  • Days Won

    4

jwogrady last won the day on July 8 2020

jwogrady had the most liked content!

Profile Information

  • Gender
    Not Telling
  • Location
    Dallas

Contact Methods

  • Skype
    jwogrady

Recent Profile Visitors

5,445 profile views
  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.
  2. I'm having trouble using the domain managers API. The app api controller says I can access plugin public model methods. <?php /** * A RESTful API system for interacting with the Blesta backend. * * All public model methods are accessible. Plugin models may also be invoked by * simply formatting the model as Plugin.Model * (e.g. /api/plugin.model/method.format). Supports XML, JSON, and PHP as format * types. * * @package blesta * @subpackage blesta.app.controllers * @copyright Copyright (c) 2010, Phillips Data, Inc. * @license http://www.blesta.com/license/ The Blesta License Agreement * @link http://www.blesta.com/ Blesta */ What's an example of a good url? I've tried lots of combos.... I've also verified that I am correctly authenticating and passing the required params, but keep getting 415. https://[my.blesta.com]/api/plugin/domains/getlist.json?client_id=1 https://[my.blesta.com]/api/plugin.domains/getlist.json?client_id=1 415 b'{"message":"The format requested is not supported by the server.","response":null}'
  3. bump on this one please. Having the same issue on 5.9.3 since upgrade.
  4. I'm using Python's request library to query the API. The documentation doesn't show what a paramatized filtering url would look like. For example, https://source-docs.blesta.com/class-Services.html#_getList The filter variable is supposed to be passed as an array. #getList( integer $client_id = null, string $status = 'active', integer $page = 1, array $order_by = ['date_added' => 'DESC'], boolean $children = true, array $filters = [] ) Returns a list of services for the given client and status Using python requests, that would be done like this.... def services_getAllByClient(): data = request( 'services/', 'getlist', blesta_format, params={'client_id': 741, 'filters': ['package_id', 112]} ) print(data.url) >>> app.services_getAllByClient() https://[myblestainstall.com]/api/services/getlist.json?client_id=741&filters=package_id&filters=112 It's not filtering.... What would correct paramaratized files look like?
  5. My mission is to verify that all the domains we manage are setup in Blesta with the correct renewal dates. We have relationships with two domain registrars, enom and namesilo. They both have officially support Blesta modules. additional note: - The namesilo module's domain audit tool errors out with Monolog\ErrorHandler->handleError Line 699 /var/www/{path to install}/components/modules/namesilo/namesilo.php array(5) { [0]=> int(8) [1]=> string(43) "Trying to get property 'meta' of non-object" Since the audit tool is not working for me, I'm attempting to pull the data I need remotely via the API. The Blesta API doc makes me think that because because of what it says at the very bottom. To test, the 'getAll' function in Blesta's module-namesilo seems like a good way to get an array of all the namesilo domains in Blesta.... /** * Returns a list of domains for the particular user. * * @param array $vars An array of input params including: * * - portfolio (optional) portfolio to fetch domains for * @return NamesiloResponse */ public function getList(array $vars) { return $this->api->submit('listDomains', $vars); } I've tried every combo I can think of to access.... https://{blesta install domain}/api/domains/getList.json https://{blesta install domain}/api/namesilo/getList.json { "message": "The requested resource does not exist.", "response": null } https://{blesta install domain}/api/namesilo/domains/getList.json https://{blesta install domain}/api/module-namesilo/domains/getList.json https://{blesta install domain}/api/module-namesilo/domains/getList.json { "message": "The format requested is not supported by the server.", "response": null { I'm having the same issues of not know the paths when trying to pull tickets out of Blesta's `support manager` plugin. My questions..... How do I identify remote callable model functions that return a json response in Blesta supported models and plugins? Link to examples? Is the getList function in `module-namesilo`? Assuming it will work, what's the correct path? Is there a better approach for getting all the domains out of Blesta, ideally in a list I can filter by registrar, status, etc. Perhaps getting a list of `services` and filtering by the service_id for namesilo and enom?
  6. cat general-notice-cron-2022-10-11.log [2022-10-11T14:30:18.182110+00:00] general.NOTICE: E_NOTICE: Undefined property: stdClass::$client {"code":8,"message":"Undefined property: stdClass::$client","file":"/blesta/core/Automation/Tasks/Task/PaymentReminders.php","line":438} [2022-10-11T20:35:04.548277+00:00] general.NOTICE: E_NOTICE: Undefined property: stdClass::$client {"code":8,"message":"Undefined property: stdClass::$client","file":"/blesta/core/Automation/Tasks/Task/PaymentReminders.php","line":438} Found this in notices. Is there a fix? line 438 references a messenger. I did have Twillo activated, but never configured. Wondering if the cron is trying to use it anyways? I uninstalled Twillo to see if that fixes it. Expected behavior would be to complete the cron with a notice.... instead of continuing to spin.
  7. Since upgraded to 5.5.2 our Payment Reminders cron task stoped completing. Old forum threads indicate it might be a parsing error on the template. Anyone else run into that? Which log file should I check for errors? Blesta has a lot.... ? general-error general-info general-notice general-warning general-info-cron general-notice-cron general-warning-cron But no general-error-cron generated.....
  8. Alas, invoice Number and invoice ID are not the same thing.... While invoice numbering may vary from company to company, the invoice id is constantly sequently.
  9. I noticed the invoice number in the gateway log that are passed to authorize.net do not match the actual invoice number. Anyone else having this issue?
  10. My department is setup with Auto-Close Predefined Responses. We want to give customers the opportunity to reopen auto-closed tickets. Can I accomplish this by using email template variables in my selected response like this?
  11. Lovin' Blesta since we started using it in 2014. We keep growing off the platform. With growth comes more complex relationships. Here are some challenges we regularly run up against. support contact A is the same person supporting multiple accounts. How can they access all the accounts they support from one login. sales rep B should only have access to the accounts they sold. It's the same issue as support contacts, but with different permissions. company Y is one entity with multiple brands. How do we filter lists of services off brand? company Y & Z are completely separate entities owned by the same contact. Why can't they access all accounts from a single login. Not really a feature request.... more like is supporting these complex relationships part of the roadmap.
  12. Not yet. I was considering reaching out to these folks who built the quickbooks plugin for WHMCS to see if he would be willing to make a Blesta version. https://myworks.design/software/whmcs-quickbooks-online-automatic-sync-module/ The Zapier approach may prove to be a better path, but for billing I'd prefer to keep the man out of the middle. Let me know if there is interest in pooling resources. Also want get Blesta's blessing before we initiate because at some point I would like to turn over the code so they can maintain it as part of the core like they do with the other plugins/models.
  13. Was experiencing this issue. I've applied the fix. Will report back tomorrow after the cron runs. Thank you so much for finding and fixing this. You guys are the best!
  14. I need to be able to sync data with wordpress, quickbooks, etc. Instead of individual integrations, the strategy that seems to make sense is Zapier or equivalent service. Then my valuable Blesta data would no longer be siloed.
  15. I would like to be able to advance to the next record in the client's detail view. This will save us from going back to the detail to advance to the next account. Perhaps you could place it to the right of the client ID?
×
×
  • Create New...