Fastest Web Hosting

delete gmail existing contact using php

0 votes
asked Jul 8 in PHP by vinod.kumar (540 points)

Hello ALL
Previously i was stuck with delete existing gmail contact using google php api so below is that code by which solve the issue of delete the gmail contact:

          $deurl ='https://www.google.com/m8/feeds/contacts/default/full/'.$deleteid;
	$headers = array(
	'If-Match: *',
	'If-None-Match: anything',
	'Gdata-version: 3.0',
	'Authorization: OAuth '.$accesstoken
	);
	$dech = curl_init();
	curl_setopt($dech, CURLOPT_URL,$deurl);
	curl_setopt($dech, CURLOPT_CUSTOMREQUEST, "DELETE");
	curl_setopt($dech, CURLOPT_HTTPHEADER, $headers);
	$result = curl_exec($dech);
	$httpCode = curl_getinfo($dech, CURLINFO_HTTP_CODE);
	curl_close($dech);

you can use CURL for delete the gmail code i am explaining above code:

$deleteid is gmail contact id that you receive when you fetch gmail contact from google
$accesstoken is google api token.
and set the delete method.

Please use above code and need any help any where please let me know

Your answer

Preview

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

Job Board

TechnicalSharp is a technical community of developers where they are sharing their knowledge and solutions and against it they are getting the score point which help them to make profile strong which is under eyes on MNC's
...