500 Internal Server Error when using contactGroups.members.modify to add label to new person with People API

huangapple 未分类评论44阅读模式
英文:

500 Internal Server Error when using contactGroups.members.modify to add label to new person with People API

问题

我正在创建一个新的联系人,并尝试在序列中添加一个新的标签,但我一直在收到这个错误。我做错了什么?

英文:

So I am creating a new contact and trying to add a new label to it on the sequence but I keep getting this error. What am I doing wrong?

        PeopleService peopleService = service.getPeopleService();

        Person new_person = new Person();

        List names = new ArrayList<>();
        names.add(new Name().setGivenName(name));
        new_person.setNames(names);

        Person created = peopleService.people().createContact(new_person).execute();
        String id = created.getResourceName();

        List people = new ArrayList<>();
        people.add(id);
        ModifyContactGroupMembersRequest request = new ModifyContactGroupMembersRequest().setResourceNamesToAdd(people);

        peopleService.contactGroups().members().modify("contactGroups/newsletter", request).execute();

huangapple
  • 本文由 发表于 2020年7月27日 11:56:56
  • 转载请务必保留本文链接:https://java.coder-hub.com/63108480.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定