Print this page

Endpoint to login via the web-service API?

Knowledge Article Number 000044624
Description

Which endpoint value do I need to use in order to login to my org via the API? Can I use the MyDomain URL instead of the generic Salesforce URL?

Resolution

Salesforce does not recommend "hard-coding" the endpoint URL value into your integration code. The best practice would be to execute the login() call.

This call would return a LoginResult object which has a metadataServerUrl string type that holds the relevant endpoint. You can use this value to reset the SOAP endpoint to the returned server URL.

Having said that, the following endpoints would also initiate a successful login.

For production instances, 
https://login.salesforce.com/services/Soap/c/24.0/0DF300000000K4S
For sandbox instances, 
https://test.salesforce.com/services/Soap/c/24.0/0DF300000000K4S 
Or, if MyDomain is enabled on the org, you can use,  
https://MyDomain.my.salesforce.com/services/Soap/c/24.0/0DF300000000K4S 

Note: Replace "MyDomain" with the My Domain name of your company.





promote demote