0

I am building a C# application and I wish to gather a list of user contacts (Email, First name, last name). Using a direct login I was able to pull all information regarding the contacts except the emails. Is there a way for me to retrieve all contacts and their respective emails?

public void GetContacts(iCloudContactSortOrder sortOrder = iCloudContactSortOrder.FirstName)
    {
        if (!IsConnected)
            throw notConnectedException;

        // Set sort order
        ContactsSortOrder = sortOrder;

        // Create client
        NetClient netClient = new NetClient(sessionCookies, ICLOUD_HOME_URL, ICLOUD_HOME_URL);

        // Post client context data to the servers.
        string strResult = netClient.GET(ContactsMeCardUrl);
        ContactsMeCard = Deserialize<iCloudContactsMeCard>(strResult);

        // get contacts list.
        strResult = netClient.GET(ContactsStartupUrl);
        lastContactsResponse = Deserialize<iCloudContactsContactsResponse>(strResult);
    }
user2227904
  • 679
  • 1
  • 8
  • 27

1 Answers1

0

Apparently the reason behind the lack of emails was that I haven't parsed the response correctly. There was a list inside the list of contacts pointing the emails.

user2227904
  • 679
  • 1
  • 8
  • 27