Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API contact edit method is not working #254

Open
faisalsarfraz opened this issue Jun 23, 2021 · 2 comments
Open

API contact edit method is not working #254

faisalsarfraz opened this issue Jun 23, 2021 · 2 comments

Comments

@faisalsarfraz
Copy link

faisalsarfraz commented Jun 23, 2021

Something strange happening on Mautic version 3.3.3 and API version 3.0
Edit a contact method is not working. I have this

$data  = array(
                                'cancellation_date' =>date('Y-m-d'),
		               'acc_cancelled_flag' => 1
		);
		$initAuth = new ApiAuth();
		$auth = $initAuth->newAuth(mauticConnection(), 'BasicAuth');
		$timeout = 10;
		$auth->setCurlTimeout($timeout);
		$api = new MauticApi();
		$contactApi = $api->newApi("contacts", $auth, checkMauticUrl());
		/*Get User*/
		$contacts = $contactApi->getList("email:$email");
		//dd($contacts);
		if (!empty($contacts['contacts'])) {

			$user_id = array_key_first($contacts['contacts']);
			/*Update User Details*/
			$response = $contactApi->edit($user_id, $data, false);

		}

This is the method that I am using but its not udpating those two columns. Does somebody has solution?


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@kuzmany
Copy link
Member

kuzmany commented Jun 23, 2021

What is your $response?

@faisalsarfraz
Copy link
Author

faisalsarfraz commented Jun 23, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants