How do you get from Person to ContactEntry

半城伤御伤魂 提交于 2019-12-25 04:14:08

问题


As far as I know it is not possible (yet) to update photos linked to Person (People API), and it is advised to achieve this using the Contact API.

But how does one get from Person to ContactEntry?

I tried to concatenate Person's resourceName to "https://www.google.com/m8/feeds/contacts/default/full/" but I am getting "ResourceNotFoundException" errors.


回答1:


When you get a person with a contact in them, the person will look like:

{
  metadata: {
    sources: [
      {
        type: PROFILE,
        id: "12345678"
      },
      {
        type: CONTACT,
        id: "abc123"
      }
    ]
  }
}

You should find the metadata.sources field with type CONTACT, then you can use the id of that contact in the contacts API. GET https://www.google.com/m8/feeds/contacts/default/full/<id> should return the contact data.



来源:https://stackoverflow.com/questions/52805040/how-do-you-get-from-person-to-contactentry

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!