Dismiss
Announcing Stack Overflow Documentation

We started with Q&A. Technical documentation is next, and we need your help.

Whether you're a beginner or an experienced developer, you can contribute.

Sign up and start helping → Learn more about Documentation →

I'm trying to get this API working https://lari.jumpstart.ge/en/api/v1/documentation/nbg_rates I've made a jsonp request and I loaded the data like so

var ngb_currencies = 'http://lari.jumpstart.ge/en/api/v1/nbg_currencies?callback=JSON_CALLBACK';
var ngb_rates =  'http://lari.jumpstart.ge/en/api/v1/nbg_rates?callback=JSON_CALLBACK';
$http.jsonp(ngb_currencies).success(function(currency) {
    $scope.results =   currency.results;
})
.error(function(data) {
    alert("ERROR");
 });

$http.jsonp(ngb_rates).success(function(data) {
    $scope.result =   data.result;
})
.error(function(data) {
    alert("ERROR");
}); 
})

(first one is api call to get currencies, second is to get rates for a certain currency) How do I make changes in the ngb_rates url so I get somegting like http://lari.jumpstart.ge/en/api/v1/nbg_rates?currency=USD,GBP so I load the rates for the other currencies?

share|improve this question

Not quite sure, if this helps you:

var ngb_currencies = 'http://lari.jumpstart.ge/en/api/v1/nbg_currencies?callback=JSON_CALLBACK';
var ngb_rates =  'http://lari.jumpstart.ge/en/api/v1/nbg_rates?callback=JSON_CALLBACK?currency=cur';
var cur = []; //Assume passing value GBP,USD in an array. 

$http.jsonp(ngb_currencies).success(function(currency) {
    cur = currency.results;
    getCurrency();
})
.error(function(data) {
    alert("ERROR");
});

function getCurrency() {
    $http.jsonp(ngb_rates).success(function(data) {
        $scope.result =   data.result;
    })
    .error(function(data) {
        alert("ERROR");
    });
}

Cheers

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.