I'm coding a app which needs to get a list of subscribed channels of the user.
So the user gets navigated to this page so I can get the authorization key:
Get Access key for my App "AboReminder"
Now I get the access key which I need for some api requests. But I am stuck on the issue that I dont have any glue how to get the subscription list.
I'm not able to understand the information on the google page: Google APi documentation
So my question how is a possible request for getting all subscriped channels of the user?
send an ajax request to the following URL after replacing the {{OAUTHKEY}} with the appropriate user authorization key
https://content.googleapis.com/youtube/v3/subscriptions?part=id,contentDetails,snippet&maxResults=10&mine=true&key={{OAUTHKEY}}
This should be a GET request and no request body required to set.
You can navigate to the next set of results using 'nextPageToken' in the response.
By default api can generate only 5 results. You can get upto 50 results by providing 'maxResults' query parameter.
As far as I know, there is no way to get all the list.
Related
Currently I am developing a Chrome-GMAIL extension which requires me to get the logged in user's first and last names. For experimentation, I have used the following goggle API (userinfo) and have successfully obtained the names I wanted:
https://www.googleapis.com/auth/userinfo.profile
However, using the userinfo APIs will cause a change in the OAuth2 scopes in my manifest. This change will in turn cause a permission-prompt to my existing users (if a domain wide delegation is not setup in place). Point being the idea of having more prompts in front of my user, or additional oauth scope is not really something I desire.
Currently our extensions use the following OAuth scopes and API :
Chrome's Identity API
Chrome's Storage API
GMAIL.modify
GMAIL.send
My question is, is it possible to get the first and last names using an API that is defined/allowed/provided for by any of the above scopes/permissions I listed? or is userinfo the only way to go?
Thank you very much.
Profile data like first name and last name is private data. You are corect that some Google apis give you access to some data that would normally require an extra scope. For email normally you would need to to request the email scope to get this back however the Gmail api does have an endpoint getprofile which will return the current users email address without you requesting the email scope.
However i am not aware of any apis that will give you access to the users first and last name without you requesting the profile or user.profile scope.
If you do decide to add the scope, I do recommend going though the people api rather then the userinfo endpoint as the data returned by the user info endpoint is not guaranteed to always return the name.
I'm working with Trestle which is real estate MLS service to get property data etc. I have followed their WebApi docs but I'm getting this error whenever I hit their api it looks like their server thinks that request is from some BOT. Even they recommend using Postman to test api:
Its been 3 days and still cant find any fix. Any help?
You do not seem to be following this documentation correctly.
https://docs-trestle.corelogic.com/GettingStarted/WebAPI
At the moment you are entering the token URL (https://api-prod.corelogic.com/trestle/oidc/connect/token) in the main Postman request URL field. The documentation states that you should use the Get New Access Token button on the Authorization tab of a request. You are entering the token URL in the main Postman request URL field.
This is a default flow for oAuth 2.0 requests in Postman.
https://learning.postman.com/docs/postman/sending-api-requests/authorization/#oauth-20
Example:
This could be your request to retrieve data:
https://api-prod.corelogic.com/trestle/odata/$metadata
On the Authorization tab you should select oAuth 2.0; select Get New Access Token and you will see a view which gives you the functionality you are looking for.
When successful, you will get a pop-up which you need to accept in order to use the API.
When i have put the url below to my browser adress bar i get a 'not found' text.
https://www.googleapis.com/geolocation/v1/geolocate?key=API_KEY
I have registered my app at console and get a api key for that application. I have even provide my credit card data at console and started my trial membership.
I am expecting that it returns me some json. But it doesn't. Why google is not recognize my api key and gives me not found page?
The URL https://www.googleapis.com/geolocation/v1/geolocate?key=API_KEY is for sending POST requests. Since you are navigating it directly in your browser, it won't return any result.
You need to send a POST request with Request body to get the desired result.
Please refer to the Documentation page for Geolocation requests to get more information on creating your Request.
I'm trying to use the Graph API to get the feed of multiple public groups then that of multiple users.
When it comes to the feed of groups, it works flawlessly, all I have to do is fetch the following :
graph.facebook.com/$group_id/feed?limit={feedLimit}&access_token={access_token}
My access token being comprised of: AppID|AppSecret
However when it comes to fetching the feed of a user (Whose confidentiality settings are set to public of course) all I get is an empty answer. I would've thought it impossible to get such info and stopped there but then I stumbled upon ApiGee. All I have to do then is authenticate as a user (facebook-Authenticated-user) and it works.
Here's an image of it: http://s9.postimg.org/ynq5tar9r/feed.jpg
My question is : "How is that possible? I've read all I could in the docs and I still can't understand how it works. And how can I remedy that?"
Thank you.
The token you are using is an App token (AppId|AppSecret). With the app token you can't really get users personal feeds. With ApiGee you authenticated to get a user token, which can be used to fetch posts on the authenticated user's feed.
Read more about Facebook's access tokens
I know the steps to authenticate user and getting the user info after performing this call:
GET https://www.box.com/api/1.0/rest?action=get_auth_token&api_key={your api key}&ticket={your ticket}
But what I'm really looking for is to get user info after performing certain operation such as upload new file, in particular the user quota:
<space_amount>1234567</space_amount>
<space_used>1234</space_used>
Is there any way to get the latest user quota without calling the 'get_auth_token' again? As I understand it, 'get_auth_token' will generate new auth_token which I'd like to avoid.
There isn't yet a fully equivalent method in the v2 API. but you can utilize the get_account_info method from the v1 API to retrieve this information.