Print this page

Endpoint to login via the web-service API?

Knowledge Article Number 000044624

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?


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,
For sandbox instances, 
Or, if MyDomain is enabled on the org, you can use, 

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

promote demote