Coder Social home page Coder Social logo

Comments (10)

guysoft avatar guysoft commented on July 17, 2024 1

Er- so how about an example that shows how to use BaseClient with stuff you didn't write yet?
It would help completeness.

from hubspot3.

jpetrucciani avatar jpetrucciani commented on July 17, 2024 1

Yeah I could add a snippet about that in just a bit

from hubspot3.

jpetrucciani avatar jpetrucciani commented on July 17, 2024

from hubspot3.

guysoft avatar guysoft commented on July 17, 2024

Even something like this in the readme start (I can PR):

from hubspot3.companies import CompaniesClient
API = "your-api"
a = CompaniesClient(api_key=API)

Better if it has a bit more examples to other parts. For example I can't find where to get company properties API.

from hubspot3.

jpetrucciani avatar jpetrucciani commented on July 17, 2024

Feel free to PR! I can merge that in and expand on it if you'd like!

Currently I don't have a client put together for the Company Properties API. I'm missing a few different APIs, some of which were added/changed after the last time I worked on this repo.

I should be able to revisit and add some of these APIs soon, but in the meantime, could you list out the APIs I'm missing that you would like to have?

from hubspot3.

guysoft avatar guysoft commented on July 17, 2024

Found you can get the company properties if you get each company individually. But Started running in to rate limits, That would also be helpful to document )

from hubspot3.

jpetrucciani avatar jpetrucciani commented on July 17, 2024

Ahh yeah, you'll be able to get all of the properties for a given company on the get company method, but there's no CompanyPropertiesClient to interact with the fine-grained properties API that hubspot has.

As for rate limits, it'll just be however Hubspot rate limits their API:
https://developers.hubspot.com/apps/api_guidelines

from hubspot3.

guysoft avatar guysoft commented on July 17, 2024

I wrote one myself since I actually need this.

import json
from hubspot3.base import BaseClient

PIPELINES_API_VERSION = '1'
class PipelineClient(BaseClient):
    """
    Lets you extend to non-existing clients, this example extends pipelines
    """

    def __init__(self, *args, **kwargs):
        super(PipelineClient, self).__init__(*args, **kwargs)

    def get_pipelines(self, **options):
        params = {}

        return self._call('pipelines', method='GET', params=params)

    def _get_path(self, subpath):
        return 'deals/v{}/{}'.format(
            self.options.get('version') or PIPELINES_API_VERSION,
            subpath
        )

if __name__ == "__main__":
    import json
    API = "your_api"
    a = PipelineClient(api_key=API)
    print(json.dumps(a.get_pipelines()))

from hubspot3.

guysoft avatar guysoft commented on July 17, 2024

Also, no docs on how to use params, for example:

import json
from hubspot3.deals import DealsClient

deal_id = "12345"
API = "your_api"
params = {"includePropertyVersions": "true"} # Note values are not pythonized
deals_client = DealsClient(api_key=API)
deal_data = deals_client.get(deal_id, params=params)
print(json.dumps(deal_data))

from hubspot3.

jpetrucciani avatar jpetrucciani commented on July 17, 2024

Added these examples to the readme! I probably should split that off into a wiki or some more involved documentation at some point

from hubspot3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.