How to add phone numbers etc to a UserEntry object?

18 views
Skip to first unread message

bitfinfo

unread,
Apr 13, 2012, 10:34:30 AM4/13/12
to gdata-java-client
Hi,
We are using the GDATA Java API to provision users into google. We are
using the UserEntry object. How can I add a user's phone numbers for
example to their account? I tried the below but it does not appear to
work.

mobile = new PhoneNumber();
mobile.setPrimary(false);
mobile.setRel("http://schemas.google.com/g/2005#mobile");
mobile.setLabel("Mobile number");
mobile.setPhoneNumber(user.getMobileNumber());
entry.addRepeatingExtension(mobile);


THEN on the the retrieve side: (nothing is ever in the returned List)
after a subsequent refetch of the created UserEntry

List<PhoneNumber> phones =
entry.getRepeatingExtension(PhoneNumber.class);
if (phones != null) {
for (PhoneNumber p : phones) {
if (p.getPrimary()) {
// do something with this primary #
} else {
// do something with this mobile #
}
}
}
Reply all
Reply to author
Forward
0 new messages