Use CiviMRF to call the api in another CiviCRM instance. This usefull to synchronize or compare contact information.
This extension is dependend on some libraries that are not included. Install them by running
composer install
in the extension directory.
You can use a remote call in the code as follows. First add
$core = new \Civi\Cmrf\Core();
$call = $core->createCall('default', 'Contact', 'get', ['id' => 1]);
$core->executeCall($call);
defaults
stands for the connection. Four connections are available.
test
means to use the remote test system.prod
is for the remote production system.local
translates to a local API calldefault
is configurable in the settings screen and can be switched betweenlocal
,test
, andremote
.
This gives you the option to use default
in your code and start with the local
option. If everything works you can set it to a remote instance.
Configure the remote connections at http(s)://<server>://civicrm/admin/setting/cmrf
. You can also access this
form from Administration Console. Search in the System Settings for Civi McRestFace