I want to get my domain\'s user\'s profile information..I am using profile API for this..
Profile API gives only a few fields like (Family Name, Given Name,Email etc)..B
I got my all fields by Profile API.... Actually if any field is empty then Profile API doesn't give that field as an output..... So using Profile API, we can get a user's full information....
Code :
var username="user "
var base = 'https://www.google.com/m8/feeds/';
var fetchArgs = googleOAuth_('contacts', base);
fetchArgs.method='GET'
var url=base+'profiles/domain/'+domainName+'/full/'+username+'?v=3&alt=json'
var name=""
var occupation=""
var department=""
var email=""
var contactNumber_1=""
var contactNumber_2=""
var relation=""
var account=""
var office=""
var personal_account=""
var current_account=""
var language=""
var blog=""
var image=""
try{
var urlFetch = UrlFetchApp.fetch(url, fetchArgs)
var json=Utilities.jsonParse(urlFetch.getContentText())
var profileInfo = json.entry
try{
name=profileInfo.gd$name.gd$fullName.$t
}catch(err){}
try{
occupation=profileInfo.gContact$occupation.$t
}catch(err){}
try{
department=profileInfo.gd$organization[0].gd$orgDepartment.$t
}catch(err){}
try{
var emaillist=profileInfo.gd$email
for(var i=0;i
If any field is empty then that tag will not be found thats why all the fields are written in try - catch block...