Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce a switch for sandbox and dev enviroments #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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