I’m integrating an accounting software called Yuki...
# ask-ai
a
I’m integrating an accounting software called Yuki which is an XML API. I’m having troubles with integrating with the API using the Connector Builder. I managed to extract data of an endpoint (transactions) but the problem is that the authentication flow was hardcoded. What needs to happen is the following: • Get the
AuthenticateResult
by sending the API key in XML body, like so: <soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:they=“http://www.theyukicompany.com/”> soapenv:Header/ soapenv:Body they:Authenticate <!--Optional:--> they:accessKey{{API_KEY}}/they:accessKey /they:Authenticate /soapenv:Body /soapenv:Envelope • As a response you get an XML containing the
AuthenticateResult
which stays valid for 24h ?xml version=“1.0” encoding=“utf-8"? <soap:Envelope xmlns:soap=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=“http://www.w3.org/2001/XMLSchema”> soap:Body <AuthenticateResponse xmlns=“http://www.theyukicompany.com/”> AuthenticateResult{RESULT}/AuthenticateResult /AuthenticateResponse /soap:Body /soap:Envelope • This
AuthenticateResult
will be used to make API calls by putting it in the body like so: <soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:they=“http://www.theyukicompany.com/”> soapenv:Header/ soapenv:Body they:GetTransactions <!--Optional:--> they:sessionID{{AuthenticateResult}}/they:sessionID <!--Optional:--> they:administrationID{{AdministratieID}}/they:administrationID <!--Optional:--> they:glAccountCode/they:glAccountCode they:startDate2010-10-25/they:startDate they:endDate2024-10-25/they:endDate <!--Optional:--> they:financialMode0/they:financialMode <!--Optional:--> they:dataGroupsdocumentprocessed,document,documentmatching/they:dataGroups <!--Optional:--> /they:GetTransactions /soapenv:Body /soapenv:Envelope So my question is really, how do I manage this kind of authentication? This is my current YAML configuration: version: 5.14.0 type: DeclarativeSource check: type: CheckStream stream_names: - transactions definitions: streams: transactions: type: DeclarativeStream name: transactions retriever: type: SimpleRetriever requester: $ref: “#/definitions/base_requester” path: /AccountingInfo.asmx http_method: POST request_headers: Content-Type: text/xml request_body_data: >- <soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:they=“http://www.theyukicompany.com/”> soapenv:Header/ soapenv:Body they:GetTransactions <!-- Use the AuthenticateResult from the authenticate stream --> they:sessionID{{ authenticateresult }}/they:sessionID they:administrationID{{ config[‘administratieid’] }}/they:administrationID they:glAccountCode/they:glAccountCode they:startDate2010-10-25/they:startDate they:endDate2024-10-25/they:endDate they:financialMode0/they:financialMode they:dataGroupsdocumentprocessed,document,documentmatching/they:dataGroups /they:GetTransactions /soapenv:Body /soapenv:Envelope record_selector: type: RecordSelector extractor: type: DpathExtractor field_path: - soap:Envelope - soap:Body - GetTransactionsResponse - GetTransactionsResult - Transaction partition_router: type: SubstreamPartitionRouter parent_stream_configs: - type: ParentStreamConfig parent_key: AuthenticateResult partition_field: authenticateresult stream: $ref: “#/definitions/streams/authenticate” decoder: type: XmlDecoder schema_loader: type: InlineSchemaLoader schema: $ref: “#/schemas/transactions” authenticate: type: DeclarativeStream name: authenticate primary_key: - AuthenticateResult retriever: type: SimpleRetriever requester: $ref: “#/definitions/base_requester” path: /Sales.asmx http_method: POST request_headers: Content-Type: text/xml request_body_data: >- <soapenv:Envelope xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/” xmlns:they=“http://www.theyukicompany.com/”> soapenv:Header/ soapenv:Body they:Authenticate <!-- Provide your access key here --> they:accessKey{{ config[‘api_key’] }}/they:accessKey /they:Authenticate /soapenv:Body /soapenv:Envelope record_selector: type: RecordSelector extractor: type: DpathExtractor field_path: - soap:Envelope - soap:Body - AuthenticateResponse schema_normalization: Default decoder: type: XmlDecoder schema_loader: type: InlineSchemaLoader schema: $ref: “#/schemas/authenticate” base_requester: type: HttpRequester url_base: https://api.yukiworks.be/ws streams: - $ref: “#/definitions/streams/transactions” - $ref: “#/definitions/streams/authenticate” spec: type: Spec connection_specification: type: object $schema: http://json-schema.org/draft-07/schema# required: - api_key properties: api_key: type: string order: 0 title: API_KEY airbyte_secret: true additionalProperties: true metadata: autoImportSchema: transactions: false authenticate: true testedStreams: transactions: hasRecords: false streamHash: 8e493dd710dd2baa392c7e00f3f2fdd2bb9892ff hasResponse: false primaryKeysAreUnique: false primaryKeysArePresent: false responsesAreSuccessful: false authenticate: hasRecords: true streamHash: b834eb0d5ab12cc29aace601e0cf25ec580f3364 hasResponse: true primaryKeysAreUnique: true primaryKeysArePresent: true responsesAreSuccessful: true assist: docsUrl: https://documenter.getpostman.com/view/12207912/UVCBB51L schemas: transactions: type: object $schema: http://json-schema.org/schema# additionalProperties: true properties: description: type: - string - “null” amount: type: - string - “null” document: type: - object - “null” properties: type: type: - string - “null” “@id”: type: - string - “null” HID: type: - string - “null” created: type: - string - “null” folder: type: - string - “null” folderId: anyOf: - type: string - type: object properties: “@xsinil” type: string folderTab: type: - string - “null” folderTabId: anyOf: - type: string - type: object properties: “@xsinil” type: string modified: type: - string - “null” reference: type: - string - “null” typeDescription: type: - string - “null” uploadMethod: type: - string - “null” documentMatched: type: - object - “null” properties: matchDate: anyOf: - type: string - type: object properties: “@xsinil” type: string matchedBy: type: - string - “null” documentProcessed: type: - object - “null” properties: processedBy: type: - string - “null” processedDate: anyOf: - type: string - type: object properties: “@xsinil” type: string glAccountCode: type: - string - “null” hID: type: - string - “null” id: type: - string - “null” transactionDate: type: - string - “null” authenticate: type: object $schema: http://json-schema.org/schema# additionalProperties: true properties: “@xmlns”: type: - string - “null” AuthenticateResult: type: string required: - AuthenticateResult
u
I'm sorry, but the Connector Builder in Airbyte currently does not support XML APIs or custom authentication methods that involve multiple requests or sending API keys in the body of the request. The Connector Builder supports the following authentication methods: Basic HTTP, Bearer Token, API Key, OAuth, and Session Token. For the API Key method, the key can be injected in the header, request parameter, or request body, but it does not support sending the key in an XML body. For complex custom authentication schemes like the one you described, you would need to use the low-code CDK or Python CDK provided by Airbyte. These tools give you more flexibility in defining the authentication process and handling the data format. Here are the relevant links for more information: - [Authentication methods supported by Connector Builder](https://docs.airbyte.com/connector-development/connector-builder-ui/authentication#authentication-methods) - [Custom authentication methods](https://docs.airbyte.com/connector-development/connector-builder-ui/authentication#custom-authentication-methods) - [Low-code CDK](https://docs.airbyte.com/connector-development/config-based/low-code-cdk-overview) - [Python CDK](https://docs.airbyte.com/connector-development/cdk-python/)