@Farrukh_Naseem, if you look at Marion code you will see what he has done.
If you are using the original XML-RPC Library with the SDK then that will need upgrading.
The Newer Version of the XML-RPC Library has support for Customisable Headers.
I posted a reply to Marion in which you can use that instead of modifying the library.
I made changes to the “methodCaller” function. Here is what I changed to work with the latest XML-RPC Library.
// * Original Way *
// $call = $this->xmlrpc_request($service, $callArray);
// array_unshift($call->params, $this->encKey);
/* Set up the call */
// 2023-06-05 - Fix to make it work for the PHP XML-RPC library v4.10.1 as "params" is not exposed anymore.
$call = $this->xmlrpc_request($service, array_merge([ $this->xmlrpc_encode($this->key) ], $callArray));
// Check the OAuth Token to see if it needs to be refreshed prior to the call.
$headers =
[
"Content-Type: text/xml",
"Accept-Charset: UTF-8,ISO-8859-1,US-ASCII",
"Expect:",
"X-Keap-API-Key: {$this->key}"
];
$this->client->setOption('extracurlopts', [ CURLOPT_HTTPHEADER => $headers ]);
My iSDK has been modified over the years, so it is not the same as the original one.