eventday / infusionsoft.net Goto Github PK
View Code? Open in Web Editor NEWA C# Wrapper around the Infusionsoft.com API
A C# Wrapper around the Infusionsoft.com API
How can I set the security protocol to use TLS 1.2 ?
Regards
Since this project has fallen behind in terms of technology and bug-fixes, I've created a new .net client named Infusio and just published a v1.0
to nuget.
It's a much more flexible, and easier to maintain, codebase that's generated from the official Infusionsoft API documentation.
Main benefits in my eyes are as follows:
RunWith
. Example.Log
is an InfusioOp
. Example.Operation(long? id = default)
) so you don't have to provide a value.Tasks to complete:
In the end, if you're still using this library and running into bugs, they most likely will not be fixed. At least not by EventDay. This codebase have proven to be really brittle in that bug-fixes often cause other problems in the library.
Give Infusio a try and create issues if you run into any problems or just want a feature.
Hi I hope you can help me with this.
I've added a Yes/No CustomField: "Imported" into Orders on Infusionsoft and have added _Imported into the the Job table entity. If I set the type as string and query like:
var vNewJobs = _client.DataService.Query<Job>(vPage, q => q.Add(x => x._Imported, "~null~"));
then I can get all the records that hasn't set a value to the field yet.
But once I try to query for data with value in the _Imported field I get the exception telling me the response is an integer where string is expected. So from this I'm guessing the Yes/No field is storing an int of 0 or 1 so if I change the _Imported field type to int and query like:
var vNewJobs = _client.DataService.Query<Job>(vPage, q => q.Add(x => x._Imported, 1));
I get the results I need.
The problem is what field type should I set the CustomField _Imported to if I wish to query for both null records and int records? I've tried the int? type with a null parameter but that didn't work.
Hope you can point me in the right direction,
many thanks!
Sid
Adding a company with a CompanyName results in this error:
Server returned a fault exception: [10] [NoFieldFound]No field found: Company.CompanyName
The correct field name is "Company", which is what is set as the XmlRpcMember for the CompanyName field in the Company class, but it doesn't seem to get passed as "Company" in the XmlRpc call.
Changing CompanyName field to Company results in a compile error (which I assume is why the field is CompanyName to begin with):
member names cannot be the same as their enclosing type
A workaround is to use
client.DataService.Add("Company", XmlRpcStruct)
I'm trying to send data to a custom field in InfusionSoft doing the following
Dim diCustom As IDictionary(Of String, Object) = New Dictionary(Of String, Object)
diCustom.Add("_PauseUntilDate", RadCalendar2.SelectedDate.ToShortDateString().ToString())
ISIntegration.InfusionActions.UpdateCustom(iISID, diCustom)
public static void UpdateCustom(int iISID, IDictionary<string, object> custDirectory)
{
var client = MakeInfusionSoftConnection();
client.ContactService.Update(iISID, setter => setter.Set(c => c.CustomFields, custDirectory));
}
But I get the following response
Server returned a fault exception: [11] [NoFields]No fields sent for update
This is due to TableFieldSetter.cs - HasAccess returning false on
if (attributes.Length != 1)
{
return false;
}
I'm sure it's me pushing the wrong data across but I was wondering if you could let me know how to push data to custom fields.
The SDK is not compatible with .NET Core.
How could we get this working?
Regards,
Daniel
Hi.
I am facing some dificulties in creating a new CustomField for ContactsService.
I am trying �this: DataServiceExtensions.AddCustomField(null,typeof(CustomFieldType.Type.Email), "_KiaiDayInviteEmail", 1);
But i'm getting errors... Am i doing something wrong ?
Regards.
Hi,
Is it possible to pull a list of invoice by ids? I am trying to create an in query:
var results = client.DataService.Query<InfusionSoft.Tables.Invoice>( page: new DataPage(1000, 0), queryBuilder: q => q.Add(c => c.Id, new List<int> { 1, 2, 3 }));
I receive an error that the method does not accept an array.
So when I run the untyped query:
var queryData = new XmlRpcStruct() { { "DateCreated", "2015-11-03%" } };
var cs = client.DataService.Query(
table: "Invoice",
limit: 1000,
page: 0,
queryData: queryData,
selectedFields: new[] { "AffiliateId", "ContactId", "CreditStatus", "DateCreated", "Description" }).ToList();
var results = client.DataService.Query<InfusionSoft.Tables.Invoice>(
page: new DataPage(1000, i),
queryBuilder: q => q.Add(c => c.DateCreated, startDate),
fieldSelection: z => z.Include(c=> c.AffiliateId)
.Include(c=> c.ContactId)
.Include(c=> c.CreditStatus)
.Include(c=> c.DateCreated)
.Include(c=> c.Description)
.Include(c=> c.Id)
.Include(c=> c.InvoiceTotal)
.Include(c=> c.InvoiceType)
.Include(c=> c.JobId)
.Include(c=> c.LeadAffiliateId)
.Include(c=> c.PayPlanStatus)
.Include(c=> c.PayStatus)
.Include(c=> c.ProductSold)
.Include(c=> c.PromoCode)
.Include(c=> c.RefundStatus)
.Include(c=> c.Synced)
.Include(c=> c.TotalDue)
.Include(c=> c.TotalPaid)
);
I get no results. Any ideas?
var ISContact = InfusionActions.GET_ContactByEmail("[email protected]", new[] {"_Status"});
foreach (var item in ISContact)
{
Console.WriteLine(item.CustomFields["_Status"]);
}
That in a nut shell will query contact table using the email and return _Status back. Now when I run it I can see in the response the customField but I can't select it. I'm I doing something daft?
The issues seems to be with the CookComputing.xmlrpcv2 library. It doesn't build. I tried removing the nuget package, and re-adding but it didn't help. Has anyone else run into this?
When making a call to the InvoiceService, ChargeInvoice method, the following exception is thrown:
"response contains implicit string value where integer expected [response : struct mapped to type ChargeInvoiceResult : member RefNum mapped to type Int32]"
The problem is being caused by the ChargeInvoiceResult class, RefNum property being an int and the API returning "None" for the RefNum which causes the exception since "None" cannot be converted to an int.
Error: response contains implicit string value where boolean expected [response : struct mapped to type ValidateCreditCardResult : member Valid mapped to type Boolean]
The simple fix is simply to convert
public bool Valid { get; set; }
to
public string Valid { get; set; }
But then we don't have type safety.
Thoughts?
Hi,
I am using Infusionsoft's OAuth2. In the current release, you are pointing to the old URL:
Infusionsoft/InfusionsoftProxy
private const string UriMask = "https://{0}.infusionsoft.com/api/xmlrpc";
Can you make a property that allows me to change the UriMask, if the user runs OAuth2? I have several clients running on the API keys and I do not wish to disrupt their sync.
In my code, I would like this:
public InfusionSoftProvider(string application, string apiKey, bool oAuth2)
{
if (String.IsNullOrEmpty(apiKey))
return;
this.application = application;
this.apiKey = apiKey;
var customer = new Customer(application, apiKey);
client = customer.Connect();
if(oAuth2)
client.UriMask = "https://api.infusionsoft.com/crm/xmlrpc/v1?access_token=TOKEN"
client.MethodListener = new ConsoleMethodListener();
ispMapper = new ISPMapper(client);
}
Hello,
I am new to infusionsoft. I am using Infusionsoft.net SDK for payment in my project. All methods like "VerifyCreditCard", "CreateBlankOrder", "AddOrderItem" etc. are working fine. When I call the "ChargeInvoice" method then following error is occurred.
"response contains implicit string value where integer expected [response : struct mapped to type ChargeInvoiceResult : member RefNum mapped to type Int32]".
I don't know why this error occurred because the response model used by this method is also present in dll. In this model the data type of "RefNum" field is int while expecting string. Is it issue? How can I fix it?
I am using infusionsoft.net 1.0.15
Please reply as soon as possible.
Thanks in advance.
Hi, I am trying to add customer using your wrapper, but I don't seem to be able to find a way to either create dynamically a new Tag / Group or to retreive existing Tag / Group.
Any help would be really appreciated !
Have a good one !
Sebastien
New to C#, the api, and all that, so forgive me if this is an error on my end, but I'm trying to learn this SDK as part of integration I'm doing.
var ents = client.DataService.Query<RecurringOrderWithContact>("Id");
Is throwing
{"Server returned a fault exception: [10] [NoFieldFound]No field found: RecurringOrderWithContact.HTMLSignature"}
I checked out the source against the table in the schema and the field doesn't exist, so I'm not sure if this was removed from the table and not updated here or not. Since the SDK is officially referenced by Infusionsoft, I would expect that all usages of the query would start being a problem, so I'm thinking it's something on my end. However, Infusion is currently being buggy with login and I cannot get onto the dev forums to post the issue.
Hi
I can't seem to find it but can someone point me to where I can tap into the Count methods please?
I see it in https://developer.infusionsoft.com/docs/xml-rpc/#data-count-a-data-table-s-records
But can't seem to find it here
Hope you can help
Many thanks!
Happening at this point in code:
var results = (XmlRpcStruct[])client.DataService.Query("Contact", 1000, 0, query, new[] { "Id", "Email", "Password", "Username" });
Forum thread here:
OrderService.PlaceOrder returns PlaceOrderResult. PlaceOrderResult.Successful is a string instead of a Boolean.
Hi there, when inserting the invoice description I pass in data thats correct and shows it as the same in the web interface.
Im having issues when pulling the invoice data back. The description is 'OneTime:'
My code is below.
It would be great to get this data back as the name of the order. i.e..
Order Information
Order Title: 'Order 123123'
var id = customer2.Id;
// returned only 2014-05 InvoiceItems
var queryData = new XmlRpcStruct() { { "ContactID", id } };
List L = new List();
var invoiceItems = client.DataService.Query(
table: "Invoice",
limit: 1000,
page: 0,
queryData: queryData,
selectedFields: new[]
{
"Id", "Description", "OrderTitle" //, "InvoiceAmt", "DateCreated", "Description", "Discount", "OrderItemId"//, "CustomFields"
})
.ToArray();
var customer = new Customer(application, apiKey);
var client = customer.Connect();
client.MethodListener = new ConsoleMethodListener();
int userId=1111;
int campaignId=35;
client.ContactService.AddToCampaign(userId, campaignId);
{"Server returned a fault exception: [6] [Loading]Error loading follow-up sequence"}
at InfusionSoft.ServiceBase`1.TryInvoke[T](Func`1 func) in c:\Users\Admin\Downloads\Infusionsoft.net-master\Infusionsoft.net-master\src\InfusionSoft\ServiceBase.cs:line 61
at InfusionSoft.ServiceBase`1.Invoke[T](Func`2 method) in c:\Users\Admin\Downloads\Infusionsoft.net-master\Infusionsoft.net-master\src\InfusionSoft\ServiceBase.cs:line 37
at InfusionSoft.ContactServiceWrapper.AddToCampaign(Int32 contactId, Int32 campaignId) in c:\Users\Admin\Downloads\Infusionsoft.net-master\Infusionsoft.net-master\src\InfusionSoft\Wrappers\ContactServiceWrapper.cs:line 45
at Sample.Program.Main() in c:\Users\Admin\Downloads\Infusionsoft.net-master\Infusionsoft.net-master\src\Sample\Program.cs:line 64
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
I am having trouble retrieving custom fields from the contact table.
I do not receive any error on this issue – I just do NOT receive the values for the custom fields that I am requesting.
If I add a normal property like FirstName into SelectedFields then do receive its value back.
I am using custom fields that I know are populated for the contact id in question, so I definitely should be receiving values back.
Here is my calling code for ContactService.Load:
public string RetrieveCustomFieldFromContact(int contactID, string customFieldName)
{
const string methodName = "RetrieveCustomFieldFromContact";
var fieldValue = string.Empty;
var customer = new Customer(Constants.InfusionSoftApplicationName, Constants.InfusionSoftAPIKey);
var proxy = customer.Connect();
try
{
if (!customFieldName.StartsWith(""))
{
customFieldName = "" + customFieldName;
}
string[] selectedFields = { customFieldName };
var response = proxy.ContactService.Load(contactID, selectedFields);
if (response.CustomFields.ContainsKey(customFieldName))
{
fieldValue = response.CustomFields[customFieldName].ToString();
}
}
catch (Exception ex)
{
_utility.Log(LoggingType.Error, string.Format("{0} - An error occurred {1}", methodName, ErrorHelper.GetExceptionDetails(ex)));
}
return fieldValue;
}
Could it? It just seems to be the XmlRpc dependency that isn't supported?
I've been driving myself crazy here. I can get the regular fields just fine. The code doesn't error out, so it does recognize the field name, but it comes back with nothing. Here's a sample of my code.
var contact = client.ContactService.Load(infusionsoftid, new string[] { "Email","Id","_CustomerNumber"},);
In this sample, Id and Email come back with values, but nothing for our custom field "_CustomerNumber". Is there something I'm missing or does this library simply not support custom fields?
Hi there, just letting you know the Funnel Service:
http://help.infusionsoft.com/api-docs/funnelservice
Doesn't appear to be available in Infustionsoft.Net - there may be others that aren't available - perhaps another scrape is needed and a new build?
These are missing from the SDK.
Affiliate Program Service - http://help.infusionsoft.com/api-docs/affiliateprogramservice
AffiliateService.getRedirectLinksForAffiliate - http://help.infusionsoft.com/api-docs/affiliateservice#getRedirectLinksForAffiliate
FunnelService - http://help.infusionsoft.com/api-docs/funnelservice
When I call this
var infusionsoftCreditCard = _infusionsoftClient.DataService
.Query<InfusionSoft.Tables.CCharge>();
I get this:
CookComputing.XmlRpc.XmlRpcTypeMismatchException was unhandled by user code
HResult=-2146232832
Message=response contains integer value where string expected [response : array mapped to type CCharge[] : element 0 : struct mapped to type CCharge : member MerchantId mapped to type String]
Source=Infusionsoft.Net
StackTrace:
at InfusionSoft.Serialization.XmlRpcDeserializer.CheckExpectedType(Type expectedType, Type actualType, MappingStack mappingStack) in d:\Infusionsoft.net\src\InfusionSoft\Support\Serialization\XmlRpcDeserializer.cs:line 672
at InfusionSoft.Serialization.XmlRpcDeserializer.MapInt(String value, Type valType, MappingStack mappingStack, MappingAction mappingAction, Type& mappedType) in d:\Infusionsoft.net\src\InfusionSoft\Support\Serialization\XmlRpcDeserializer.cs:line 214
at InfusionSoft.Serialization.XmlRpcDeserializer.MapValueNode(IEnumerator1 iter, Type valType, MappingStack mappingStack, MappingAction mappingAction) in d:\Infusionsoft.net\src\InfusionSoft\Support\Serialization\XmlRpcDeserializer.cs:line 87 at InfusionSoft.Serialization.XmlRpcDeserializer.<>c__DisplayClass22.<MapStruct>b__1f() in d:\Infusionsoft.net\src\InfusionSoft\Support\Serialization\XmlRpcDeserializer.cs:line 425 at InfusionSoft.Serialization.XmlRpcDeserializer.OnStack[T](String p, MappingStack mappingStack, Func
1 func) in d:\Infusionsoft.net\src\InfusionSoft\Support\Serialization\XmlRpcDeserializer.cs:line 683
at InfusionSoft.Serialization.XmlRpcDeserializer.MapStruct(IEnumerator1 iter, Type valueType, MappingStack mappingStack, MappingAction mappingAction, Type& mappedType) in d:\Infusionsoft.net\src\InfusionSoft\Support\Serialization\XmlRpcDeserializer.cs:line 423 at InfusionSoft.Serialization.XmlRpcDeserializer.MapValueNode(IEnumerator
1 iter, Type valType, MappingStack mappingStack, MappingAction mappingAction) in d:\Infusionsoft.net\src\InfusionSoft\Support\Serialization\XmlRpcDeserializer.cs:line 75
at InfusionSoft.Serialization.XmlRpcDeserializer.MapArray(IEnumerator1 iter, Type valType, MappingStack mappingStack, MappingAction mappingAction, Type& mappedType) in d:\Infusionsoft.net\src\InfusionSoft\Support\Serialization\XmlRpcDeserializer.cs:line 511 at InfusionSoft.Serialization.XmlRpcDeserializer.MapValueNode(IEnumerator
1 iter, Type valType, MappingStack mappingStack, MappingAction mappingAction) in d:\Infusionsoft.net\src\InfusionSoft\Support\Serialization\XmlRpcDeserializer.cs:line 70
at InfusionSoft.Serialization.XmlRpcResponseDeserializer.DeserializeResponse(XmlReader rdr, Type returnType) in d:\Infusionsoft.net\src\InfusionSoft\Support\Serialization\XmlRpcResponseDeserializer.cs:line 54
at InfusionSoft.Serialization.XmlRpcResponseDeserializer.DeserializeResponse(Stream stm, Type svcType) in d:\Infusionsoft.net\src\InfusionSoft\Support\Serialization\XmlRpcResponseDeserializer.cs:line 28
at InfusionSoft.InfusionsoftProxy1.<>c__DisplayClass1
2.b__0(Object sender, XmlRpcResponseEventArgs args) in d:\Infusionsoft.net\src\InfusionSoft\InfusionsoftProxy.cs:line 52
at CookComputing.XmlRpc.XmlRpcResponseEventHandler.Invoke(Object sender, XmlRpcResponseEventArgs args)
at CookComputing.XmlRpc.XmlRpcClientProtocol.OnResponse(XmlRpcResponseEventArgs e) in :line 0
at CookComputing.XmlRpc.XmlRpcClientProtocol.Invoke(Object clientObj, MethodInfo mi, Object[] parameters) in :line 0
at CookComputing.XmlRpc.XmlRpcClientProtocol.Invoke(MethodInfo mi, Object[] Parameters) in :line 0
at XmlRpcProxy759e3f34-405e-4d87-a39e-cc73e46afd75.Query(String apiKey, String table, Int32 limit, Int32 page, IDictionary queryData, String[] selectedFields)
at InfusionSoft.DataServiceExtensions.<>c__DisplayClass91.<Query>b__8(IDataServiceDefinition d) in d:\Infusionsoft.net\src\InfusionSoft\Extensions\DataServiceExtensions.cs:line 85 at InfusionSoft.InfusionsoftProxy
1.Invoke[TDefinitionResponse,TResponse](Func2 method) in d:\Infusionsoft.net\src\InfusionSoft\InfusionsoftProxy.cs:line 58 at InfusionSoft.ServiceBase
1.<>c__DisplayClass42.<Invoke>b__3() in d:\Infusionsoft.net\src\InfusionSoft\ServiceBase.cs:line 50 at InfusionSoft.ServiceBase
1.TryInvoke[T](Func1 func) in d:\Infusionsoft.net\src\InfusionSoft\ServiceBase.cs:line 57 at InfusionSoft.ServiceBase
1.Invoke[TDefinitionResponse,TResponse](Func2 method) in d:\Infusionsoft.net\src\InfusionSoft\ServiceBase.cs:line 50 at InfusionSoft.DataServiceExtensions.Query[T](IDataService service, DataPage page, Action
1 queryBuilder, Action1 fieldSelection) in d:\Infusionsoft.net\src\InfusionSoft\Extensions\DataServiceExtensions.cs:line 85 at InfusionSoft.DataServiceExtensions.GetAllPages[T,T1,T2](Func
4 func, T1 arg1, T2 arg2) in d:\Infusionsoft.net\src\InfusionSoft\Extensions\DataServiceExtensions.cs:line 194
at InfusionSoft.DataServiceExtensions.Query[T](IDataService service, Action1 queryBuilder, Action
1 projection) in d:\Infusionsoft.net\src\InfusionSoft\Extensions\DataServiceExtensions.cs:line 46
at InfusionSoft.DataServiceExtensions.Query[T](IDataService service) in d:\Infusionsoft.net\src\InfusionSoft\Extensions\DataServiceExtensions.cs:line 26
Looks like a good library. I see that you have a NuGet folder, but I don't see it when searching NuGet. Did you publish it? Does more work need to be done first? I happy to help, if I can.
I'm receiving the following error when calling UploadFile.
InfusionSoft.InfusionSoftException: Server returned a fault exception: [0] No method matching arguments: java.lang.String, java.lang.String, java.lang.String, java.lang.Integer
Can you please check to see if this method still works for you?
Is there a .Net Helper Library for REST api support?
Hi,
Im trying to send an email without the templateID, however I only get the option to send with the templateID.
Im sending
public bool SendEmail(int[] ContactsIDToSendTo, string FromEmail, string Subject, string HTMLBody)
{
var client = customer.Connect();
var email = client.EmailService.SendEmail(ContactsIDToSendTo, FromEmail, "[email protected]", "[email protected]", "[email protected]", "HTML", Subject, HTMLBody, "", 0);
return email;
}
looking further in to it the https://developer.infusionsoft.com/docs/xml-rpc/#email-send-an-email says the template is of type string not int. (which makes no sense because its an ID...)
Error details
An unhandled exception of type 'InfusionSoft.InfusionSoftException' occurred in InfusionSoft.dll
Additional information: Server returned a fault exception: [0] No method matching arguments: java.lang.String, [Ljava.lang.Object;, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.Integer
Hi,
Can someone explain or give me a quick example of doing a IQueryBuilder for a date > current date.
I can see inside the API that you can set an IQueryBuilder however cant see how to set greater than options.
Please help.
when I try to find a contact by email and use p=>p.IncludeAll i get an exception
"Server returned a fault exception: [0] Failed to invoke method findByEmail in class com.infusionsoft.api.xmlrpc.XmlRpcContactService: Unknown column 'Contact.AccountId' in 'field list'"
Also when use p.IncludeCustomField() with a custom field whose name has space in it, it doesn't work.
I would expect this query to return every InvoiceItem from 2014. Instead, it returns only items created this month, 2014-05. It's worse for Invoice; no records are returned for any query I've been able to craft yet. (In contrast, Companies & Contacts produce exactly the expected query results.)
// Expecting all 2014 InvoiceItems
// returned only 2014-05 InvoiceItems
var queryData = new XmlRpcStruct() { { "DateCreated", "2014%" } };
var invoiceItems = client.DataService.Query(
table: "InvoiceItem",
limit: 1000,
page: 1,
queryData: queryData,
selectedFields: new[]
{
"Id", "InvoiceAmt", "DateCreated", "Description", "Discount", "OrderItemId"//, "CustomFields"
})
.ToList();
The class Infusionsoft.Tables.Company does not include a property: Company. (for the company name). Instead, the property CompanyName is mapped to the field Company.
However, when using the DataService.Query method and adding a query parameter for CompanyName, an error is thrown [NoFieldFound] No field found: Company.CompanyName.
var results = client.DataService.Query<ISTables.Company>(
new DataPage(req.Take, req.Skip),
q => q.Add(c=>c.CompanyName, req.Filter + "%"),
p => p.Include(c => c.Id)
.Include(c => c.CompanyName)
.Include(c => c.City)
.Include(c => c.Phone1)
).ToList();
HI there i have just identified an issue in LocateExistingCard. Your method signature currently has
public virtual int LocateExistingCard(int contactId, int last4)
{
return Invoke(d => d.LocateExistingCard(ApiKey, contactId, last4));
}
But needs to be
public virtual int LocateExistingCard(int contactId, string last4)
{
return Invoke(d => d.LocateExistingCard(ApiKey, contactId, last4));
}
I'm trying to test the viability of this client, but so far I can't get past the simplest invocation I could come up with. My API key is accepted, but the TryInvoke call ultimately throws an exception with this message:
Server returned a fault exception: [4] [DatabaseError]Error returning results
The code is just a simplification of the example app:
const string email = "[email protected]"; // address copied directly out of a contact
var contact = client.ContactService.FindByEmail(email).FirstOrDefault();
Console.WriteLine("{0} {1}", contact.FirstName, contact.LastName);
Is this something endemic to InfusionSoft, or something wrong in my method call, or something related to whether Mercury is in retrograde at the same time as the Sta-Puff Marshmallow Man is active? :~/
below is my code. The custom field isnt coming back with anything. Ive added in the correct _APIField.
This works fine on Tables.Job and Tables.Customer
ERROR is "Server returned a fault exception: [10] [NoFieldFound]No field found: Referral._DatabaseLandlordID"
Please can you help me get this to work ?
try
{
var client = customer.Connect();
var job = client.DataService.Query<InfusionSoft.Tables.Referral>(new DataPage(1000, 0), b => b.Add(v => v.Id, partnerID), project => project.IncludeCustomField(_CustomField));
// var result = client.DataService.Query<Job>(new DataPage(1000, 0), action => action.Add(x => x.Set(v => v.)), projection => projection.IncludeCustomField(_CustomField));
return job.ElementAt(0).CustomFields[_CustomField].ToString();
}
catch (Exception ex2)
{
return null;
}
The code sample includes this:
const string application = "YOUR APPLICATION NAME";
In the Infusionsoft Developer Portal (https://keys.developer.infusionsoft.com/apps/mykeys), under "My API Keys" I see "Application" - which I had created when I requested the key. However, if I use this text string as the "application", I get an error about it not being a valid URI. So, I attempted to instead use the Infusionsoft Account portal url (ex: xx999.infusionsoft.com), but then I get the error:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
So, what URL is expected by the api here?
Thanks
When making a call to the InvoiceService, ChargeInvoice method, the following exception is thrown:
"response contains implicit string value where integer expected [response : struct mapped to type ChargeInvoiceResult : member RefNum mapped to type Int32]"
The problem is being caused by the ChargeInvoiceResult class, RefNum property being an int and the API returning "None" for the RefNum which causes the exception since "None" cannot be converted to an int.
Is there any possibility of a version that supports OAuth instead of legacy authentication?
Hi With FileService.GetFile(id)
it returns a System.Object
how can I turn that in to a file.
Other issue is when uploading using
ie
var file = client.FileService.GetFile(123);
FileService.Upload("fileName",file.ToString(), 12121)
the upload fails. error below
Can someone please advise how to upload a file?
When I pass a Dictionary of field names and field values into the client.ContactService.Update() method, I get an error:
CookComputing.XmlRpc.XmlRpcUnsupportedTypeException: A parameter is of, or contains an instance of, type System.Collections.Generic.Dictionary`2[System.String,System.Object] which cannot be mapped to an XML-RPC type
at CookComputing.XmlRpc.XmlRpcRequestSerializer.SerializeRequest(Stream stm, XmlRpcRequest request) in :line 0
at CookComputing.XmlRpc.XmlRpcClientProtocol.Invoke(Object clientObj, MethodInfo mi, Object[] parameters) in :line 0
at XmlRpcProxy1cfb8f85-00dd-4b36-a037-50d149b56839.Update(String apiKey, Int32 contactId, IDictionary data)
at InfusionSoft.ContactServiceWrapper.<>c__DisplayClass28.<Update>b__27(IContactServiceDefinition d) in \InfusionSoft\Wrappers\ContactServiceWrapper.cs:line 105
The code at that line is:
return Invoke(d => d.Update(ApiKey, contactId, data));
Am I misunderstanding how to use the Update method? What sort of format does the IDictionary need to be in for this to work? I have tried
Dictionary<string, object>
and
Dictionary<string, string>
with the same result.
Thanks for any assistance.
We shouldn't be setting anything on ServicePointManager
. The first instance was fixed here. The second instance is still active here and, per my tests, does not appear to be needed.
ServicePointManager.ServerCertificateValidationCallback +=
(sender, certificate, chain, sslpolicyerrors) => true;
ServicePointManager
affects the whole app-domain and thus all other (non-Infusionsoft) calls are affected. This means that developers, who are unaware of the internals of this library, will not know why their app is behaving in an unexpected way.
For instance, I was setting ServicePointManager.SecurityProtocol
to be Tls
to solve the POODLE issue for Facebook, but because this library also hard-coded it to Ssl3
, it was overwriting my setting.
If we ever "need" to set something on ServicePointManager
or another setting that affects the entire app-domain, we should instead give the user guidance as to proper settings or call it out in a more obvious way.
PR incoming.
Issue seems to be one of the fields (Categories) contains a ex:nil, and the XML parser doesn't like the "ex:" namespace.
Possibly could be handled by fixing up the response to support the ex: namespace for parsing?
Hi, hope you can help me with some sample code on how I can use the DataService to perform querying with multiple parameters and perhaps sorting as well.
Actually I'm trying to fetch the latest order from a given ContactId
At the moment I an get all the orders for a given contact with:
Client.DataService.Query(q => q.Add(x => x.ContactId, 1))
Can you show me how I can query for just the latest Job for a given contactId please?
Many thanks in advance!
Sud
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.