From 9e1344103de83b23adea442580d1b5a697217cde Mon Sep 17 00:00:00 2001 From: Hamilton Kibbe Date: Wed, 22 Dec 2021 15:35:14 -0500 Subject: [PATCH] Fix API version bug The login URL should not include the leading v in the api version, just the numeric part. (See docs at: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_login.htm) Including the leading v (as is the default behavior with the value "v29.0" results in salesforce returning a server_url with a version 7.0, which is being retired early next year. I've opted to leave the default value as is, to avoid changing the library's interface, and just to change the implementation to generate the correct URL. --- salesforce_reporting/login.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salesforce_reporting/login.py b/salesforce_reporting/login.py index 9192307..8c3b10f 100644 --- a/salesforce_reporting/login.py +++ b/salesforce_reporting/login.py @@ -38,7 +38,7 @@ def __init__(self, username=None, password=None, security_token=None, sandbox=Fa self.password = password self.security_token = security_token self.sandbox = sandbox - self.api_version = api_version + self.api_version = api_version.lstrip('v') self.login_details = self.login(self.username, self.password, self.security_token) self.token = self.login_details['oauth'] self.instance = self.login_details['instance']