Forum - Alma Api: Http get request using Angular.js

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #64753
    Mustafa Noor
    Participant

    angular.module(‘AlmaPreRegistrationApp’, [])
    .controller(‘AlmaPreRegistrationCtrl’, function ($scope, $http) {

    $scope.GetAlmaPreRegistration = function () {

    $http.get(“https://api-eu.hosted.exlibrisgroup.com/almaws/v1/users?apikey=somekey”).success(function (data) {

    alert(“OK”);

    }).error(function (data) {
    alert(“Bad”);

    });

    };

    $scope.GetAlmaPreRegistration();
    });

    Can any body tell whats wrong with this piece of code. http request is not successful it shows (Bad) alert in my aspx page. I can test the URL in Browser and can see the xml data.
    But it did not work in my aspx page?

    any idea how to fix?

    • This topic was modified 2 months, 1 week ago by Mustafa Noor.
    • This topic was modified 2 months, 1 week ago by Mustafa Noor.
    • This topic was modified 2 months, 1 week ago by Mustafa Noor.
    #64758
    Ori Miller
    Keymaster

    Perhaps this will help: https://developers.exlibrisgroup.com/blog/calling-alma-rest-apis-from-angularjs/
    Ori
    Alma API Team

    • This reply was modified 2 months, 1 week ago by Ori Miller.
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.