TestingAPIs is still being built. If something breaks, email support@testingapis.com.

Return a resource that requires an OAuth access token

GEThttps://api.testingapis.com/api/auth/oauth/protectedSign in to see this endpoint's URL

Header: Authorization: Bearer <access_token> from POST /api/auth/oauth/token.Header: Authorization: Bearer <access_token> from POST ….

OAuth2 access token (password or authorization-code grant); or Bearer token — {{oauthAccessToken}}

Responses

200
Token valid; returns its client, subject, scope and remaining lifetime.
401
Token missing, invalid, revoked or expired.

Example

Request
curl -X GET "https://api.testingapis.com/api/auth/oauth/protected" \
  -H "Authorization: Bearer {{oauthAccessToken}}" \
  -H "X-TestingApis-Key: YOUR_API_KEY"
Response200 OK
{
  "message": "You accessed an OAuth-protected resource.",
  "client_id": "apibee-client",
  "sub": "apibee",
  "scope": "read profile",
  "expires_in": 3596
}

Sign in to see the details

The parameters, request and response examples and the live Try it panel for this endpoint are for signed-in members. Accounts are free and take a few seconds to create.