+ Start a Discussion
hyjhyj 

How to ignore the version number in the URL which is used in login request?

Hi all,

I've started a discussion, https://developer.salesforce.com/forums/ForumsMain?id=906F00000005I5OIAU , but not got expected suggestion.
When I send a web request to login with URL, username and password, the URL should be like this, https://login.salesforce.com/services/Soap/u/29.0 . There is a specified API version number.
I tried some URLs as following:
    1. https://login.salesforce.com/
    2. https://login.salesforce.com/services/Soap
    3. https://login.salesforce.com/services/Soap/u
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, if I need to login without a specified version number, only for the login request, how could I change the URL text?

Thanks
Ashish DevAshish Dev
First thing for SOAP api you must specifiy version number.
You can get version number without login.
On your other thread I observed that you tried to get version number from https://login.salesforce.com/services/data, which is incorrect URL to get org info.

You need to use your instance URL to get org Info like http://na1.salesforce.com/services/data/ or http://ap1.salesforce.com/services/data/
Then after getting supported version number you can use that value to make login request.
 
Daniel BallingerDaniel Ballinger
The API version in the login URL in not optional. With Winter `16 being the current release you can safely work with v35.0 going foward. Salesforce will maintain backwards compaticilty with it.

After establishing the session you can then modify the API version in the URL as required.