+ Start a Discussion

questions about URL returned from login() call

Using the 2.5 API, the login() call returns the URL: https://na1-api.salesforce.com/services/Soap/u/2.5. Through the salesforce.com UI, the {API_Partner_Server_URL} merge fields returns the URL: https://na1.salesforce.com/services/Soap/u/2.5.

These are close, but not exactly the same. I'd like to know if these URLs can be used interchangeably, and if not, what are the different circumstances when I would use one or the other?


Using the 2.0 API, the login() call returns the URL: https://na1-api.salesforce.com/servlet/servlet.SoapApi. I need this URL for use in an Scontrol, but I don't see any merge field that will provide this, and I am very reluctant to hard-code this. Even though this is a 2.0 API issue, I'd like to see this oversight rectified. What can I do about this?



Hi Nick,

You can use the two variants of the url interchangeably.  They will both resolve to the correct app server farm.  The api.salesforce... variant is a carry over from the XML-RPC days.  

The 2.0 endpoint can be constructructed from the {API_Partner_Server_URL} merge field by using the https://na1.salesforce.com portion and appending the /servlet/servlet.SoapApi string to the end of it.