我有一个安装的应用程序,使用.NET和联系人应用程序接口。我正在尝试转换为People API。我在开始并找到一个演示如何在.NET库中使用People API的示例时遇到了问题。例如,Peoples API documentation下面列出的示例中没有.NET,那么在哪里可以找到People接口的.NET示例呢?
发布于 2021-06-08 03:12:49
从这个开始;)
获取名为Google.Apis.PeopleService.v1 https://github.com/googleapis/google-api-dotnet-client的nuget
另外,我相信你已经看过这个https://developers.google.com/people/v1/profiles了,它有一些.net示例。
你到底想要达到什么目的?我即将完成转换使用联系人API的应用程序到人的API使用公司的服务帐户。
ps。我不能复制answer hense answer中带有链接的整个命名空间。
编辑: 20210608
        Person person = new Person();
        person.EmailAddresses = new List<EmailAddress>();
        person.EmailAddresses.Add(new EmailAddress() { Type = "work", Value = "sample@domain.com" });
        person.Names = new List<Name>();
        person.Names.Add(new Name() { FamilyName = "Lname2", GivenName = "Fname" });
        // link to peopleService code can be found in the comments
        // it's basically initializing PeopleServiceService with service account credentials
        Person retVal = peopleService.People.CreateContact(person).Execute();https://stackoverflow.com/questions/67762193
复制相似问题