jwogrady Posted July 14, 2023 Report Share Posted July 14, 2023 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.