Youtube Api LiveChatMessages: insert - oauth

I'm trying to create a bot that moderates youtube channels, but your api doesn't allow you to use the apiKey to use this api resource.
What alternatives do I have? Is there any other solution to use this api resource without doing an oauth2? or is there any way to do oauth2 from the api without going through a browser to get a valid token and use the api?
Thanks

I'm trying to create a bot that moderates youtube channels, but your api doesn't allow you to use the apiKey to use this api resource.
Api keys are only useable for public data not private user data
Is there any other solution to use this api resource without doing an oauth2?
You need to use Oauth2 and request authorization of the owner of the data.
is there any way to do oauth2 from the api without going through a browser to get a valid token and use the api?
No the user will always need to open the consent screen in a browser window. this will return to you the access token you need to access private user data.

Related

Is it possible to post status updates to Twitter using Firebase?

does anyone know if the new Google's Firebase can post tweets to Twitter?
I checked Google's Firebase website and it mentions that users can authenticate using their services. Once this authentication and authorization is done, I should have the required keys to access Twitter's API.
However, I was wondering if the Google's Firebase (Android SDK), can post tweets using one of its classes or methods automatically (without having to send an independent REST request from the Android app).
There is no API in Firebase that posts to Twitter.
But you can get the access token when the user signs in and use that to post to twitter in your own code. For more info, see https://firebase.google.com/support/guides/firebase-web#get_the_access_token_numbered
According to
firebase.auth.TwitterAuthProvider one can store the access token and secret to access the twitter APIs. Though Get the access token there is an explicit warning of Twitter API not directly invokable! The authdata structure will return everything needed for the twitter API. And then you need to use Android OAuth2 to set the proper parameters with the different Twitter APIs.

How to get public facebook page's news feed contents without user authentication/access token?

I am working on the iOS app, which needs to fetch news feed from public FB page.
I don't want to show authentication dialog as it's a public page.
For e.g. candycrushsaga, cocacola
Does anyone know facebook graph api allows this without accesstoken or any other way?
Okay, figured it out. Graph APIs need auth token before making any calls to specific API. So first grab the access token via oAuth API and then make Graph API call with the access token.

Instagram public media API

Does Instagram API policy allows to use
https://instagram.com/{user-id}/media/
endpoint to fetch latests media from iOS app. We tried to use documented
api.instagram.com/v1/users/{user-id}/media/recent
but it requires access token. By investigating Instagram web app I discovered that it is using endpoint from first link for fetching user's data.
The Instagram web app is not using the link you provided, it is using:
GET https://instagram.com/{username}/
And in the response inside a script tag it sets Window._sharedData with all the data including the user's media:
window._sharedData.entry_data.UserProfile[0].userMedia
I am not sure about the policies, but you may fetch and extract this data without calling the API.
But, using the API would be easier and the preferred way. As you are going to fetch some public media, you can use a fixed client_id instead of an access_token to avoid authentication:
Some API only require the use of a client_id. A client_id simply
associates your server, script, or program with a specific
application. However, other requests require authentication -
specifically requests made on behalf of a user. Authenticated requests
require an access_token. These tokens are unique to a user and should
be stored securely. Access tokens may expire at any time in the
future.
The API call:
api.instagram.com/v1/users/{user-id}/media/recent/?client_id={client_id}
Instagram username is not a user-id. you can find user-id by link : http://jelled.com/instagram/lookup-user-id

Retrieving a youtube playlist without asking the user for login

is it possible to retrieve a public youtube playlist with the google-api-objectivec-client without asking the user to login in order to perform the OAuth 2.0 authentication?
I'm working on an app which should retrieve a playlist from youtube and play related videos, but I cannot and don't want to ask the user to login.
In the examples of google-api-objectivec-client (https://code.google.com/p/google-api-objectivec-client/source/browse/#svn%2Ftrunk%2FExamples%2FYouTubeSample) I'm not able to achieve it without OAuth 2.0 authentication.
Thanks,
DAN
Yes, you don't need OAuth2 login for that. You can simply do it by setting your API key instead.
It's a playlistItems->list request.
Here's demonstration in api explorer: https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.playlistItems.list?part=snippet&playlistId=PLjFEz-E0UPUxw3lFpnfV1dDA7OE7YIFRj&_h=2&
Instead of setting the authorizer of the service to OAuth2 login like in
youtubeservice.authorizer = [GTMOAuth2ViewControllerTouch
authForGoogleFromKeychain.....
set it's API key to your API key from cloud console in Public API access.
youtubeService.APIKey = xxxxxx

Vimeo Integration using DotNetOpenAuth

I am trying to use Vimeo services on a web application where users need to be able to upload and list/watch videos. I have created a Vimeo App and they have given an Access token and an Access token secret using which I can access my own account.
Could someone tell me how do I do that from .NET C#
Instantiate an OAuthConsumer from DotNetOpenAuth, passing in an InMemoryTokenManager which you can find from the samples. Add your access token and secret to that token manager. You will also need your consumer key and secret. Then use the OAuthConsumer instance to make authorized outbound calls.
Hint: You won't need to do any of the OAuth authorization flows, since you already have the access token.

Resources