I am currently working on a simple Java application to query my organization's G Suite users. I am using the Google-provided Java API (Directory API). I am currently able to pull users, and their corresponding attributes using statements like the following:
String firstName = user.getName().getGivenName();
String lastName = user.getName().getFamilyName();
String email = user.getPrimaryEmail();
However, I do not know how to access attributes such as Employee ID, Employee type, department and title? I do not see any functions similar to the ones that I use to access first name, last name etc.
How do you access these values using the Java API? Any help is greatly appreciated!
You can see the properties you're looking for in Users Reference. Employee ID is under externalIds:
externalIds string A list of external IDs for the user, such as an
employee or network ID.
Related
I want to publish my app but Google is telling me that the app name is against theirs Data Policy.
Based on the information you sent us, it looks like your project my-app-name doesn't show its identity to Google users when asking to access Google user data.
Specifically, there's a problem with your project's app name. This violates Google API Services: User Data Policy.
My name in Oauth contain word "YouTube"/ the project is related to YouTube.
So this is the problem? I can't use the word in my app name? So can I use something like u2b? What kind of names are allowed?
I can't find it in the TOS/data privacy.
Thanks!
my-app-name is not a valid name for your application.
You application name should clearly identifie your brand name as the company who created the application.
I would almost expect it to for example contain your domain name.
My could mean anyone again it needs to clearly identify your company or brand.
so no you can't name your app my-app-name and have it verified.
You also can't use any registered trademark names in your name unless you own the trademark
Stay away from anything remotely resembling a google product or potential google product
Our website is using DocCheck, an external authentication provider, to authenticate and identify contacts. We use the DocCheck ID, which comes as the request parameter "uniquekey", as contact identifier, so that the contact, when logging in on another device, can be re-identified. These users are then authenticated in Sitecore via a virtual user.
Tracker.Current.CurrentPage.Session.Identify(Page.Request.QueryString["uniquekey"]);
In addition to that, we're planning an own user management with registration, login etc. The users will be logged in via email address and password. The email address should now be used as another identifier to identify the contacts loggin in with these credentials.
The users should then be able to use both DocCheck and our own login for different parts of our website, so that we have DocCheck contacts and our own users.
Is it possible to combine these two identifiers to identify as one contact?
Thank you and kind regards
Torsten
At the moment you can only use a single value to identify a user within xDB. This is potentially going to change in the future however for now you can only use one.
xDB is just a mongo database so how about persisting an additional collection that contains the relationship between identifiers. An example would be:
CustomContact
- _id: the xDB identifier
- alternativeIdentifiers: [docCheckId, formsAuthId, etc] - if this is indexed the lookup will be quick
Then when you come to identify the user you lookup in your custom collection your identifier, find the actual xDB id and then identify with that.
To find the item in the array look at elemMatch or in:
https://docs.mongodb.org/manual/reference/operator/projection/elemMatch/
and some examples on
https://stackoverflow.com/a/18149149/1065332
I am creating an iPhone email client that displays sender's profile pictures in in the UITableViewCells in the inbox, much like Sparrow does. I am using the following FQL query to grab these images:
SELECT
pic_big
FROM
user
WHERE
uid IN (SELECT uid2 FROM friend WHERE uid1 = me())
AND
strpos(lower(name),'INSERT_FIRST_THREE_LETTERS_OF_FIRST_NAME_HERE') >= 0
AND
strpos(lower(name),'INSERT_LAST_NAME_HERE') >= 0
ORDER BY name
I get the names of the senders from the email headers, and then search the user's Facebook friends using the full last name and the first three letters of the first name to account for nicknames. This works pretty well on the whole.
Sparrow, however, is able to grab profile pictures from Facebook for users I am not even friends with. How is this possible? I though queries were limited to specific groups, like your friends. And that searches for email addresses were not valid? Is this correct? How does Sparrow grab these profile pics?
Well as long as you know the users Facebook ID - it's a long number but treat it as a string. You can use this url to get their profile picture:
https://graph.facebook.com/[id]/picture
No need for anything more complex.
You can get the user_id of any known user from their email by making an API call to:
/search?type=user&q=USER#EMAIL.NET
If their email is registered with Facebook and public, you'll get back a JSON object with their name and user id. You'll need to make a separate call (or use a batch request) to get their picture from their ID.
It's possible to access friend names in the Graph API. However, I want a method - either via the graph or App API to be able to search based on specific properties.
Eg: searching for all friends from London, UK.
Or searching all friends who enjoy photography.
Any places or API that may be able to assist with this?
You can search several of the properties querying the user table with FQL. For example, here is a query for all female frinds:
select uid, name, sex
from user
where uid in (SELECT uid2 FROM friend WHERE uid1 = me())
and sex="female"
The location is a complex object and I am not sure if it can be queried on like the other fields.
There are two webservices, which I've tried to use
page 5050 Contact Card
page 5055 Name Details
First service handles contacts and it's possible to set contact's name. However, in RTC there is a assist button in the Name field, so it's possible to fill in additional fields for name, such as
Salutation Code
Job Title
Initials
First Name
Middle Name
Surname
Language Code
All these fields are listed in page 5055 webservice, but I can't understand how should I add a new record and link it to existing contact.
One solution I've found is to create a new page on basis of respective table and select all needed fields, in this case, Contact_No. Afterward this page can be published as webservice.
Cons of this solution, is that you need to create a new page, which requires dev license.