I'm reading OAuth Endpoints, and I'd like to know what the response, both success and failure, looks like without making a test API call. Take for example
https://login.salesforce.com/services/oauth2/token
What does SalesForce return when calling this endpoint for both success and failure?
The following URL has an example of a successful response Salesforce OAuth It also means that the response varies based on which flow you use.
The documentation you provided explains that the token endpoint uses OAuth 2.0. That means as a minimum the successful response will contain an access_token and a token_type as per OAuth 2.0 Spec.
As an HTTP response (JSON encoded body), it must contain the following as a minimum:
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache
{
"access_token":"2YotnFZFEjr1zCsicMWpAA",
"token_type":"Bearer"
}
That was the successful response, lets have a look at the error response as per OAuth 2.0 Spec
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache
{
"error":"invalid_request"
}
Important note, the status code can vary as explained in the second link. You can also get an additional error_description and error_uri in the body.