mautic / mautic/api-library

API contact edit method is not working

Open
#254 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
205
Forks
129
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided Mautic API 3.0 contactApi->edit call against Mautic 3.3.3, using the two fields shown in the request. Inspect the contact edit path and determine why those fields are not updated. Done means the API persists both values and the behavior is covered by a regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.