jake
06/30/2023, 1:45 PMpardot tap
, but with the pardot api
, you actually have to get the `refresh token`/ bearer token
by hitting up the salesforce api
with a salesforce access token
of its own first and then it provides the pardot token
.
if i just keep updating the pardot token
manually, then it works with this:
@property
def authenticator(self) -> BearerTokenAuthenticator:
"""Return a new authenticator object.
Returns:
An authenticator instance.
"""
return BearerTokenAuthenticator.create_for_stream(
self,
token='thepardotrefreshtoken' # this is the important one
)
so wondering if im basically just supposed to add a function within the authenticator
function which hits up the salesforce api
first kind of like this:
@property
def authenticator(self) -> BearerTokenAuthenticator:
"""Return a new authenticator object.
def gettoken():
***CODE THAT HITS UP SFDC AND RETURNS A PARDOT REFRESH TOKEN***
return pardotrefreshtoken
Returns:
An authenticator instance.
"""
return BearerTokenAuthenticator.create_for_stream(
self,
token=gettoken() # this is the important one
)
or is there some recommended way to do this otherwise, considering i would prefer to have the salesforce access token
inputted via config