Search code examples
iosswiftgoogle-apigmailgmail-api

How to get suggested / autocomplete emails from gmail api?


I used this api - https://www.google.com/m8/feeds/contacts/{userEmail}/full But this api only get your friends in contacts. I want to get suggested mail for example like the SS in below.

Gmail screenshot

I will use in ios app.


Solution

  • gAuth.callAPI("https://www.google.com/m8/feeds/contacts/default/full?start-index=1&max-results=2500&alt=json", withHttpMethod: httpMethod_GET, postParameterValues: nil)

    max-results limit up to you.

    or

    var i=1;

    gAuth.callAPI("https://www.google.com/m8/feeds/contacts/default/full?start-index=\(i)&max-results=2500&alt=json", withHttpMethod: httpMethod_GET, postParameterValues: nil)

    every repeat you should add 25 to i -> i += 25;