1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Get All Contact List Of Gmail Account

Discussion in 'C#' started by zinist, Jul 2, 2015.

  1. #1
    Hello Friends,
    I am working on a module, where my job is I have to fetch all contact list of Gmail Account in Asp.net. I have tried the code, but it is not working it shows error "Execution of authentication request returned the unexpected result: 404."
    I have attached my code file.
    Please Help me in above.
     

    Attached Files:

    zinist, Jul 2, 2015 IP
  2. NLDev

    NLDev Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #2
    You should use Google's Gmail API. First off you need to implement a Server-Side Authorization
    Then you can get userdata (if allowed) with "getProfile"
    You can read about it here:
    
      
    https://developers.google.com/gmail/api/v1/reference/users/getProfile
    Code (markup):
    And here is how to do the Authorization:
    
      
    https://developers.google.com/gmail/api/auth/web-server
    Code (markup):
     
    NLDev, Nov 8, 2016 IP
  3. Naina S

    Naina S Active Member

    Messages:
    203
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    93
    #3
    To get all your Gmail contacts you have to first create a project in the Google Console. Now in you C# page you have to communicate with it. For this first you will have to authenticate a user (whose contacts your google project will fetch), authentication is done with OAUTH 2.0.
    Once authentication is done, you can implement Google Contacts API and fetch the contacts. See Google Contacts API code here.
     
    Naina S, Jan 18, 2017 IP