We recently had an issue with one of our clients that was causing our app's API calls to Salesforce to fail. Upon further investigation, it seems that the Salesforce server the client was assigned to for logging in via the web was ap1.salesforce.com, but calls to the API to determine the correct endpoint to use were using eu1.salesforce.com. The problem eventually seemed to resolve itself after we requested a new refresh token.

Has this ever happened to anyone else? Not sure how to accommodate for this - we determine the endpoint to use on every API call, we're not storing the endpoint anywhere.


1 Answer 1


I'd expect all API based logins to go via login.salesforce.com. From Authenticating Apps with OAuth.

The three primary endpoints used with OAuth 2.0 are:

The only oddity I could think of would be if they migrated their org from a ap1 instance to eu1. Seems like an odd sort of move from one region to another.

  • Sorry I wasn't clear on this in the original question - I am indeed using those endpoints for OAuth. I'm relying on the OAuth response to tell me the REST API URL. The REST API endpoint that is provided in the OAuth response has the incorrect server.
    – emroc
    Apr 5, 2016 at 13:04
  • @emroc Has the org been recently migrated from one instance to another? Other than that, I'd raise a case with Salesforce support. Apr 5, 2016 at 19:30
  • This seems to sometimes happen without the client's knowledge. For example, Salesforce does occassional instance refreshes, as described here: help.salesforce.com/apex/…. My question is, do the user's refresh tokens cease to work when they are migrated in this way?
    – emroc
    Apr 7, 2016 at 14:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .