If you want to login on Salesforce from an external app, you should start creating a “connected app” within Salesforce that informs about this authentication entry point.
Go to Setup > Create > Apps and create a new Connected App. Populate required fields, granting all necessary permissions in the OAuth Scopes selection:
Then open a client (I used Advanced Rest Client) and try to login by providing:
1) The HTTP method
2) The endpoint URL
3) The body with ContentType
The body should also have those parameters:
– grant_type, with value “password”
– username, the username to use in the login
– password, the concatenation of user password and security token
– client_secret, the consumer secret of the connected app
– client_id, the consumer key of the connected app
In the above invocation, you can see that the response contains the instance_url and the access_token. You should use those information to be authorised in later invocations.
Generally you have to replace the base endpoint with the
instance_url, and put the
access_token in the Authorization header along with the specific type (eg. Bearer).
This is an example of the SObject describe REST API invocation:
Now you’ll be able to invoke all the APIs on the Salesforce Organization!