Description Usage Arguments Details Value See Also Examples
Get/set the Hubspot secret API key using the keyring
package.
For a more secure authorization method, without a daily limit on calls,
see hubspot_token_create()
1 2 3 | hubspot_key_get()
hubspot_key_set(key = NULL)
|
key |
API key. If not provided via this argument, the key will have to be provided interactively. |
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()
.
The Hubspot API accepts authorization via
an API key,
OAuth 2.0.
OAuth 2.0 is the recommended method. However, this package supports both.
Note that if you do nothing the package will use the “demo” API token but this won’t give you access to your own Hubspot data. So you’ll need to spend a little time on setup:
For rapid prototyping key, use a Hubspot API key, see
hubspot_key_set()
.
For more secure use, without a daily limit on API calls, see
hubspot_token_create()
to create a Hubspot authorization token
(OAuth 2.0).
If you have both saved an API key via hubspot_key_set()
and a token
via hubspot_token_create()
, priority will be given to using the OAuth
2.0 token. If you don’t want that, explicitely pass NULL
as value for
the token_path
argument of all functions.
The key (a string)
Other auth:
default_ld_hubspot_app()
1 2 3 4 5 | hubspot_key_get()
## Not run:
hubspot_key_set("yourapikey")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.