Coder Social home page Coder Social logo

infusionsoft.net's Introduction

infusionsoft.net's People

Contributors

fitzglitz avatar iprida avatar jdconley avatar mark64digital avatar misinformeddna avatar olliecwl avatar paulsickling avatar pbabbott avatar piranout avatar scottcate avatar trbngr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

infusionsoft.net's Issues

getEmailTemplate response fails to parse as valid XML

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?

ChargeInvoice Exception

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.

Response mismatch for CCharge.MerchantId

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, Func1 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(IEnumerator1 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(IEnumerator1 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__DisplayClass12.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.InfusionsoftProxy1.Invoke[TDefinitionResponse,TResponse](Func2 method) in d:\Infusionsoft.net\src\InfusionSoft\InfusionsoftProxy.cs:line 58 at InfusionSoft.ServiceBase1.<>c__DisplayClass42.<Invoke>b__3() in d:\Infusionsoft.net\src\InfusionSoft\ServiceBase.cs:line 50 at InfusionSoft.ServiceBase1.TryInvoke[T](Func1 func) in d:\Infusionsoft.net\src\InfusionSoft\ServiceBase.cs:line 57 at InfusionSoft.ServiceBase1.Invoke[TDefinitionResponse,TResponse](Func2 method) in d:\Infusionsoft.net\src\InfusionSoft\ServiceBase.cs:line 50 at InfusionSoft.DataServiceExtensions.Query[T](IDataService service, DataPage page, Action1 queryBuilder, Action1 fieldSelection) in d:\Infusionsoft.net\src\InfusionSoft\Extensions\DataServiceExtensions.cs:line 85 at InfusionSoft.DataServiceExtensions.GetAllPages[T,T1,T2](Func4 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, Action1 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

TLS 1.2

How can I set the security protocol to use TLS 1.2 ?

Regards

ChargeInvoice returns error

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.

How to query with multiple parameters?

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

Fault exception / [DatabaseError] with simplest call

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? :~/

Cannot retrieve custom fields with api call.

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?

Using DataService.Query<Table>(page, queryBuilder,fieldSelection) with dates in queryBuilder returns no results.

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();

works

but this doesnt:

          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?

Hello

The SDK is not compatible with .NET Core.

How could we get this working?

Regards,

Daniel

Query by Ids

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.

ContactService.Load not returning custom fields

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;
}

Getting CustomFields

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?

RecurringOrderWithContact field HTMLSignature preventing Query<RecurringOrderWithContact>(..)

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.

Publish to NuGet

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.

Issue calling FileService.UploadFile

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?

Invoice Description

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();

DataService Query Company

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(); 

IQuery Builder

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.

Cannot add company with CompanyName

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)

http://community.infusionsoft.com/showthread.php/4101-Cannot-add-a-Company-to-InfusionSoft-when-passing-CompanyName

Issue in LocateExistingCard

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));
}

How to send an email

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

OAuth

Is there any possibility of a version that supports OAuth instead of legacy authentication?

Error on .Update = A parameter is of, or contains an instance of, type System.Collections.Generic.Dictionary... which cannot be mapped to an XML-RPC type

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.

New .NET Infusionsoft Client

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:

  • All operations are composable. This means that you can chain all operations together to form one 'master' operation. Example.
  • All operations are completely lazy. Nothing actually executes until you call RunWith. Example.
  • For easy debugging, all operations have the ability to output logs.
  • Speaking of logging, you can create your own log messages. Log is an InfusioOp. Example.
  • All operations have XML documentation that comes from the API documentation.
  • All optional operation parameters are actually typed as optional (ie Operation(long? id = default)) so you don't have to provide a value.
  • Authentication is configured up-front and not littered throughout the calls. I still need to make some authentication helpers around token management. But that's a pretty easy task.

Tasks to complete:

  • Library Documentation
  • Authentication token helper packages. These will allow auto-refreshing of tokens so you don't have to worry about it.

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.

InfusionSoftException when using FindByEmail and IncludeAll

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.

How can i create a custom field for Contact?

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.

DataService not returning expected records for Invoice and InvoiceItem tables

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();

ContactService.AddToCampaign {"Server returned a fault exception: [6] [Loading]Error loading follow-up sequence"}

 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);

2016-10-19_044455


{"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()

FileService

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?

API ChargeInvoice response contains implicit string value where integer expected

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.

Create Tag/ Get all Tag / Get Tag by Name

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

OAuth2 URL

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);
    }

InvoiceService.ValidateCreditCard results in an XmlRpc error

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?

Referral Custom Field

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;
        }

CustomField in Tables

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

Remove setting properties on ServicePointManager

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.

How to send to custom fields

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.

Question: What is the "application" value expected?

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.