Skip to content

adding api token for new Personal Access Tokens & Service Account Keys#85

Open
jaredjackson wants to merge 4 commits into
nateleavitt:masterfrom
jaredjackson:support-access-token
Open

adding api token for new Personal Access Tokens & Service Account Keys#85
jaredjackson wants to merge 4 commits into
nateleavitt:masterfrom
jaredjackson:support-access-token

Conversation

@jaredjackson
Copy link
Copy Markdown
Contributor

@jaredjackson jaredjackson commented Aug 17, 2024

This creates a new configuration key, "api_token," for use with the latest required personal access tokens or service account keys. When using the api_token configuration, the old api_key is ignored by the service call. When the connection is executed, and an api_token is present, the api_url is corrected, and the api_token is added as a header to the request as required for authorization. If no api_key is present in the configuration, a dummy key is added and still included in the request. This is because the XML-RPC API still expects an api_key at the new URL, but the api_key is ignored for authentication purposes.

For those still using this gem for Infusionsoft's XML-RPC API, this should work without breaking for anyone who hasn't updated yet. All tests passed after these changes.

Jared Jackson and others added 4 commits August 17, 2024 13:44
@abhishekpshukla
Copy link
Copy Markdown

Hi @jaredjackson ,

I made the changes as in your PR, and getting the following error:

CALL: ContactService.load api_url: api.infusionsoft.com at:2024-10-10 06:49:10 +0000 args:[52736, {}]
ERROR: No method matching arguments: java.lang.String, java.lang.Integer, java.util.HashMap
InfusionAPIError: No method matching arguments: java.lang.String, java.lang.Integer, java.util.HashMap
from /bundle_cache/ruby/2.6.0/bundler/gems/infusionsoft-cc65f10de8f0/lib/infusionsoft/exception_handler.rb:28:in `initialize'

Configuration: [Using Service account Key]


Infusionsoft.configure do |config|
  config.api_url = Settings.infusionsoft.api_url
  config.api_key = Settings.infusionsoft.api_key
  config.api_token = 'KeapAK-283489y23498.......'
end

Could you please help me.

@nateleavitt
Copy link
Copy Markdown
Owner

Hello all.. Sorry for the late response. I'm pretty sure you can still use the existing gem by doing the following:

Hey guys.. I know this is late, but I think you can do the same thing with XML-RPC by doing the following:

Infusionsoft.configure do |config|
  config.user_agent = "CustomerHub-#{HUB_VERSION}"
  config.api_key = SAK_KEY
  config.api_url = "api.infusionsoft.com"
  config.use_oauth = true
end

The key change is adding config.use_oauth = true. I'm pretty sure this will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants