7 Replies Latest reply on Nov 24, 2017 8:48 AM by carlesc RSS
    rdave Newbie

    How to automate Export in Thingworx

    We want to automate Export to ThingworxStorage for particular table. How to do this. Any idea.


    Please suggest.

      • Re: How to automate Export in Thingworx
        carlesc Heavyweight Champ

        Hi,

         

        We do export a set of DataTables (We tag with a specific tag the DataTables that we want to export) through calling the API directly from Server Side Javascript, that's our code:

         

        var APIKey = ApplicationKeys["AppKeyNameWithTheRights"].GetKeyID();
        var exportURL = "YourServerURL"+"/Thingworx/DataExporter/?Accept=application/octet-stream&searchTags="+"TagForTableNamesToExport"+"&repositoryName="+"RespositoryNameWhereToStoreData"+"&path="+"PathOnFileRepository+"="+APIKey+"&_="+Math.random()
        
        
        var result = Resources["ContentLoaderFunctions"].GetText({
        proxyScheme: undefined /* STRING */,
        headers: undefined /* JSON */,
        ignoreSSLErrors: undefined /* BOOLEAN */,
        useNTLM: undefined /* BOOLEAN */,
        workstation: undefined /* STRING */,
        useProxy: undefined /* BOOLEAN */,
        withCookies: undefined /* BOOLEAN */,
        proxyHost: undefined /* STRING */,
        url: exportURL,
        timeout: undefined /* NUMBER */,
        proxyPort: undefined /* INTEGER */,
        password: undefined /* STRING */,
        domain: undefined /* STRING */,
        username: undefined /* STRING */
        });