Issues with retrieving profile image from Google Admin SDK/Directory API - google-directory-api

I am trying to retrieve a user's profile picture in Python using either the users.get method or the users.photos.get method from the Google Directory API. I have set up my service account with the proper scope, and I get a 200 response when calling both endpoints, and can view actual data for every field, but when trying to access the profile image, I get a generic silhouette image. The methods I have used to try and access the profile images are:
With the users.get method, I have tried making a get call on the thumbnailPhotoUrl field using AuthorizedHttp under google.auth.transport.urllib3 from the Python google-auth package. The AuthorizedHttp object is created using the google service account credentials.
With the users.photos.get method I have tried decoding the photoData field with web-safe base64.

Most likely their photo is only linked to their Gmail account profile, which is inaccessible via the Admin API. You need to upload their photo directly through the admin.google.com GUI. Then your request will return that photo.

Related

Add parameter in Firebase Dynamic Link created thru console

I have an Expo/React Native app and I'm trying to implement Firebase Dynamic Links so that I can connect two users. So, user A would provide a dynamic link to user B. If user B doesn't have the app already installed, the link would send the user to App Store or Google Play for it to be installed. Once the installation is completed, the app would open up and retrieve user A's ID. If user B already has the app installed, the dynamic link would simply open the app and retrieve user A's ID.
Here's my question: if I define a dynamic link through the Firebase console, can I add parameters to it in my app? In other words, simply use the dynamic link on the console and add user A's ID to it.
Or if I need to send parameters that will depend on the user, do I need to generate them through the REST API?
I'm currently trying the REST API but keep getting 401 error. I simply make a POST call with the following request object to the https://firebasedynamiclinks.googleapis.com/v1/shortLinks?key={MyWebAPIKey}. And here's my request object:
{
"dynamicLinkInfo": {
"domainUriPrefix": "https://dl.mydomain.com/link",
"link": "https://dl.mydomain.com/link?id=12345",
"androidInfo": {
"androidPackageName": "com.my-domain.myapp"
},
"iosInfo": {
"iosBundleId": "com.my-domain.myapp"
}
}
My https://dl.mydomain.com is hosted by Firebase and is used only for dynamic linking purposes and when I go to the Dynamic Links console, it shows
https://dl.mydomain.com/link as my URL prefix.
So, I'm trying to understand:
If I'll simply add a user ID as a parameter, can I use the dynamic link I create through the console or do I need to generate a dynamic link programmatically -- in my case through the REST API?
If I need to do it through the REST API, what am I doing wrong in my code?
PS: Interestingly, when I try the POST call to Shortlinks API using Postman, it actually works and gives me a shortlink. When I try the same thing in my Expo app, I get a 401 error.

Is it possible to upload file to web api by calling Register method in Accounts controller

I have to upload user photo while registering a new user.The data from WPF application must consume the register method and inserts user detail and photo.
The register method accepts RegisterBindingModel , and i passed the model
properties in body as raw with content-type application json.But i am not able to upload file.
I know ,for uploading file we use form-data and we can pass additional parametes
in form data along with the file.But I need to get the file in api Register action method.
I have searched many articles and found files are uploading to api using form data.But those api methods does not accepts any input parameter.

WSAPI - Can you get the User Profile Image?

It looks like the User object contains most of the information found on the user detail page within Rally (with the rest seeming to be on UserProfile). - However in Rally I can see the users "Profile Image", but I don't see a way of querying this using the API.
Is there a way to query the user profile image for each user (in particular for all users where the profile image has not been set)?
In WS API object model neither User nor UserProfile object has an attribute that points to the profile image.
You may however access it via a URL that follows this syntax:
https://rally1.rallydev.com/slm/profile/viewThumbnailImage.sp?tSize=150&uid=12345
Where 12345 is the OID of the user.
This is not officially supported.This URL endpoint may change without notice.

Why I access more information in Facebook web page than when I using Graph API (for a non-friend user)?

When I access a page using a web browser, I can see more information from a non-friend of me user than I can see if I try t get information usin Graph API.
For example:
Accessing the page http://www.facebook.com/profile.php?id=100001514767572 I can see, for example, the location where she is living (São Paulo).
But if I tried to get the information using Graph API, I could not see some information for the same user (https://graph.facebook.com/100001514767572?access_token=XXXX).
PS: I already selected all permission when I got access token.
Facebook doesn't want it to be too easy for developers to farm certain information.

Programmatically retrieve a list of a user's Facebook pages

Greetings,
Using the Facebook API, I have obtained an OAuth access token for a user. I can use it to retrieve information about the user and post to their wall, etc. I'm trying to figure out how to (or if there is a way to) programmatically get a list of pages a user owns (so that they can be presented in a drop-down list on a third-party site). I have been unable to find such a method in the Facebook API, but I'm hoping I've missed something.
Thanks!
Since this question was asked, Facebook has added a new connection on the "User" Graph API object: accounts.
The Facebook pages owned by the
current user. If the manage_pages
permission has been granted, this
connection also yields access_tokens
that can be used to query the Graph
API on behalf of the page. Graph API Reference: User