I'm trying to retrieve Youtube channel ID and name using Youtube data API but I'm getting empty item. I have only the Youtube user email account. Is there away to get the channel details from the email only?
https://www.googleapis.com/youtube/v3/channels?part=snippet&key={YOUR_API_KEY}
There is no way to get the user channel ID from user email.
I have tried to use forUsername parameter but this works only for some users (legacy issue).
The only I have found is to use Google Signin for iOS implementation which allow you yo signin with your google account. In order to have that ability to get YouTube data it require additional scope configuration as follows:
let scope: NSString = "https://www.googleapis.com/auth/youtube.readonly"
let currentScopes: NSArray = GIDSignIn.sharedInstance().scopes
GIDSignIn.sharedInstance().scopes = currentScopes.arrayByAddingObject(scope)
Now, you can run the following YouTube data API with Access Token:
https://www.googleapis.com/youtube/v3/channels?part=id&mine=true&access_token={oauth_token}
The access token, you will get from user.authentication.accessToken
There is no way of retrieving YouTube channels via their associated e-mailaddress at this moment.
Related
I am using the Instagram API and I'm having some small roadblocks. I already got my Access Token working on the Graph API but the user_id I'm feeding it seems to not be working, I'm retrieving the ID from Otzberg using the app-linked Instagram account's username, but I'm not sure it's the right one.
Here's the query:
https://graph.facebook.com/ig_hashtag_search?user_id={USER_ID}&q={HASHTAG}&access_token={ACCESS_TOKEN}
Any advice?
You had get legacy instagram user id from Otzberg. This user id had work with old instagram API. When you call your endpoint with this user id you should get message : Param user_id is not a valid Instagram User ID .
For use ig_hashtag_search you should get permission for Instagram Public Content Access
You should use IG User#id with this endpoint. You can search user id from business-discovery(GET /{ig-user-id}/business_discovery).
P.S. new ig-user-id - usually it 17+/- numbers.
On a browser on which you are authenticated on the good account go the page : https://graph.instagram.com/me?fields=id,username&access_token=YOUR_ACCESS_TOKEN
On the document, I just found I can get displayName from
/drive
But no email
If I want to use this API, can I only through Microsoft Graph?
This is available using the Microsoft Graph API , if your app has requested User.Read permissions.
You can make a request to get the signed in user's email:
GET https://graph.microsoft.com/v1.0/me/mail
Or you can make a request to get a particular user's email, based on a user ID:
GET https://graph.microsoft.com/v1.0/users/{userId}/mail
You can also use the createdByUser and lastModifiedByUser navigation properties on an item to retrieve the email address for the user who created/modified the file.
To call Microsoft Graph, you need to use the AAD OAuth v2 authorization / token end point. It's different than what you would have been using for OneDrive personal previously, but documented here: https://dev.onedrive.com/auth/graph_oauth.htm
After authenticating with OAuth2 and get the access token, the next step is get Google API URL to user data.
The Facebook API URL to user data is basically https://graph.facebook.com/me/ or https://graph.facebook.com/{user-id}/ depending on the case.
On Google+ what is the URL?
I need to get data as the user name, profile photo ...
Thanks!
Use the new people.get() with userID=me. Make sure you have sufficient oauth scope to do so.
I want to get the public playlists of an other user, so not of the logged in user. I checked the v3 Javascript client library and it seems to me it can only retrieve the playlist of the current authenticated user. Is it true? Or am I missing something?
You will do it the same way you do the authorized user.
First you'll call channels->list with id or forUsername and get uploads playlist id.
Then with playlistItems->list with the playlistId, you'll get the list items.
Also, here's the javascript client library.
I've been storing the profile url for users that authenticate with Foursquare like this: foursquare_url = "http://foursquare.com/#{access_token.info.nickname}"
It seems that Foursquare stopped providing nickname in the access_token, so now I save the url like this: foursquare_url = access_token.extra.raw_info.canonicalUrl
The issue is that some users authenticated before I made the change, so they all have 'http://foursquare.com/' as a profile url. How can I loop over those users and store the correct url?
Thanks!
In order to make a request on a user's behalf, you need to use their access_token. If you don't have those stored in your database, you'll have to capture it the next time they authenticate your site and fetch the needed information via the foursquare API.