lib/square/api/o_auth_api.rb
# Revokes an access token generated with the OAuth flow.
# If an account has more than one OAuth access token for your application,
# this
# endpoint revokes all of them, regardless of which token you specify. When
# an
# OAuth access token is revoked, all of the active subscriptions associated
# with that OAuth token are canceled immediately.
# __Important:__ The `Authorization` header for this endpoint must have the
# following format:
# ```
# Authorization: Client APPLICATION_SECRET
# ```
# Replace `APPLICATION_SECRET` with the application secret on the OAuth
# page for your application on the Developer Dashboard.
# @param [RevokeTokenRequest] body Required parameter: An object containing
# the fields to POST for the request.  See the corresponding object
# definition for field details.
# @param [String] authorization Required parameter: Client
# APPLICATION_SECRET
# @return [RevokeTokenResponse Hash] response from the API call
Revokes an access token generated with the OAuth flow.
If an account has more than one OAuth access token for your application,
this
endpoint revokes all of them, regardless of which token you specify. When
an
OAuth access token is revoked, all of the active subscriptions associated
with that OAuth token are canceled immediately.
Revokes an access token generated with the OAuth flow . If an account has more than one OAuth access token for your application this endpoint revokes all of them regardless of which token you specify . When an OAuth access token is revoked all of the active subscriptions associated with that OAuth token are canceled immediately .
def revoke_token(body:,
                     authorization:)
      _query_builder = config.get_base_uri
      _query_builder << '/oauth2/revoke'
      _query_url = APIHelper.clean_url _query_builder
      _headers = {
        'accept' => 'application/json',
        'content-type' => 'application/json; charset=utf-8',
        'Authorization' => authorization
      }
      _request = config.http_client.post(
        _query_url,
        headers: _headers,
        parameters: body.to_json
      )
      _response = execute_request(_request)
      decoded = APIHelper.json_deserialize(_response.raw_body)
      _errors = APIHelper.map_response(decoded, ['errors'])
      ApiResponse.new(
        _response, data: decoded, errors: _errors
      )
    end
def revoke_token ( body : , authorization : ) _query_builder = config . get_base_uri _query_builder << '/oauth2/revoke' _query_url = APIHelper . clean_url _query_builder _headers = { 'accept' => 'application/json' , 'content-type' => 'application/json; charset=utf-8' , 'Authorization' => authorization } _request = config . http_client . post ( _query_url , headers : _headers , parameters : body . to_json ) _response = execute_request ( _request ) decoded = APIHelper . json_deserialize ( _response . raw_body ) _errors = APIHelper . map_response ( decoded , [ 'errors' ] ) ApiResponse . new ( _response , data : decoded , errors : _errors ) end
Revokes an access token generated with the OAuth flow.
Revokes an access token generated with the OAuth flow .
# Prepare query url. # Prepare headers. # Prepare and execute HttpRequest. # Return appropriate response type.
response from the API call
response from the API call
RevokeTokenResponse Hash
body
<not_specific>
authorization
<not_specific>
<not_specific>
authorization Required parameter: Client APPLICATION_SECRET
authorization Required parameter : Client APPLICATION_SECRET