Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions lib/hubspot/codegen/oauth/api/access_tokens_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ def get_with_http_info(token, opts = {})
if @api_client.config.client_side_validation && token.nil?
fail ArgumentError, "Missing the required parameter 'token' when calling AccessTokensApi.get"
end
# resource path
local_var_path = '/oauth/v1/access-tokens/{token}'.sub('{' + 'token' + '}', CGI.escape(token.to_s))
# resource path: introspection moved to POST /oauth/2026-03/token/introspect;
# the token is sent as a form-body parameter, never in the URL.
local_var_path = '/oauth/2026-03/token/introspect'

# query parameters
query_params = opts[:query_params] || {}
Expand All @@ -49,15 +50,23 @@ def get_with_http_info(token, opts = {})
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
header_params['Content-Type'] = content_type unless content_type.nil?

# form parameters
form_params = opts[:form_params] || {}
form_params['token'] = token
form_params['token_type_hint'] = opts[:'token_type_hint'] || 'access_token'
form_params['client_id'] = opts[:'client_id'] if !opts[:'client_id'].nil?
form_params['client_secret'] = opts[:'client_secret'] if !opts[:'client_secret'].nil?

# http body (model)
post_body = opts[:debug_body]

# return_type
return_type = opts[:debug_return_type] || 'AccessTokenInfoResponse'
# return_type: introspection response is read as a raw hash so the mapping is not
# coupled to a strict model as HubSpot iterates the 2026-03 introspect fields.
return_type = opts[:debug_return_type] || 'Object'

# auth_names
auth_names = opts[:debug_auth_names] || []
Expand All @@ -72,7 +81,7 @@ def get_with_http_info(token, opts = {})
:return_type => return_type
)

data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: AccessTokensApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
Expand Down
32 changes: 24 additions & 8 deletions lib/hubspot/codegen/oauth/api/refresh_tokens_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ def archive_with_http_info(token, opts = {})
if @api_client.config.client_side_validation && token.nil?
fail ArgumentError, "Missing the required parameter 'token' when calling RefreshTokensApi.archive"
end
# resource path
local_var_path = '/oauth/v1/refresh-tokens/{token}'.sub('{' + 'token' + '}', CGI.escape(token.to_s))
# resource path: revocation moved to POST /oauth/2026-03/token/revoke;
# the token is sent as a form-body parameter, never in the URL.
local_var_path = '/oauth/2026-03/token/revoke'

# query parameters
query_params = opts[:query_params] || {}
Expand All @@ -49,9 +50,15 @@ def archive_with_http_info(token, opts = {})
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['*/*'])
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
header_params['Content-Type'] = content_type unless content_type.nil?

# form parameters
form_params = opts[:form_params] || {}
form_params['token'] = token
form_params['client_id'] = opts[:'client_id'] if !opts[:'client_id'].nil?
form_params['client_secret'] = opts[:'client_secret'] if !opts[:'client_secret'].nil?

# http body (model)
post_body = opts[:debug_body]
Expand All @@ -72,7 +79,7 @@ def archive_with_http_info(token, opts = {})
:return_type => return_type
)

data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RefreshTokensApi#archive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
Expand All @@ -98,8 +105,9 @@ def get_with_http_info(token, opts = {})
if @api_client.config.client_side_validation && token.nil?
fail ArgumentError, "Missing the required parameter 'token' when calling RefreshTokensApi.get"
end
# resource path
local_var_path = '/oauth/v1/refresh-tokens/{token}'.sub('{' + 'token' + '}', CGI.escape(token.to_s))
# resource path: introspection moved to POST /oauth/2026-03/token/introspect;
# the token is sent as a form-body parameter, never in the URL.
local_var_path = '/oauth/2026-03/token/introspect'

# query parameters
query_params = opts[:query_params] || {}
Expand All @@ -108,15 +116,23 @@ def get_with_http_info(token, opts = {})
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json', '*/*'])
# HTTP header 'Content-Type'
content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
header_params['Content-Type'] = content_type unless content_type.nil?

# form parameters
form_params = opts[:form_params] || {}
form_params['token'] = token
form_params['token_type_hint'] = opts[:'token_type_hint'] || 'refresh_token'
form_params['client_id'] = opts[:'client_id'] if !opts[:'client_id'].nil?
form_params['client_secret'] = opts[:'client_secret'] if !opts[:'client_secret'].nil?

# http body (model)
post_body = opts[:debug_body]

# return_type
return_type = opts[:debug_return_type] || 'RefreshTokenInfoResponse'
# return_type: introspection response is read as a raw hash so the mapping is not
# coupled to a strict model as HubSpot iterates the 2026-03 introspect fields.
return_type = opts[:debug_return_type] || 'Object'

# auth_names
auth_names = opts[:debug_auth_names] || []
Expand All @@ -131,7 +147,7 @@ def get_with_http_info(token, opts = {})
:return_type => return_type
)

data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
if @api_client.config.debugging
@api_client.config.logger.debug "API called: RefreshTokensApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
Expand Down
2 changes: 1 addition & 1 deletion lib/hubspot/codegen/oauth/api/tokens_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def create_with_http_info(opts = {})
fail ArgumentError, "invalid value for \"grant_type\", must be one of #{allowable_values}"
end
# resource path
local_var_path = '/oauth/v1/token'
local_var_path = '/oauth/2026-03/token'

# query parameters
query_params = opts[:query_params] || {}
Expand Down