How do I change the API version of Simple Salesforce

1.4k Views Asked by At

I went to \simple_salesforce and changed a line in api.py by hand from

DEFAULT_API_VERSION = '42.0'

to

DEFAULT_API_VERSION = '51.0'

But it feels incorrect to do it like this. Is there some other way?

1

There are 1 best solutions below

0
On BEST ANSWER

There's bit of text in readme in "additional features".

SalesforceLogin, which takes in a username, password, security token, optional version and optional domain

(...)

SFType class, which is used internally by the getattr() method in the Salesforce() class and represents a specific SObject type. SFType requires object_name (i.e. Contact), session_id (an authentication ID), sf_instance (hostname of your Salesforce instance), and an optional sf_version

So looks like you can pass sf_version to SalesforceLogin() call and it'll be respected. Or version to Salesforce(). Check the files and experiment? Maybe even make a pull request in simple's Git repo so they update the default. 42 was over 3 years ago. It's perfectly fine to use newer API to see more tables, get some performance boost, bugfixes.