Eschbach APIs allow to get the content of a List template and return them as a JSON object. This can be used by retrieve Eschbach data in other platforms, for instance Dataiku.

The script here below shows how to query a List template from Dataiku.

You must replace the parameters where the comment is #REPLACE WITH YOUR OWN:

The script shows a simple parsing of the API response in order to save it into a dataframe. You can of course change this part to adapt it to your need.


# -------------------------------------------------------------------------------- NOTEBOOK-CELL: CODE
# -*- coding: utf-8 -*-
import dataiku
import pandas as pd, numpy as np
from dataiku import pandasutils as pdu
import requests
import base64

# -------------------------------------------------------------------------------- NOTEBOOK-CELL: CODE
listTemplateName = 'letzte%2024%20Stunden' #REPLACE WITH YOUR OWN
itemGuid = '8f6b0e88-1a02-4743-9e17-41e9bc3d6d9a' #REPLACE WITH YOUR OWN
base_url = 'https://acew1las02.eua.solvay.com/shiftconnector-api/moduleApi/ShiftconnectorApi/Report/V1/List'
suffix = f'?listTemplateName={listTemplateName}&structureItemGuid={itemGuid}'
url = base_url + suffix

usr = ‘Service_Account_User_Name’ #REPLACE WITH YOUR OWN
pwd = ‘Service_Account_Password’ #REPLACE WITH YOUR OWN

#create b64 pass
userpass = usr + ':' + pwd
encoded_u = base64.b64encode(userpass.encode()).decode()

headers = {
  'Authorization' : "Basic %s" % encoded_u,
  'Content-Type': 'application/x-www-form-urlencoded'
}
print(url)

# -------------------------------------------------------------------------------- NOTEBOOK-CELL: CODE
response = requests.get(url,  headers=headers, verify=False)

# -------------------------------------------------------------------------------- NOTEBOOK-CELL: CODE
response_json = response.json()
keys = list(response_json.keys())
if len(keys) >0:
    print(list(response.json().keys())) #list of the response
    #select the last one which contains the array with data
    data_key = keys[-1]
    #retrieve array of data
    data = response_json[data_key]
df = pd.DataFrame.from_dict(data, orient='columns')
df

# -------------------------------------------------------------------------------- NOTEBOOK-CELL: CODE
# Write recipe outputs
list_template = dataiku.Dataset("list_template") #REPLACE WITH YOUR OWN DATASET
list_template.write_with_schema(df)