infusionsoft / api-sample-code Goto Github PK
View Code? Open in Web Editor NEWSample API Code for various Languages
Sample API Code for various Languages
New to github, new to comments, new new new...
So it seems this is the old way and shouldn't be used in light of the new way.
None the less I could not get this to work.
xmlrpc.inc throws the "DEPRECATED Assigning the return value of new by reference is deprecated" on this =&
I did some research and the resolution was to remove the & and it would run error free. I tried that and the script died at the call "$result = $client->send($call);"
If anyone can assist please do. Otherwise I'm finding a new tree to bark up...
$token = serialize(json_decode('{"access_token":"_","token_type":"bearer","expires_in":28800,"refresh_token":"_","scope":"|****.infusionsoft.com"}'));
$infusion = new \Infusionsoft\Infusionsoft([
'clientId' => '******',
'clientSecret' => '******',
'redirectUri' => 'www.example.com',
]);
$infusion->setToken(unserialize($token));
$infusion->refreshAccessToken(); // causing error
$contact = $infusion->contacts()->findByEmail('****@hotmail.com',['FirstName','LastName']);
var_dump($contact);
whats the deal?
I bet the API has changed quite a bit since the last commit in this repository. Please update.
When making the following API call:
POST https://fm260.infusionsoft.com/api/xmlrpc
Authorization: Bearer <access_token>
Content-Type: application/xml
<methodCall>
<methodName>InvoiceService.createBlankOrder</methodName>
<params>
<param>
<value><int>22</int></value>
</param>
<param>
<value><string>hello world</string></value>
</param>
<param>
<value><dateTime.iso8601>20080908T00:00:00</dateTime.iso8601></value>
</param>
<param>
<value><int>2</int></value>
</param>
<param>
<value><int>2</int></value>
</param>
</params>
</methodCall>
I always receive the following error:
<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<fault>
<value>
<struct>
<member>
<name>faultCode</name>
<value>
<i4>0</i4>
</value>
</member>
<member>
<name>faultString</name>
<value>No method matching arguments: java.lang.Integer, java.lang.String, java.util.Date, java.lang.Integer</value>
</member>
</struct>
</value>
</fault>
</methodResponse>
I see I'm not the first to receive an error like this, however I have copy and pasted this request from your API documentation and I can't seem to figure out what I have wrong. My HTTP client is just POSTMAN, as I just wanted to get a request working before I start writing code. Any help would be much appreciated!
Any update/sample for Asp.Net Core (2.x)?
Please add node examples guys
Hi,
The synced field should be a boolean. Otherwise, client.DataService.Load(invoiceId) will fail. Here is the code:
// Copyright (c) 2012, EventDay
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
//
// Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
// Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using CookComputing.XmlRpc;
namespace InfusionSoft.Tables
{
[XmlRpcMissingMapping(MappingAction.Ignore)]
public class Invoice : Table
{
[XmlRpcMember("Id")]
[Access(Access.Read)]
public int Id { get; set; }
[XmlRpcMember("ContactId")]
[Access(Access.Read)]
public int ContactId { get; set; }
[XmlRpcMember("JobId")]
[Access(Access.Read)]
public int JobId { get; set; }
[XmlRpcMember("DateCreated")]
[Access(Access.Read)]
public DateTime DateCreated { get; set; }
[XmlRpcMember("InvoiceTotal")]
[Access(Access.Read)]
public double InvoiceTotal { get; set; }
[XmlRpcMember("TotalPaid")]
[Access(Access.Read)]
public double TotalPaid { get; set; }
[XmlRpcMember("TotalDue")]
[Access(Access.Read)]
public double TotalDue { get; set; }
[XmlRpcMember("PayStatus")]
[Access(Access.Read)]
public int PayStatus { get; set; }
[XmlRpcMember("CreditStatus")]
[Access(Access.Read)]
public int CreditStatus { get; set; }
[XmlRpcMember("RefundStatus")]
[Access(Access.Read)]
public int RefundStatus { get; set; }
[XmlRpcMember("PayPlanStatus")]
[Access(Access.Read)]
public int PayPlanStatus { get; set; }
[XmlRpcMember("AffiliateId")]
[Access(Access.Read)]
public int AffiliateId { get; set; }
[XmlRpcMember("LeadAffiliateId")]
[Access(Access.Read)]
public int LeadAffiliateId { get; set; }
[XmlRpcMember("PromoCode")]
[Access(Access.Read)]
public string PromoCode { get; set; }
[XmlRpcMember("InvoiceType")]
[Access(Access.Read)]
public string InvoiceType { get; set; }
[XmlRpcMember("Description")]
[Access(Access.Read)]
public string Description { get; set; }
[XmlRpcMember("ProductSold")]
[Access(Access.Read)]
public string ProductSold { get; set; }
[XmlRpcMember("Synced")]
[Access(Access.Read)]
public bool Synced { get; set; }
}
}
Getting Lots of issues with following
Deprecated: Assigning the return value of new by reference is deprecated
When trying to make API calls, I keep getting the following error:
{
"methodResponse": {
"fault": {
"value": {
"struct": {
"member": [
{
"name": "faultCode",
"value": {
"i4": 0
}
},
{
"name": "faultString",
"value": "Failed to parse XML-RPC request: Premature end of file."
}
]
}
}
}
}
}
What should I look for to fix this? Is this an issue on my end or Infusionsoft's? Any help would be appreciated!
Hello, the shopping cart in your php sample is not working... it is success but still the status of the payment in the infusionsoft is UNPAID..
I am trying to make a call to the DataService.load
API, and specifically to get an opportunity (lead). I am required to search for the recordID of the opportunity, but I can't find that ID. Is there an ID for opportunities? Or is there some sort of other way to search for them?
I am trying to create a new contact with the provided samples and I get the following error when including this library on my page.
Parse error: syntax error, unexpected 'new' (T_NEW) in \inc\xmlrpc-2.0\lib\xmlrpc.inc on line 595
Any help would be greatly appreciated in resolving this error.
Thank you
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.