API to get another user's info? - web-services

I went through the Pinterest's developer center and also found a thread from 2016 which mentions that getting another Pinterest user's info (pins, follower count, etc.) is not part of the API. Is that correct? Can someone please confirm.
I also found mentions of V3 Pinterest API, but can't find official documentation for it. How can I get access to the V3 API?

I don't see anything about v3 of the API on their documentation.
But as with most APIs like Pinterest's API, you can only get the user information for the currently authenticated user, not just random users. When they log in using OAuth, they will get a prompt for permission like this image:
So, if your user allows your app to have those permissions you should be able to access the user object which includes a counts property. According to the docs, the counts property includes: "The user’s stats, including how many Pins, follows, boards they have".

Related

Is there a way to use Google Photos API without requiring authentication through user prompt?

I have some previous experience with the youtube and youtube analytics api where there was an option to use https://developers.google.com/oauthplayground/ to essentially create an offline situation for your own user account api access. By creating the key in the developer console you could add that to a custom oAuth credentials. The user account you were logged into would then generate the access token and refresh token needed. I do not see Google Photos API listed as an option here. I would prefer not to create a website just to get a prompt once (myself).
Any help would be greatly appreciated.
If you are specifically after a token to make your own requests to the API, you can still use the OAuth 2.0 playground. You can enter your own scope in the tool under step 1, just below the list of scopes on the left side. (The text box is labelled "Input your own scopes".)
Here you can manually enter a scope that's listed on the "Authentication and authorization scopes" page in the Google Photos Library API developer documentation.
In step 2, you can access a refresh and access tokens and construct your own request in step 3. Note that you won't be able to List possible operations for this API.
Note that you can also specify your own OAuth client ID and client secret from your own Google developers project. You can find this under the "settings" icon on the right, under "Use your own OAuth credentials". Otherwise, tokens are automatically revoked by the playground after a certain amount of time.
However - If you just want to explore the API through the playground, you can use the version that's embedded in the reference documentation. You can find it on each page for a method, for example mediaItems.list. This version includes support for all API methods and makes it easy to construct correct API requests.

create page programmatically for a test user

Can I create via api pages for a test users?
This is what I did:
Given my app, I got the user's token from app dashboard test users and I tried to use it in the graph explorer (POST /user_id/accounts).
I've the error "(#10) Application does not have permission for this action".
These are the permission the app has been granted for: manage_pages, publish_pages, publish_actions
Do I miss some permission or it is not possible?
Luca
[Edited following Simon's advice and the response below:]
I've been looking into this all day and it seems the answer is a solid, "Nope."
According to the developer documentation on creating pages, the {user_id}/accounts endpoint only supports Reading, not Creating, Updating, or Deleting.
Although apparently if you apply for Standard API access, you can receive permissions to create pages. (Only available if your app is generating ad revenue.)
Googling, reading and trying, I figure out that we can create a page via api.
https://developers.facebook.com/docs/graph-api/reference/page/#Creating Applications with Standard API Access can create Pages through the API using the following paths: /{user_id}/accounts
So the answer to my question is yes, if your application has the Standard API Access, no matter if you are dealing with test users or not. Note that teh call is slow (about 5 sec.)
That's it.

Getting private posts from Google+ using APIs

I worked with facebook graph API.
With a Facebook application I was able to retrieve user information (e.g. posts, status update, and so on) using graph APIs. Of course, it can be possible only for users that accept to share their information with the application.
I'm going to do the same with Google+. First of all I want to say that I'm new in the google+ universe.
Reading Google+ documentation I'm aware about the possibility to fetch public posts using something described here:
https://developers.google.com/+/api/latest/activities/search?hl=en
Of course, here they talk only about "public activities".
Does exist on Google+ a similar mechanism to Facebook application that allows me to retrieve private posts from a user (after that he approves my application of course)?
This is not currently available.
You may wish to star (and thus follow) this issue to indicate you would like to see this as a feature and to track progress or responses from Google.

Find out if you can post to users wall

I'm currently toying with the Facebook Graph Api and have been able to get some interesting results, I would like to be able to post to one of my Facebook App users pages. They have authenticated the app and confirmed the ability for my app to be able to post on there wall. I know there is the can_post check using FQL, but I haven't seen any information on this using the Graph API. Is there a possible check to make so I can see if I have the ability to post on there wall?
can_post
https://developers.facebook.com/docs/reference/fql/user/
This settings is actually a setting of the timeline:
This setting only affects the viewers of the specific timeline and does not apply to the owner of the timeline.
can_post - bool - Whether or not the viewer can post to the user's Wall
Beyond this settings, by authenticating an application and giving it certain publishing permissions, the application, using it's per-user per-app access token will be able to perform actions on behalf the actual user. Actions will be attributed to the user even though it is the application that initiated and published these stories.
To answer what I assume is your underlying question - your application, given the appropriate permissions, will always be able able to publish a story to the users timeline. The act of giving an application any permissions is the same as allowing the application to act as you and access everything you would be able to access. This includes posting a story to your own timeline (even if no other user would be able to).

GAE Glass mirror creating multiple oauth signins per user

I've created a Glass app in Python. I began with the mirror quickstart for Python and have my app running fine except some users are getting multiple notifications. I only have one row per user in my Credentials table, however when I go and look at my own Authorized Access on my account I see that I have my Glass project listed 8 separate times.
Can anyone tell me how to check and see if the user has previously granted access to my app when they sign in and if so then skip creating a new token.
You can use the user's ID to prevent storing more than one credential for each user.
When you complete the OAuth flow, you'll receive an ID token along with the access and refresh tokens. If you decode this token, you'll see something like this:
{
"iss":"accounts.google.com",
"at_hash":"HK6E_P6Dh8Y93mRNtsDB1Q",
"email_verified":"true",
"sub":"10769150350006150715113082367",
"azp":"1234987819200.apps.googleusercontent.com",
"email":"jsmith#example.com",
"aud":"1234987819200.apps.googleusercontent.com",
"iat":1353601026,
"exp":1353604926
}
The sub key is the one you're interested in. Use this value to uniquely identify your user. If you see a user authenticate with a user ID that you already know, replace the old value.
If you update your question to include the code you're using for your OAuth flow, we can provide more specific advice. Or, you can learn more about this from Google's OAuth documentation.