Hello: I am just getting started with the API and I am stuck. I am using the .NET helper library and am getting this error when trying to query a contact:
InfusionSoft.InfusionSoftException: ‘Server returned a fault exception: [2] [InvalidKey]Invalid Key’
Here is my code:
public bool Connect(string email)
{
const string application = “ab9999”;
const string apiKey = “aa9m7ya9wc9999999999999”;
var customer = new Customer(application, apiKey);
var client = customer.Connect();
ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
//Find contacts dotnet style
var contacts = client.ContactService.FindByEmail(email, p => p.Include(c => c.Id) <-- ERROR HERE
.Include(c => c.Email));
//Find contact vanilla api style
var contacts2 = client.ContactService.FindByEmail(email, new[] { "Id", "Email" });
return true;
}
Any ideas would be appreciated.
Regards,
Mark