Skip to main content

httpApi

// basic setup
const CONNECTOR = window.env.connectorApi;
const url = window.location.href;
let protocoll = url.split("://");
const secure = protocoll && protocoll.length == 2 && protocoll[0].includes("s") ? 's' : '';

const BASE_URL_REST = `http${secure}://${CONNECTOR}`;
// http://192.168.5.3:1880/exportWO?assetId=65661401d2f923d89f5e81fd&before=2023-12-31T14:08:00.000Z&after=2023-12-01T14:08:00.000Z
const req = {
    action: "POST", // 'GET' | 'POST' | 'PUT' | 'DELETE';
    url: `${BASE_URL_REST}/api/data/connect`,
    headers: [],
    environment: {},
    resolve: resolveFunction,
    responseType: 'blob', // 'json' | 'text' | 'arraybuffer' | 'blob';
    body: {
        Configuration: {
            Route: 'exportWO',
            Authentication: true,
            AuthenticationType: 'JWT'
        },
        ApiConfig: { assetId: '65661401d2f923d89f5e81fd', before: '2023-12-31T14:08:00.000Z', after: '2023-12-01T14:08:00.000Z' }
    }
}