Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8954781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:23:19+00:00 2026-06-15T14:23:19+00:00

I want to get my domain’s user’s profile information..I am using profile API for

  • 0

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)..But i also want to get these fields also:
occupation,department,Phone [Work], Phone [Mobile], Relation [Manager]…

i am not able to get these fields..So please give me suggestion to get these fields.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:23:20+00:00Added an answer on June 15, 2026 at 2:23 pm

    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<emaillist.length;i++){
              if(emaillist[i].rel.split("#")[1]=='work')
                email=profileInfo.gd$email[i].address
            }
          }catch(err){}
          try{
            var phonelist=profileInfo.gd$phoneNumber
            for(var i=0;i<phonelist.length;i++){
              if(phonelist[i].rel.split("#")[1]=='work')
                contactNumber_1=phonelist[i].$t
              else if(phonelist[i].rel.split("#")[1]=='mobile')
                contactNumber_2=phonelist[i].$t
            }
          }catch(err){}
          try{   
            relation=profileInfo.gContact$relation[0].$t+" ["+profileInfo.gContact$relation[0].rel+"]"
          }catch(err){}  
    
        }catch(err){}
    
    }
    
    
    /*
      Oauth Authentication
    */
    
    function googleOAuth_(name,scope) {
      var oAuthConfig = UrlFetchApp.addOAuthService(name);
      oAuthConfig.setRequestTokenUrl("https://www.google.com/accounts/OAuthGetRequestToken?scope="+scope);
      oAuthConfig.setAuthorizationUrl("https://www.google.com/accounts/OAuthAuthorizeToken");
      oAuthConfig.setAccessTokenUrl("https://www.google.com/accounts/OAuthGetAccessToken");
      oAuthConfig.setConsumerKey(consumerKey);
      oAuthConfig.setConsumerSecret(consumerSecret);
      return {oAuthServiceName:name, oAuthUseToken:"always"};
    }
    

    If any field is empty then that tag will not be found thats why all the fields are written in try – catch block…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have table user(id,name,address) and User domain class.i want to get only the name
I want to get domain name only using javascript. Ex vn.search.yahoo.com -> yahoo vn.search.yahoo.com.vn
I want to get user names in active directory by using sharepoint webpart. any
I want to get whois information of a domain name from my c#/java programs.
i want to get list of OU from Active Directory. i have only domain
i am using visual c++, I want to get a domain ip address from
i want to get all OU name using the domain name. But i cant
I would like to get ONLY the domain from the referrer urls. The referrer
I want to do a cross-domain GET ajax request using jQuery v1.8.3. Here is
I want to get a part of this url using php, what will be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.