javascript - unable to delete google contact from nodejs -


from offical google contact api docs:

deleting contacts

to delete contact, send authorized delete request contact's edit url.

the url of form:

https://www.google.com/m8/feeds/contacts/{useremail}/full/{contactid}

simple request delete returns 401 error response.

var url = "https://www.google.com/m8/feeds/contacts/"+req.token.body.sub.agent.agentid+"/full/"+result.googleid; unirest.delete(url)     .header({         'authorization': 'accesstoken='+req.token,         'if-match': '*',     })     .timeout(60000)     .end(function (res1) {         console.log('delete success... ', res1);         res.send(res1); }); 

note: tried 'authorization': 'bearer '+req.token, still same issue

fixed it. problem access token (req.token) sending. sending object instead of actual token string


Comments

Popular posts from this blog

qt - QML MouseArea onWheel event not working properly when inside QML Scrollview -

java - is not an enclosing class / new Intent Cannot Resolve Constructor -

python - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -