jpetrucciani / hubspot3

python3.6+ hubspot client based on hapipy, but modified to use the newer endpoints and non-legacy python
MIT License
146 stars 72 forks source link

How to paginate contacts? #89

Closed tycooperaow closed 4 years ago

tycooperaow commented 4 years ago

When I get the contact list from hub sport it gets them in a large dataset since the project I'm working on has a lot of contacts like over 2000. How do I paginate this?

@api.route("/hubspot/contacts/")
@cross_origin(supports_credentials=True)
def getHubspotContacts():
    """Gets a list of the clients we have in hubspot"""
    API_KEY = "api-key"
    hb_client = Hubspot3(api_key=API_KEY)

    contacts = hb_client.contacts.get_all()
    # display = contacts[range_val:(range_val+20)]
    return jsonify(contacts)
jpetrucciani commented 4 years ago

Duplicate of #84