You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Google People API互联网通话字段设置问题:无对应属性且创建不支持

How to Set the "Internet Call" Field via Google People API

Great question! I’ve dealt with this exact confusion before when working with the Google People API. The "Internet call" field you see in Google Contacts isn’t listed as a dedicated, named property in the API documentation, but it maps directly to the imClients resource in the API schema. Here’s how to work with it:

Key Mapping Explanation

Google Contacts groups all internet-based call/messaging accounts (like Skype, WhatsApp, Signal, or custom services) under the imClients array in the People API. Each entry in this array represents one internet call/IM account, with core properties:

  • type: A predefined enum value (like skype, hangouts, qq) or custom for services not on the predefined list.
  • value: The actual account ID/handle/number for the service.
  • (Optional) label: Required only when using type: "custom"; this sets the display name for the internet call service in Google Contacts.

Example: Creating a Contact with an Internet Call Field

Here’s a Python code snippet using the Google API client library to create a contact with a Skype account and a custom WhatsApp internet call entry:

from googleapiclient.discovery import build

# Assume you've already handled authentication and have valid credentials
people_service = build('people', 'v1', credentials=credentials)

# Define the contact body with internet call entries
contact_payload = {
    "names": [
        {
            "givenName": "Jerald",
            "familyName": "Lawrence"
        }
    ],
    "imClients": [
        # Predefined Skype entry
        {
            "type": "skype",
            "value": "jerald.lawrence.skype"
        },
        # Custom WhatsApp internet call entry
        {
            "type": "custom",
            "label": "WhatsApp",
            "value": "+12345678901"
        }
    ]
}

# Create the contact
created_contact = people_service.people().createContact(body=contact_payload).execute()
print(f"Success! Contact created with resource name: {created_contact['resourceName']}")

Updating an Existing Contact's Internet Call Field

If you need to add or modify this field for an existing contact, use the updateContact method and specify updatePersonFields=imClients to target only this field:

# Replace with your contact's resource name
contact_resource_name = "people/c123456789"

update_payload = {
    "imClients": [
        {
            "type": "custom",
            "label": "Signal",
            "value": "+0987654321"
        }
    ]
}

# Update the contact
updated_contact = people_service.people().updateContact(
    resourceName=contact_resource_name,
    body=update_payload,
    updatePersonFields="imClients"
).execute()

Notes

  • Predefined imClients types include common services like skype, hangouts, qq, and more—using these ensures consistent display in Google Contacts.
  • When using the custom type, the label you set will appear as the service name next to the internet call entry in Contacts, exactly matching the field you’re trying to populate.

内容的提问来源于stack exchange,提问作者Jerald Lawrence

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 03:53:15