Andres
10/21/2024, 7:41 AMAuthenticateResult
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:
- AuthenticateResultuser
10/21/2024, 7:41 AM