Search code examples
javascriptapigoogle-contacts-apihttp-status-code-405

"NetworkError: 405 Method Not Allowed" on Google contact delete


I am trying to delete a Google Contact through javascript. As per v3 of Google Contacts api I have defined:

scope to https://www.google.com/m8/feeds

And authenticated user, and got the access_token. And as per the v3 documentation on this page, trying to delete a contact like this:

$.ajax({
url: 'https://www.google.com/m8/feeds/contacts/default/full/temp123info@gmail.com?access_token=ya29.AHES6ZQoqUgoYmDzXyo-WsSlKv1-_2D_HzmXuH-wBuTR3e1ADxO0VWM',
type: 'DELETE',
success: function(res)
{
    console.log(res);
},

error: function(error)
{
    console.log(error);
}
}); 

Getting this error:

   "NetworkError: 405 Method Not Allowed - https://www.google.com/m8/feeds/contacts/laiquedaudpota43@gmail.com/full/temp123info@gmail.com?access_token=ya29.AHES6ZQoqUgoYmDzXyo-WsSlKv1-_2D_HzmXuH-wBuTR3e1ADxO0VWM"

Any help would be appreciated. Thanks.


Solution

  • Please see my answer here .

    Make use of the google client api for javascript.