Rails & YouTube webhooks: PubSubHubbub not POSTing to my callback url - ruby-on-rails

I'm want my app to be notified whenever a specific channel uploads a new video. Best guide I could find was YouTube's push notifications. Following their instructions, I setup a rails controller to handle the webhook and setup a subscription for the channel. Here is confirmation the subscription has been setup.
But no post is being sent when a new video is uploaded. Where's my mistake?

Related

Instagram Messenger API Registering Webhooks

I'm building an integration that manages Instagram Messenger chats on behalf of clients. In the past I've done an integration for Facebook Messenger.
I'm stuck on how to actually get the client Instagram subscribed to our Instagram Messaging webhook events.
The 'Setup webhooks' section on the Instagram Messaging docs just points to the general webhook setup for the messenger platform, which explains to use the /PAGE-ID/subscribed_apps endpoint specifying the fields (events) to subscribe to. I do this with the previous Facebook Messenger integration, but with Instagram I'm running into several problems.
First I tried to subscribe to the following fields messages, message_reactions, messaging_seen
An error response explains it's not possible to subscribe to messaging_seen.
Then I try with only messages, message_reactions and get the error pages_messaging permission is required which is not mentioned in the Instagram Messaging docs.
I'm only aware of these issues because I'm failing the App Review because the webhooks are not working for the reviewers. In testing my own Facebook Page / Instagram Business account it is working fine presumably because I own the Page/IG account I'm trying to connect. Because of that I've been able to record a complete video of the functionality, but the reviewer feedback keeps implying that they also need recreate that functionality themselves to pass it.
This thread suggests to use mocking, but I think that's for the creating the video rather than for the reviewers to use. I'm also not sure how you would mock something like the delete function without the webhooks anyway.
I haven't been able to find much information about this, so any pointers would be greatly appreciated

Send message to a Webhook when I post a video

I have a community group and want make it send a message when I post a video, and to do it I'm trying use webhook, is possible I make it works with youtube?

Receiving notifications of new posts on Twitter via a specific URL

I would like to access the messages in the Twitter via the API in real time. A cursory search showed that it is possible to periodically send API-request to Twitter. In general, this is possible. 15 requests in 15 minutes is enough.
But I'm wondering, are there other ways to get information faster?
For example, is it possible to subscribe to notifications and receive a request from Twitter at a certain address?
Are you asking if Twitter has webhooks? The answer is yes
Review Securing Webhooks documention taking special note of the
Challenge Response Check (CRC) requirements.
Create a web app with an endpoint to use as your webhook to receive
events (e.g. https://example.com/webhook/twitter).
Make sure your webhook supports POST requests for incoming events and
GET requests for the CRC.
Register your webhook URL with your app using POST
account_activity/webhooks.
Use the returned webhook_id to add user subscriptions with POST
account_activity/webhooks/:webhook_id/subscriptions.

How to create a full-duplex communication between an API and a Rails app?

I have a video transcoding API and a CMS application which consumes it.
Workflow is as follows:
CMS sends a GET request to to the API to get a of list video files to transcode and it gets the answer in JSON format.
CMS user selects which file to be transcoded and clicks on the "Transcode" button.
As user click on the link, a POST request goes to API and API creates necessary Progresses internally and responds with initial status of the progresses in JSON format.
After creating Progresses at the API, I make GET ajax requests to API asking about the current process status periodically. Because it's a requirement for me to show user current status of the transcoding processes (like percentage..).
Additionally, I have some other resources that I should inform CMS about the current status.
At this time, I'm making an ajax call to API once in 5 seconds.
Here is the question:
Is this the best way to do it all?
Is there a way to create full-duplex communication between an API and a Rails app?
I tried pusher and push notifications but seems like they're only for front-end communication? Is this true?
I had heard about websocket but I couldn't find a good resource to fully understand it.
What is the approved way of Rails community to do what I ask for?
Thank you
To clarify: you need more than just server -> client communication because you need to inform the user/browser and also other components in the CMS about progress.
Note: not sure what technology the API is written in so I'll assume Ruby
Based on this Faye may be a very good solution. Both the web browser and the CMS server can be Faye clients and can subscribe to updates from the API. The API can publish updates to a channel appropriately named based on the video file that is being transcoded.
Browser <-> API Faye server communication will be over WebSocket or fallback transport.
CMS <-> API Faye server comms can be over the same transport types or they can use an Engine such as redis.
CMS sends a GET request to to the API to get a of list video files to transcode and it gets the answer in JSON format.
CMS user selects which file to be transcoded and clicks on the "Transcode" button.
As user click on the link, a POST request goes to API and API creates necessary Progresses internally and responds with initial status of the progresses in JSON format and the channel for progress updates.
After creating Progresses at the API, the client subscribes to the updates channel. As progress changes the API will publish the update progress to the channel and the client will receive the updates.
The CMS somehow needs to know the progress channel too. It could do this by having an channel that it always subscribes to. The API can then publish all transcoding information on that channel e.g. video-transcoding. When it sees a new transcoding has started it can subscribe to the channel for specific video transcoding updates.
It may be that bi-directional communication isn't 100% necessary. It seems like the API needs to push updates to the CMS and to the client. If that's the case EventSource/Server-Sent Events may be an option. And if you don't want the CMS to have a persistent connection to the API and would rather have updates pushed to it via HTTP you could add WebHook support to the API; on progression it makes an HTTP request to the CMS to inform it of progress.

API - Upload video in PHP to a specific Channel

We're planning on using the YouTube API Data V3 to allow users to upload videos to our channel via PHP. My question is, what are the correct steps in allowing the video to be uploaded on a server, to our Channel? I though that is where the Server or possibly Browser key would come into play?
Currently, I'm able to upload the video, but after the user signs in, it get's uploaded to their Channel. Do we need to store the access token generated by account that we want all the videos to be uploaded to?
You can actually save the refresh token once the account of your server signs in and reuse it in your code, rather than signing in a user every time.
You can do so by getting a refresh token from OAuth2 Playground and setting it in your youtube object.
Here it explains a little more.
And a step by step video.

Resources