var factory = new Soapi.RouteFactory("api.stackapps.com","mykey");
var route = factory.UsersById(14);
route.getResponse(function success(data){
alert(data.users[0]items[0].display_name); //code poet!
}, function failure(error){
alert(error.message);
});
Remember: the data
returned is the JavaScript object returned from the API method call. If you are in doubt as to what is being returned, simply look at the API help page for that route.
The one exception that I have made is to abstract the array property of all 'returns' types to items
. This enables more powerful application patterns.