400 Error in People API [people.updateContact ]

400 Error in People API [people.updateContact]

I'm need updateContact field locations of user in g-suite

i get 400 error "Resource name "people/{xxxxxxx}" is not a valid contact person resource."

request

{
  "resourceName": "people/xxxxxxxxxxx",
  "etag": "xxxxxxxxxxxxxx",
  "locations": [
    {
      "metadata": {
        "primary": true,
        "source": {
          "type": "PROFILE",
          "id": "xxxxxxxxxxxxxxxx"
        }
      },
      "value": "TestA",
      "current": true
    },
    {
      "metadata": {
        "source": {
          "type": "PROFILE",
          "id": "xxxxxxxxxxxxxxxxx"
        }
      },
      "value": "TestB"
    }
  ]
}

response

{
  "error": {
    "code": 400,
    "message": "Resource name \"people/{xxxxxxx}\" is not a valid contact person resource.",
    "status": "INVALID_ARGUMENT"
  }
}

Upvotes: 1

Views: 558

Answers (1)

Rafa Guillermo
Rafa Guillermo

Reputation: 15357

Answer:

The error "Resource name \"people/{xxxxxxx}\" is not a valid contact person resource." appears because the resource name you are providing in your request is not a valid contact person resource.

Fix:

Replace people/{xxxxxxx} with a valid resource. You can obtain these using people.listDirectoryPeople endpoint.

Upvotes: 0

Related Questions