Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

Get Bad request when we remove contact #154

Open
shidhu40 opened this issue Apr 3, 2018 · 0 comments
Open

Get Bad request when we remove contact #154

shidhu40 opened this issue Apr 3, 2018 · 0 comments

Comments

@shidhu40
Copy link

shidhu40 commented Apr 3, 2018

I want to remove contact from contact list . I have used this code and it will respond me "Bad Request" message

Code:

$cc = new \Ctct\ConstantContact(WPYog_APIKEY);
$ca = new \Ctct\Services\ActivityService(WPYog_APIKEY);

$contact = $cc->contactService->getContacts(WPYog_ACCESS_TOKEN, array("email" => 'psudhir1220@gmali.com'))->results[0];	
try {
	$ca->addRemoveContactsFromListsActivity(
		WPYog_ACCESS_TOKEN, 
		array($contact->email_addresses[0]->email_address), 
		array($contact->lists[0]->id)//List Id from which you want the contact to be removed from
	);
	print_r($ca); exit;
	$returnContact = $cc->contactService->updateContact(WPYog_ACCESS_TOKEN, $contact);
} catch (Exception $e) {
	var_dump($e->getMessage());
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant