Skip to content

Why using "access_token" when the authentication method is API Token? #126

@mfs-homero-merino

Description

@mfs-homero-merino

for page in http.get_incremental_export(url, self.config['access_token'], self.request_timeout, start_time):

My team is trying to use this tap with the API token authenticationn but when running ~/.virtualenv/tap-zendesk/bin/tap-zendesk --config tap-zendesk.conf --catalog catalog_zendesk.json, we're getting this error:
INFO Using API Token authentication.
INFO tickets: Starting sync
INFO Syncing ticket_audits per ticket...
INFO METRIC: {"type": "counter", "metric": "record_count", "value": 0, "tags": {"endpoint": "tickets"}}
CRITICAL 'access_token'
Traceback (most recent call last):
File "/home/singer/.virtualenv/tap-zendesk/bin/tap-zendesk", line 33, in
sys.exit(load_entry_point('tap-zendesk==1.7.5', 'console_scripts', 'tap-zendesk')())
File "/home/singer/.virtualenv/tap-zendesk/lib/python3.9/site-packages/singer/utils.py", line 229, in wrapped
return fnc(*args, **kwargs)
File "/home/singer/.virtualenv/tap-zendesk/lib/python3.9/site-packages/tap_zendesk/init.py", line 214, in main
do_sync(client, parsed_args.catalog, state, parsed_args.config)
File "/home/singer/.virtualenv/tap-zendesk/lib/python3.9/site-packages/tap_zendesk/init.py", line 144, in do_sync
counter_value = sync_stream(state, config.get('start_date'), instance)
File "/home/singer/.virtualenv/tap-zendesk/lib/python3.9/site-packages/tap_zendesk/sync.py", line 31, in sync_stream
for (stream, record) in instance.sync(state):
File "/home/singer/.virtualenv/tap-zendesk/lib/python3.9/site-packages/tap_zendesk/streams.py", line 330, in sync
for ticket in tickets:
File "/home/singer/.virtualenv/tap-zendesk/lib/python3.9/site-packages/tap_zendesk/streams.py", line 151, in get_objects
for page in http.get_incremental_export(url, self.config['access_token'], self.request_timeout, start_time):
KeyError: 'access_token'

The get_objects method in CursorBasedExportStreams class uses again the config file regardless of the authentication type which causes an error in the keys. If both keys are added in config file, by default the auth method selected is Oauth.

Any suggestion for this error? Kind regards!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions