I´m stuck defining my connector. A WISE API. I man...
# help-connector-development
l
I´m stuck defining my connector. A WISE API. I manage to create a GET req via postman, but I´m not defining it right in the connector development yml file
s
@laila ribke try running with the
--debug
flag to see the outgoing HTTP request you are making
l
Hi @Sherif Nada, thats what I get with the debug (.venv) lulirib@DESKTOP-BPISP7U:~/Development/airbyte/airbyte-integrations/connectors/source-wise-api-source$ python main.py check --debug --config secrets/config.json {"type": "DEBUG", "message": "Debug logs enabled", "data": {}} {"type": "DEBUG", "message": "declarative source created from parsed YAML manifest", "data": {"parsed_config": "{\"version\": \"0.1.0\", \"definitions\": {\"selector\": {\"extractor\": {\"field_pointer\": []}}, \"requester\": {\"url_base\": \"https://api.transferwise.com/v1/\", \"http_method\": \"GET\", \"authenticator\": {\"type\": \"BearerAuthenticator\", \"api_token\": \"{{ config['api_key'] }}\"}, \"request_options_provider\": {\"request_parameters\": {\"profile\": \"{{ config['profile'] }}\"}}}, \"retriever\": {\"record_selector\": {\"extractor\": {\"field_pointer\": []}}, \"paginator\": {\"type\": \"NoPagination\"}, \"requester\": {\"url_base\": \"https://api.transferwise.com/v1/\", \"http_method\": \"GET\", \"authenticator\": {\"type\": \"BearerAuthenticator\", \"api_token\": \"{{ config['api_key'] }}\"}, \"request_options_provider\": {\"request_parameters\": {\"profile\": \"{{ config['profile'] }}\"}}}}, \"base_stream\": {\"retriever\": {\"record_selector\": {\"extractor\": {\"field_pointer\": []}}, \"paginator\": {\"type\": \"NoPagination\"}, \"requester\": {\"url_base\": \"https://api.transferwise.com/v1/\", \"http_method\": \"GET\", \"authenticator\": {\"type\": \"BearerAuthenticator\", \"api_token\": \"{{ config['api_key'] }}\"}, \"request_options_provider\": {\"request_parameters\": {\"profile\": \"{{ config['profile'] }}\"}}}}}, \"transfers_stream\": {\"retriever\": {\"record_selector\": {\"extractor\": {\"field_pointer\": []}}, \"paginator\": {\"type\": \"NoPagination\"}, \"requester\": {\"url_base\": \"https://api.transferwise.com/v1/\", \"http_method\": \"GET\", \"authenticator\": {\"type\": \"BearerAuthenticator\", \"api_token\": \"{{ config['api_key'] }}\"}, \"request_options_provider\": {\"request_parameters\": {\"profile\": \"{{ config['profile'] }}\"}}}}, \"$options\": {\"name\": \"transfers\", \"primary_key\": \"id\", \"path\": \"transfers\"}, \"type\": \"DeclarativeStream\"}}, \"streams\": [{\"retriever\": {\"record_selector\": {\"extractor\": {\"field_pointer\": []}}, \"paginator\": {\"type\": \"NoPagination\"}, \"requester\": {\"url_base\": \"https://api.transferwise.com/v1/\", \"http_method\": \"GET\", \"authenticator\": {\"type\": \"BearerAuthenticator\", \"api_token\": \"{{ config['api_key'] }}\"}, \"request_options_provider\": {\"request_parameters\": {\"profile\": \"{{ config['profile'] }}\"}}}}, \"$options\": {\"name\": \"transfers\", \"primary_key\": \"id\", \"path\": \"transfers\"}, \"type\": \"DeclarativeStream\"}], \"check\": {\"stream_names\": [\"transfers\"]}, \"spec\": {\"documentation_url\": \"https://docs.airbyte.com/integrations/sources/wise-api-source\", \"connection_specification\": {\"title\": \"Wise Api Source Spec\", \"type\": \"object\", \"required\": [\"api_key\", \"profile\"], \"additionalProperties\": true, \"properties\": {\"api_key\": {\"type\": \"string\", \"description\": \"API Key\", \"airbyte_secret\": true}, \"profile\": {\"type\": \"integer\", \"description\": \"Account Profile ID, 6 digits\", \"airbyte_secret\": true}}}}, \"type\": \"DeclarativeSource\"}", "path_to_yaml": "wise_api_source.yaml", "source_name": "SourceWiseApiSource"}} {"type": "DEBUG", "message": "declarative source created from parsed YAML manifest", "data": {"parsed_config": "{\"version\": \"0.1.0\", \"definitions\": {\"selector\": {\"extractor\": {\"field_pointer\": []}}, \"requester\": {\"url_base\": \"https://api.transferwise.com/v1/\", \"http_method\": \"GET\", \"authenticator\": {\"type\": \"BearerAuthenticator\", \"api_token\": \"{{ config['api_key'] }}\"}, \"request_options_provider\": {\"request_parameters\": {\"profile\": \"{{ config['profile'] }}\"}}}, \"retriever\": {\"record_selector\": {\"extractor\": {\"field_pointer\": []}}, \"paginator\": {\"type\": \"NoPagination\"}, \"requester\": {\"url_base\": \"https://api.transferwise.com/v1/\", \"http_method\": \"GET\", \"authenticator\": {\"type\": \"BearerAuthenticator\", \"api_token\": \"{{ config['api_key'] }}\"}, \"request_options_provider\": {\"request_parameters\": {\"profile\": \"{{ config['profile'] }}\"}}}}, \"base_stream\": {\"retriever\": {\"record_selector\": {\"extractor\": {\"field_pointer\": []}}, \"paginator\": {\"type\": \"NoPagination\"}, \"requester\": {\"url_base\": \"https://api.transferwise.com/v1/\", \"http_method\": \"GET\", \"authenticator\": {\"type\": \"BearerAuthenticator\", \"api_token\": \"{{ config['api_key'] }}\"}, \"request_options_provider\": {\"request_parameters\": {\"profile\": \"{{ config['profile'] }}\"}}}}}, \"transfers_stream\": {\"retriever\": {\"record_selector\": {\"extractor\": {\"field_pointer\": []}}, \"paginator\": {\"type\": \"NoPagination\"}, \"requester\": {\"url_base\": \"https://api.transferwise.com/v1/\", \"http_method\": \"GET\", \"authenticator\": {\"type\": \"BearerAuthenticator\", \"api_token\": \"{{ config['api_key'] }}\"}, \"request_options_provider\": {\"request_parameters\": {\"profile\": \"{{ config['profile'] }}\"}}}}, \"$options\": {\"name\": \"transfers\", \"primary_key\": \"id\", \"path\": \"transfers\"}, \"type\": \"DeclarativeStream\"}}, \"streams\": [{\"retriever\": {\"record_selector\": {\"extractor\": {\"field_pointer\": []}}, \"paginator\": {\"type\": \"NoPagination\"}, \"requester\": {\"url_base\": \"https://api.transferwise.com/v1/\", \"http_method\": \"GET\", \"authenticator\": {\"type\": \"BearerAuthenticator\", \"api_token\": \"{{ config['api_key'] }}\"}, \"request_options_provider\": {\"request_parameters\": {\"profile\": \"{{ config['profile'] }}\"}}}}, \"$options\": {\"name\": \"transfers\", \"primary_key\": \"id\", \"path\": \"transfers\"}, \"type\": \"DeclarativeStream\"}], \"check\": {\"stream_names\": [\"transfers\"], \"type\": \"CheckStream\"}, \"spec\": {\"documentation_url\": \"https://docs.airbyte.com/integrations/sources/wise-api-source\", \"connection_specification\": {\"title\": \"Wise Api Source Spec\", \"type\": \"object\", \"required\": [\"api_key\", \"profile\"], \"additionalProperties\": true, \"properties\": {\"api_key\": {\"type\": \"string\", \"description\": \"API Key\", \"airbyte_secret\": true}, \"profile\": {\"type\": \"integer\", \"description\": \"Account Profile ID, 6 digits\", \"airbyte_secret\": true}}}, \"type\": \"Spec\"}, \"type\": \"DeclarativeSource\"}", "path_to_yaml": "wise_api_source.yaml", "source_name": "SourceWiseApiSource"}} {"type": "DEBUG", "message": "Making outbound API request", "data": {"request_body": "None", "url": "https://api.transferwise.com/v1/transfers?profile=****", "headers": "{'User-Agent': 'python-requests/2.28.1', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Authorization': 'Bearer ****'}"}} {"type": "DEBUG", "message": "Receiving response", "data": {"body": "[]", "status": "200", "headers": "{'Date': 'Tue, 20 Dec 2022 074138 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'x-request-id': '57be4073-1767-916a-8a31-a5924504b672', 'x-trace-id': '9246c4a68039b7b7', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'cache-control': 'no-cache, no-store, max-age=0, must-revalidate', 'pragma': 'no-cache', 'expires': '0', 'x-frame-options': 'DENY', 'content-encoding': 'gzip', 'x-envoy-upstream-service-time': '45', 'x-envoy-attempt-count': '1', 'vary': 'origin,access-control-request-method,access-control-request-headers,accept-encoding', 'CF-Cache-Status': 'DYNAMIC', 'Set-Cookie': '__cf_bm=wNp8zNkV4lcnbJWVsdzgmV5sS4LzIDJ5YptpQyYCiGs-1671522098-0-Ae5r/Q5x8nXG8N/BPKtATOfbI1R+PE8ue4BPEhxuu3eFfou/r+1jf78OkEg4D0Yftj9BS3AwLynMAAVHmvKGWkypWv34wIiPTe/BUpUO9WHt; path=/; expires=Tue, 20-Dec-22 081138 GMT; domain=.transferwise.com; HttpOnly; Secure; SameSite=None', 'Strict-Transport-Security': 'max-age=31536000', 'Server': 'cloudflare', 'CF-RAY': '77c6bc991ed27d98-TLV', 'alt-svc': 'h3=\":443\"; ma=86400, h3-29=\":443\"; ma=86400'}"}} {"type": "LOG", "log": {"level": "INFO", "message": "Check succeeded"}} {"type": "CONNECTION_STATUS", "connectionStatus": {"status": "SUCCEEDED"}}
Does it means it succeeded?
s
yes!
did you change anything?
l
no. just added the debug as you said. But if I omit it it fails again
s
Can you share your full yaml?
l
version: "0.1.0" definitions: selector: extractor: field_pointer: [] requester: url_base: "https://api.transferwise.com/v1/" http_method: "GET" authenticator: type: BearerAuthenticator api_token: "{{ config['api_key'] }}" request_options_provider: request_parameters: profile: "{{ config['profile'] }}" retriever: record_selector: $ref: "*ref(definitions.selector)" paginator: type: NoPagination requester: $ref: "*ref(definitions.requester)" base_stream: retriever: $ref: "*ref(definitions.retriever)" transfers_stream: $ref: "*ref(definitions.base_stream)" $options: name: "transfers" primary_key: "id" path: "transfers" streams: - "*ref(definitions.transfers_stream)" check: stream_names: - "transfers" spec: documentation_url: https://docs.airbyte.com/integrations/sources/wise-api-source connection_specification: title: Wise Api Source Spec type: object required: - api_key - profile additionalProperties: true properties: # 'TODO: This schema defines the configuration required for the source. This usually involves metadata such as database and/or authentication information.': api_key: type: string description: API Key airbyte_secret: true profile: type: integer description: Account Profile ID, 6 digits airbyte_secret: true
a
it looks like no records are produced because the body of the response is empty ("body": "[]"). The check operation fails if the stream produces no records. Are you expecting any data? The fact that the check operation behaves differently in debug mode (and succeeds) is a bug we'll fix.
l
Hi, I should see records with another api key. I'll update if it works. Thanks
👍 1
Hi @Alexandre Girard (Airbyte), you were right! With the new api key it worked. It´s a WISE API bug, that only with the manager account it sends data
🙌 1
🐛 1