[SalesForce] Get Instance Url with valid OAuth Access Token

How do I get the Instance URL with just a valid OAuth Access Token?

I don't have any other information, for example, I don't have the client_id or client_secret.

If I make an assumption that the Instance URL is https://na16.salesforce.com, I'm able to use the REST API with the valid OAuth Access Token.

Best Answer

You need valid client_id and client_secret in order to request a valid token to perform API requests. You can obtain these alphanumeric strings by creating a custom app in your org (this may help: https://developer.salesforce.com/forums/?id=906F0000000AfcgIAC )

When you've got your client_id and client_secret, follow the instructions I wrote on a different question, it should work for you then: Sending data from PHP to Salesforce using CURL