This article explains which endpoint URL values to use when logging in to a Salesforce org via the SOAP API (web service API). It covers production, sandbox, and My Domain login endpoints, and explains the best practice for avoiding hard-coded endpoint URLs in your integration code.
Salesforce does not recommend hard-coding the endpoint URL value into your integration code. The best practice is to execute the login() SOAP API call using one of the generic login endpoints. This call returns a LoginResult object. The LoginResult object contains a metadataServerUrl string that holds the correct endpoint URL for your org. Use this value to reset the SOAP endpoint to the returned server URL for all subsequent API calls.
For production org instances, use the following endpoint URL:
https://login.salesforce.com/services/Soap/c/xx.0/0DF300000000xxS
Replace "xx.0" with the API version you are using and replace "0DF300000000xxS" with your org's client identifier.
For sandbox org instances, use the following endpoint URL:
Replace "xx.0" with the API version you are using.
If My Domain is enabled on the org, you can also use the My Domain URL as the login endpoint:
https://[MyDomain].my.salesforce.com/services/Soap/c/xx.0/0DF300000000xxS
Replace [MyDomain] with the My Domain name of your company (for example, if your My Domain is "acme", the URL becomes ).
000385590

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.