Using AngularJS to get data

Hi
I am trying to get data from the Rest API with AngularJS.

$http({
    method: 'GET',
    url: 'https://api.particle.io/v1/devices/events?access_token=<Hash from Web IDE>',
    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
})
.success(function(data, status, headers, config) {
  console.log(data);
})
.error(function(data, status, headers, config) {
    console.log(data);
});

The GET Request will created, but nothing returns :neutral_face:

Do you have an idea? Thanks in advance!

@Notes I am correct in assuming you created a web hook and thats what your pulling from? In any case when you go to the dashboard, (https://dashboard.particle.io/) and navigate to the logs section, do you see your data coming though there at least?
If yes, then your photon is publishing out to the web so there may be something wrong on the angular side, If it is not showing up there, then we will need to troubleshoot your code on the device.

Your events line has a status of 200 which means the call was successful. Also, looking at the Size and Time it took to pull down, I’d say you received something. What do you show in your console? You should have some information there.

Thanks for your answers.
@MobileRez I have created a simple AngularJS App containing app.js (see code above) and index.html. Does I need a web hook for this simple GET? If I open this URL (https://api.particle.io/v1/devices/events?access_token=) in the browser the output will be displaying.
I think the problem is that the Stream (from the cloud) has no end. The developer tools in the browser shows that the size and minutes increase.

@jasonhodges In the first post you can see the app.js file, which GETs the URL and if success I print the data in the console. But this stream has no end he will never go to success or error :disappointed:

@Notes yes, by setting up a web hook, it allows you to ‘get’ the data from your photon (particle.function would be similar to a ‘post’ to your photon device). Their may be other ways to make it work but i know that web hooks have always worked for me in this instance.

Let me know if you need help setting up a web hook or are still having issues and I will try to help you out further.

Assuming you just want to be able to read out your Particle.publish(), which doesn’t require webhooks, you should look into ‘angular eventsource’. If you Google on it a bit, you should be able to find some more info.
Server Sent Events are an HTML standard, so you’re likely to find more info about it outside this forum. Especially if you want to use it with angular.js, although there are a few folks that have made some things with angular.