To know how to create your Hubspot API key, refer to the corresponding section of Hubspot API docs. Hubspot recommends you to re-generate your API key every six months. Only accounts with Super Admin Access can create an API key (at the moment of writing).

Save the API key on your machine using the hubspot_key_set() function, that relies on the keyring package that stores the key in the system default credential store (see keyring docs). If you don't do that, you'll have to provide the API key as argument to hubspot functions calling Hubspot APIs.

# Either input the key as parameter
hubspot_key_set("yourapikey")

# Or just call the function,
# the key will be asked interactively
hubspot_key_set()

If no API key is set nor provided as an argument, the "demo" key is used and a message is printed to the screen. As noted earlier, this won't give you access to your own Hubspot data.

You can check the daily usage related to the API key via hubspot_api_usage(). Calls in the package are rate limited (100 requests every 10 seconds) but there's also a daily limit on calls.

hubspot_api_usage()

For a more secure authorization method, without a daily limit on calls, see [hubspot_token_create()].



lockedata/hubspot documentation built on March 1, 2020, 8:54 p.m.