The concept would work. I tried it and it returns data correctly. There perhaps are easier ways to pass the parameter to $http. I suspect something wrong with your api.php not reading the parameter correctly.

Email codedump link for Is it possible to pass parameter to $http factory that returns dataReturn?