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:--> <theyaccessKey&gt;{{API KEY}}&lt;/theyaccessKey> </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:--> <theysessionID&gt;{{AuthenticateResult}}&lt;/theysessionID> <!--Optional:--> <theyadministrationID&gt;{{AdministratieID}}&lt;/theyadministrationID> <!--Optional:--> <theyglAccountCode&gt;&lt;/theyglAccountCode> <theystartDate&gt;2010 10 25&lt;/theystartDate> <theyendDate&gt;2024 10 25&lt;/theyendDate> <!--Optional:--> <theyfinancialMode&gt;0&lt;/theyfinancialMode> <!--Optional:--> <theydataGroups&gt;documentprocessed,document,documentmatching&lt;/theydataGroups> <!--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> <theyglAccountCode&gt;&lt;/theyglAccountCode> <theystartDate&gt;2010 10 25&lt;/theystartDate> <theyendDate&gt;2024 10 25&lt;/theyendDate> <theyfinancialMode&gt;0&lt;/theyfinancialMode> <theydataGroups&gt;documentprocessed,document,documentmatching&lt;/theydataGroups> </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
Sorry @Andres, I seem to be having a bit of trouble. Don't worry though, I've pinged my support folks and they will try to fix me up! 🧑‍💻 Perhaps try again in 5mins?