function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

How to get supported version numbers without specifying one first?

I'm coding my integration to get records out from SFDC. I need to show supported version number list before accessing SFDC data.
But I find that:
1. When trying to get versions information from , I have to login first to get a session ID.
2. When trying to login SFDC, I have to specify a version number in the URL first like .
It seems to be a loop. If I'm not sure which version I could use, I should try several times manually.
Is there any way to login without specifying version number?

As far as I know, when using URL without version number, '/u' would be considered as an invalid version. When using, '/u' or '/c' is required to be specified.
Any suggestions?

Andy BoettcherAndy Boettcher
You can log in via without specifying an API version, but you need to set that version number in all subsequent calls.
Hi Andy,

When I send a web request to login with URL, username and password, the URL should be like this, . There is a specified API version number.
I tried some URLs as following:
All the three are invalid. The response messages are:
    1. HTML text for a login page of Salesforce.
    2. /u or /c should be specified.
    3. /u is an invalid version.

So, how could I change the URL text?

Daniel BallingerDaniel Ballinger
I don't believe you can omit the API version when making API calls to the Partner API. Salesforce needs to know which API version you are using, even with the login call.

It must take the form:
You can safely assume that all orgs will support the current v35.0 of the API going forward. That is the primary reason Salesforce includes the API version in the URL, so they can provide long term support for older releases.