Call internal API

Make any Orange Logic API call, including DataTable calls.

CallInternalAPI: function (_sURL, _fCallbackSuccess, _fCallBackFail)

Request parameter attributes

AttributeTypeDescriptionRequired
URLstringThis attribute must be one of the following:
  • An API call URL Example: /webapi/objectmanagement/share/getlink_4HZ_v1?Identifier=CTL531031&Format=TR1&StickToCurrentVersion=true&LogViews=true&CreateDownloadLink=true&ExpirationDate=2024-12-31T11%3A59%3A59&MaxWidth=1000&FileExtension=.png
  • An object with the following properties:
    • _oRequest.Url
    • _oRequest.Method
    • _oRequest.Data
    yes
    Example 1
    Utils.CallInternalAPI(
        '/webapi/objectmanagement/share/getlink_4HZ_v1?Identifier=CTL531031&Format=TR1&StickToCurrentVersion=true&LogViews=true&CreateDownloadLink=true&ExpirationDate=2024-12-31T11%3A59%3A59&MaxWidth=1000&FileExtension=.png',
        // Success callback
        function (oHttp) {
            const result = JSON.parse(oHttp.responseText);
            Log.Info('Executed successfully: ' + JSON.stringify(result));
        },
        // Failure callback
        function (oHttp) {
            const result = JSON.parse(oHttp.responseText);
            Log.Warn('Execution failed: ' + JSON.stringify(result));
        }
    );
    
    Example 2
    Utils.CallInternalAPI(
        {
            Url: `https://mangovations.com/webapi/objectmanagement/share/getlink_4HZ_v1`,
            Method: 'POST',
            Data:  {
                'Identifier': `CTL531031`,
                'Format': `TR1`,
                'StickToCurrentVersion': `true`,
                'LogViews': `true`,
                'CreateDownloadLink': `true`,
                'ExpirationDate': `2024-12-31T11%3A59%3A59`,
                'MaxWidth': `1000`,
                'FileExtension': `.png`,
            },
    {
                'Identifier': `ZZ13GMR`,
                'Format': `TR1`,
                'CreateDownloadLink': `false`,
                'LogViews': `true`,
                'ExpirationDate': `2028-12-31T23:59:59`,
                'MaxWidth': `2000`,
                'MaxHeight': `2000`,
                'FileExtension': `.jpeg`
            },
        },
        // Success callback function
        function (oHttp) {
            var oResult = JsonConvert.DeserializeObject(oHttp.responseText);
            Log.Info('Executed successfully: ' + oResult)
        },  
        // Failure callback function
        function (oHttp) {
            var oResult = JsonConvert.DeserializeObject(oHttp.responseText);
            Log.Warn('Execution failed: ' + oResult)
        }  
    );