API Reference
Get or refresh a token
/tokenhttps://google-ads.mimicr.dev · provider: https://oauth2.googleapis.comExchanges an authorization code for an access token (grant_type=authorization_code), or refreshes an access token (grant_type=refresh_token). The body is form-encoded.
The response has access_token, expires_in (3599), scope, token_type and, when openid was granted, id_token. refresh_token is returned only when the authorization asked for access_type=offline and the grant is new; the refresh grant returns the same JSON without it. The scope may be a subset of what was requested.
In Mimicr, access tokens last 3599 s on the sandbox clock, and the id_token is an RS256 JWT signed with a sandbox key. Service accounts (jwt-bearer) are not simulated and return unsupported_grant_type.
Authorization
Public route, no token.
Body
application/x-www-form-urlencodedAs defined in the OAuth 2.0 specification, this field's value must be set to authorization_code to exchange a code, or refresh_token to refresh an access token.
authorization_coderefresh_tokenThe authorization code returned from the initial request. Required for authorization_code.
"4/0A…"One of the redirect URIs listed for your project. Required for authorization_code; it must be the one used in the authorization request.
The refresh token returned from the authorization code exchange. Required for refresh_token.
"1//0…"The client ID obtained from the API Console.
The client secret obtained from the API Console.
"GOCSPX-…"Responses
200Tokens.
The token that your application sends to authorize a Google API request.
"ya29.a0…"The remaining lifetime of the access token in seconds.
3599A token that you can use to obtain a new access token. Refresh tokens are valid until the user revokes access. This field is only present if the access_type parameter was set to offline in the initial request to Google's authorization server.
The scopes of access granted by the access_token expressed as a list of space-delimited, case-sensitive strings.
The type of token returned. At this time, this field's value is always set to Bearer.
BearerA JWT that contains identity information about the user. Present when the openid scope was granted.
400invalid_grant (bad, used or expired code; revoked refresh token), redirect_uri_mismatch, invalid_request (missing parameter) or unsupported_grant_type.
An OAuth 2.0 error code.
invalid_requestinvalid_clientinvalid_grantredirect_uri_mismatchunsupported_grant_typeinvalid_tokenHuman-readable text with additional information.
"Bad Request"401invalid_client: wrong client_secret or unknown client_id.
An OAuth 2.0 error code.
invalid_requestinvalid_clientinvalid_grantredirect_uri_mismatchunsupported_grant_typeinvalid_tokenHuman-readable text with additional information.
"Bad Request"