Google People API - is it possible to get custom fields?

I need to import google contacts into my application. For this I am trying to use the Google People API, but I have not found a way to get custom contact fields.

Can I get contact fields with the new Google People API? Should I use the old Google Contact API for this?

Thank!

+4
source share
1 answer

Request a custom projection using your personal fields.

String url = "https://people.googleapis.com/v1/people/me/connections" + "?personFields=names,emailAddresses,userDefined";

The answer is as follows:

"userDefined": [
        {
          "metadata": {
            "primary": true,
            "source": {
              "type": "CONTACT",
              "id": "5629e24b082d1a66"
            }
          },
          "key": "label1",
          "value": "foo"
        },
        {
          "metadata": {
            "source": {
              "type": "CONTACT",
              "id": "5629e24b082d1a66"
            }
          },
          "key": "label2",
          "value": "bar"
        }
      ]

See https://developers.google.com/people/api/rest/v1/people#Person.UserDefined for details

, updatePersonFields .

https://developers.google.com/people/api/rest/v1/people/updateContact

0

All Articles