Loading

Endpoint URL values to log in to org using web-service API

Udgivelsesdato: Oct 13, 2022
Beskrivelse

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?

Løsning

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/xx.0/0DF300000000xxS
For sandbox instances, 
https://test.salesforce.com/services/Soap/c/xx.0/0DF300000000xxS 
Or, if MyDomain is enabled on the org, you can use,  
https://MyDomain.my.salesforce.com/services/Soap/c/xx.0/0DF300000000xxS 

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

Vidensartikelnummer

000385590

 
Indlæser
Salesforce Help | Article