Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3638

How to receive & process data when I subscribe to youtube api v3 push notification?

$
0
0

According to this https://developers.google.com/youtube/v3/guides/push_notifications

I can subscribe to a youtube channel & receive push notification for any new video.

My callback server is a php script which interprets POST/GET data:

<?phpif (isset($_GET['hub_challenge'])) {  print $_GET['hub_challenge'];}else {  $xml=file_get_contents("php://input");  file_put_contents('endpoint.txt',$xml);}?>

But $xml is empty. In the docs it says:

The YouTube Data API (v3) supports push notifications via PubSubHubbub, a server-to-server publish/subscribe protocol for Web-accessible resources. Notifications are pushed out to subscribers via HTTP webhooks, which is much more efficient than polling-based solutions.

But it does not specify how does it send the data....whether in POST body or in somewhere else.

So How do I get the atom feed in my script?


EDIT: I should probably ask a new question for this...but anyway....I tried this channel (https://www.youtube.com/channel/UCATp8LNTjzjNlLxdArp0Myg); but when I try to subscribe it says "restricted topic" (I did not provide token as it is a public channel). Same for any other channel ID. Is something wrong with my callback server? I also tried runscope url as a callback server for testing. But it did not help.


Viewing all articles
Browse latest Browse all 3638

Trending Articles