首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在哪里可以找到谷歌的People API的示例C# .NET代码?

在哪里可以找到谷歌的People API的示例C# .NET代码?
EN

Stack Overflow用户
提问于 2021-05-30 22:15:56
回答 1查看 287关注 0票数 1

我有一个安装的应用程序,使用.NET和联系人应用程序接口。我正在尝试转换为People API。我在开始并找到一个演示如何在.NET库中使用People API的示例时遇到了问题。例如,Peoples API documentation下面列出的示例中没有.NET,那么在哪里可以找到People接口的.NET示例呢?

EN

回答 1

Stack Overflow用户

发布于 2021-06-08 03:12:49

从这个开始;)

https://googleapis.dev/dotnet/Google.Apis.PeopleService.v1/latest/api/Google.Apis.PeopleService.v1.html

获取名为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

代码语言:javascript
复制
        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();
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67762193

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档