API parsing

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
Kirill
Posts: 2
Joined: Fri Jan 03, 2020 7:08 pm

API parsing

Post by Kirill »

Hello! I can’t make parsing json work, I’m trying for the second day and no way.

Code: Select all

angular
    .module('app.widgets')
    .controller('ZoneminderController', function ($http, $scope) {

        var url = 'http://192.168.1.8/zm/api/events.json?auth=781baeb20af76a298882abcf631b16c3';
        
        $scope.data = [];

        function loadData() {
            $http.get(url)
                .then(function (response) {
                    $scope.data = response;
                })
                .catch(function(error) {
                    $scope.error = error;
                });
        }
        loadData();
    });
    
this code reads from another site does not output anything from zm
no error, empty output, please tell me how to do it right?

Code: Select all

http://192.168.1.8/zm/api/host/getVersion.json
{
    "version": "1.32.3",
    "apiversion": "1.0"
}
Post Reply