fleapower
fleapower

Reputation: 65

Deleting Contact using Google People API in Google Apps Script returns 404 error

I am beating my head against the wall. I can't figure out why I'm getting a 404 error with this:

function SpreadsheetToContactsTest(){
  var people = People.People.getBatchGet({
    resourceNames: 'people/c7926797448542240267',
    personFields: 'metadata'
  });
// Next line is generating the error.
    People.People.deleteContact({
      "resourceName": "people/c7926797448542240267"
    });
  }

Thanks!

Upvotes: 0

Views: 335

Answers (1)

Nikko J.
Nikko J.

Reputation: 5533

If you type People.People.deleteContact( in your script, it will show a dialog box that describe the parameter of the method you are trying to use:

Example:

deleteContact:

enter image description here

As described in the image above, deleteContact only requires the user to input a string.

To fix the issue in your code, just update the parameter

From:

People.People.deleteContact({
  "resourceName": "people/c7926797448542240267"
});

To:

People.People.deleteContact("people/c7926797448542240267")

Reference:

Upvotes: 1

Related Questions