Skip to content

Conversation

@clemens7haar
Copy link

Hello,

To make this script work with sandboxes and developer enviroments I added some small changes.

A "production_instance" parameter was added to the PardotAPI class. By default it's set to True, but if you define it as False it changes the necessary servernames.

if production_instance == True:
  self.domain` = 'https://pi.pardot.com'
  self.oauth_domain = 'https://login.salesforce.com/'
else:
  """Sandbox or developer environment"""
 self.domain = 'https://pi.demo.pardot.com'
 self.oauth_domain = 'https://test.salesforce.com/'

You can use it like this:

from pypardot.client import PardotAPI
p = PardotAPI(version=4, production_instance=False)
p.setup_salesforce_auth_keys()

Maybe this option is useful for other people too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant