The below code should work. But I keep getting “Unauthorized” when calling findByEmail. I checked my key many times and it is correct. Why am I getting this error? When testing in Postman using xml, my key does work.
string url = "https://api.infusionsoft.com/crm/xmlrpc/v1";
XmlRpcClientProtocol proxy = new XmlRpcClientProtocol();
proxy.Url = url;
string key = "KeapAK-7f19xxxxxxxxxxxxxx";
proxy.Headers["X-Keap-API-Key"] = key; // Ensure 'key' contains your actual API key
try
{
string email = "itest9@h.com";
iFace proxysignup = XmlRpcProxyGen.Create<iFace>();
XmlRpcStruct[] contacts = proxysignup.findByEmail(key, email, new[] { "Id", "FirstName", "LastName" });