Giter Site home page Giter Site logo

infusionsoft's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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's Issues

emailUpdateTemplate params

I think there is a missing param in the updateEmailTemplate method ...

There appears to be no id to reference which template should be updated.

def email_update_template(id, title, category, from, to, cc, bcc, subject,
                            text_body, html_body, content_type, merge_context)
    response = get('APIEmailService.updateEmailTemplate', title, category, from,
                   to, cc, bcc, subject, text_body, html_body, content_type, merge_context)
end

Heroku trouble

Hi!

I'm work with infusionsoft gem.

In development mode, all normal.
But in heroku...

contact_id = Infusionsoft.contact_add({:FirstName => @user.first, :LastName => @user.last, :Email => @user.email, :City => @user.city, :State => @user.state, :Password => @user.password})

returns me a:

NoMethodError (undefined method `split' for nil:NilClass):

Why I have this error?

heroku stack - cedar 1.9.2,
my development mode - 1.9.2-p290 too.

Regards,
Alex

SMS Opt in when creating contacts

Hello,

This is not necessary an issue of this gem, but I ran out of options of where to ask. When creating a contact on Keap using their API form, we can add an option for them to add a their phone number and opt in to receive text messages. It does not look like we can do that when we are creating using their API. I see that you can do it on the email but not for the phone number. Is there a way to do this?

Thank you

No Send

Infusion Email Send no Work.

My code:

Infusionsoft.configure do |config|
config.api_url = url
config.api_key = api
config.api_logger = Logger.new("#{Rails.root}/log/infusionsoft.log")
end

contact_list = [12, 6]
Infusionsoft.email_send(contact_list, "#{newsletter.from_email}", "[email protected]", "", "", "Multipart", title, html, plain)

cat infusionsoft.log
INFO -- : CALL: APIEmailService.sendEmail api_url: xxx.infusionsoft.com api_key:xxxxx at:2015-09-28 13:38:09 -0500 args:[[12, 6], "[email protected]", "[email protected]", "", "", "Multipart", "this subject", "This HTML", "This Plain"]
INFO -- : RESULT: false

How to apply tags to contact?

Is it possible to apply tags programatically to contact?
I've looked through this library and I found Infusionsoft.contact_add_to_group method.
But I am not sure how to get group_id or Is there any easy way to assign tags with strings array?
Or How can I retrieve group id from tag string?

Infusionsoft.contact_add_to_group(contact_id, group_id)

Please help!
Thanks.

Can't retrieve a contact.

Hello @nateleavitt I am having an issue retrieving a contact.

If I run:
Infusionsoft.contact_load('327950')

I get:
InfusionAPIError: No method matching arguments: java.lang.String, java.lang.Integer, [Ljava.lang.Object;, java.util.HashMap
from /Users/eduardo.souza/.rvm/gems/ruby-2.6.1@btv/gems/infusionsoft-1.3.6/lib/infusionsoft/exception_handler.rb:28:in initialize' Caused by XMLRPC::FaultException: No method matching arguments: java.lang.String, java.lang.Integer, [Ljava.lang.Object;, java.util.HashMap from /Users/eduardo.souza/.rvm/gems/ruby-2.6.1@btv/gems/xmlrpc-0.3.2/lib/xmlrpc/client.rb:272:in call'

If I run:
Infusionsoft.contact_load('327950', ['FirstName', 'LastName'])

I get:
ArgumentError: wrong number of arguments (given 3, expected 2)
from /Users/eduardo.souza/.rvm/gems/ruby-2.6.1@btv/gems/infusionsoft-1.3.6/lib/infusionsoft/client/contact.rb:69:in `contact_load'

I have tried as an array, as strings and still nothing works.

What am I doing wrong here?

PS.: I was able to successfully add a contact.

contact_add_with_dup_check error

Hi,

All of a sudden we seem to be getting an error when trying to use this method. The error is: #<RuntimeError: Wrong type NilClass. Not allowed!>

We pass in a hash of {:FirstName => "x", LastName: "y", :Email => z} with the second parameter being "Email". We haven;t had an issue doing this until recently. Any ideas?

Rescue and retry on OpenSSL/Bad Gateway connection errors

Referencing this topic:
https://community.infusionsoft.com/t/intermittent-sll-connection-errors/31785/13
And issue #70 , This gem could benefit from a rescue/retry on API calls. From the forum topic:

def call(*args)
  result, retries = nil, 0
  begin
    silence_stream(STDERR) do
      result = xmlrpc.call *args
    end
  rescue OpenSSL::SSL::SSLError => e
    # According to IFS devs this is a timeout in the SSL handshake between us and them
    # So we should be able to retry this without ill effects
    if e.message =~ /SSL_connect SYSCALL/
      retries += 1
      if retries > 3
        log "*** INFUSION SSL ERROR: Handshake timeout (max retries reached) *** #{e.message}"
        raise e
      else
        log "*** INFUSION SSL ERROR: Handshake timeout (retry #{retries} of 3) *** #{e.message}"
        retry
      end
    else
      raise e
    end
  end
  
  result
end

I had been making my own rescue blocks on every single API call but that's just wayy too much code smell:

         begin
           Infusionsoft.contact_add_to_group(foo, bar)
         rescue OpenSSL::SSL::SSLError, Net::HTTPBadGateway => e
           puts "Infusionsoft error."
           puts e.message
           puts "Retrying in 5 seconds..."
           sleep(5)
           retry
         end
       end

No such handler: InvoiceService.getinvoice_id

There is an issue with InvoiceService.getinvoice_id API call in infusionsoft/lib/infusionsoft/client/invoice.rb line number 300. Its actually InvoiceService.getInvoiceId Please refer this PR - #69

Help with WebPrez/Infusionsoft gem

Hi Nate, thanks for your help with this gem and the Infusionsoft system.

Here's the thing, basically, our developer is using the gem to create an Invoice, charge that Invoice, and THEN setup a Subscription, which is then set to be billed 30 days later.

Wouldn't it be easier just to setup the Subscription and charge it immediately? How does CustomerHub work it?

My developer says there is no way to setup a Subscription and charge right away. He says that Infusionsoft runs those charges every few hours, so there is no way for us to know whether a charge was successful or not.

Do you have some thoughts or suggestions on this? My developer is from India and has been a bit confused by Infusionsoft. If you could help me out and suggest the proper way we should be doing this, it would be greatly appreciated.

Thanks,
Michael
(415) 797-2470

Tag names on infusionsoft

So I need to get the tags a contact has been assigned, and seems like Infusionsoft call these groups, however I can't get the names of the tags, this is what I'm doing:

Infusionsoft.data_load 'Contact', 1017, [:groups]
#=> {"groups"=>"103"}

Searching for groups will only give me the id not the actual tag name, and given that Infusionsoft generates this upon creation the id itself won't tell my app anything about this contact, so I did some digging and found that Infusion soft has another table ContactGroupAssign were they keep the tag information so I tried that using the DataService.load and this is what happens:

Infusionsoft.data_load 'ContactGroupAssign', 103, [ :GroupId ]
=begin
Infusionsoft::NoFieldFoundError: [NoFieldFound]No field found: ContactGroupAssign.Id
from /Users/enrique/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/infusionsoft-1.1.8/lib/infusionsoft/exception_handler.rb:26:in `initialize'
=end

Infusionsoft breaks away from convention here, by naming it's primary key to GroupId instead and the gem seems to default to Id which is causing an error of NoFieldFound, maybe there is a way in this gem to bypass this but so far I couldn't find any, is this a bug or am I overlooking something? I attached the list of column names in the ContactGroupAssign table from infusionsoft docs.

http://developers.infusionsoft.com/dbDocs/ContactGroupAssign.html

Thanks in advance

InfusionAPIError: Failed to invoke method addToGroup

I am trying to add a contact to a group using contact_add_to_group, that's when i receive this error.

I noticed that this only happens with contacts that are already existing and not with contacts that were created prior to calling this function.

[Unexpected]Unexpected error creating subscription

Thoughts on how I might troubleshoot this? I'm running Ruby 2.3.1 and Rails 5.0.2.

I have access to all the other methods, data_query, data_find_by_field, invoice_create_blank_order, etc.

Infusionsoft::UnexpectedError: [Unexpected]Unexpected error creating subscription
	from /Users/travis/.rvm/gems/ruby-2.3.1/gems/infusionsoft-1.1.9/lib/infusionsoft/exception_handler.rb:26:in `initialize'
	from /Users/travis/.rvm/gems/ruby-2.3.1/gems/infusionsoft-1.1.9/lib/infusionsoft/connection.rb:25:in `new'
	from /Users/travis/.rvm/gems/ruby-2.3.1/gems/infusionsoft-1.1.9/lib/infusionsoft/connection.rb:25:in `rescue in connection'
	from /Users/travis/.rvm/gems/ruby-2.3.1/gems/infusionsoft-1.1.9/lib/infusionsoft/connection.rb:16:in `connection'
	from /Users/travis/.rvm/gems/ruby-2.3.1/gems/infusionsoft-1.1.9/lib/infusionsoft/request.rb:30:in `request'
	from /Users/travis/.rvm/gems/ruby-2.3.1/gems/infusionsoft-1.1.9/lib/infusionsoft/request.rb:6:in `get'
	from /Users/travis/.rvm/gems/ruby-2.3.1/gems/infusionsoft-1.1.9/lib/infusionsoft/client/invoice.rb:75:in `invoice_add_recurring_order'
	from /Users/travis/.rvm/gems/ruby-2.3.1/gems/infusionsoft-1.1.9/lib/infusionsoft.rb:19:in `method_missing'

Adding Contact To Campaign Failing

Hi, I've been working with this gem for the past few days and it's been really great so far. I'm running into an odd problem attempting to add a contact to a campaign through the gem.

> Infusionsoft.contact_add_to_campaign(5555, 5)
 => nil 

I'd looked at the documentation and was expecting true or false depending on if the campaign adding was a success or not, but no matter what I do with this function I get nil.

Any thoughts as to what this could be?

Integration with multiple Infusionsoft Accounts

Hey there,

I was wondering - is it possible to have multiple instances of the Wrapper at the same time? In a way, that i can pass in the required API Keys when i create a new Infusionsoft object?

Fails to update datetime field when using ContactService.addWithDupCheck

We have an issue when we try to update a contact's custom datetime field when using ContactService.addWithDupCheck.

I opened a ticket with Infusionsoft as I believe it may be an issue on their end, yet I also just wanted to double check this scenario here.

ContactService.addWithDupCheck works on first attempt to create a new contact record. Yet, on a second call or more, with an existing contact, the custom datetime fields fail to update. Our normal use case is we have a variety of custom fields (first name, last name, datetime, etc) that get updated in a single bulk update. All fields will update properly except the datetime fields.

A workaround I figured out is to do a separate update call for that contact record using ContactService.update.

Another issue I encountered is being able to clear a field that is no longer needed. It seems the Infusionsoft API rejects our data if certain keys are present, but have no value. Yet, I found that using the string zero "0" allows us to clear out the field.

For example, currently we have two custom datetimes (ex: day 1, day 2) for each contact record. For one scenario, we create the record and set the two custom datetimes which work. Then, on an update call, if we need to update day 1 datetime and clear/reset day 2, there was an issue using an empty string "" and nil as a value. Setting day 2 to "0" seemed to work and the reset the field to default (and day 1 would update as well).

Is there a known issue or note using addWithDupCheck in a bulk update?
Is using string zero "0" a valid way of resetting a value for a field?

email_get_template fails with an XML parsing error

On my current project (using Ruby 2.3.x, and version 1.1.9 of this gem), I receive the following error when trying to pull down an email template with Infusionsoft.get_email_template(id):

REXML::UndefinedNamespaceException: Undefined prefix ex found

By dumping the raw HTML response, it appears that Infusionsoft is inserting the tag <ex:nil/> in its email template responses, which REXML dislikes.

If I patch XMLRPC::Client#call2 to strip that substring, then I can successfully fetch email templates. But, patching a core class strikes me as a hacky solution.

Are there any other ways to work around this issue? I'll attach a stack trace in a comment.

Searching Contacts by Custom Fields

Is it possible to search for a contact or any other table by custom fields? My company has "Retail ID" that is in every contact custom fields, and is unique for each one. I can't figure out how to search for contacts by that specific field. I was hoping there would be a way to link those tables. Am I missing something?

API Key in log?

I noticed in my testing that the api_key and api_url are printed in plain text in the log with each call. Not sure if this is intended or not. Seems like I'd prefer that not be in the log files. Just a thought.

InvoiceService.chargeInvoice InfusionAPIError: No method matching arguments

Infusionsoft.invoice_charge_invoice(14, "Payment", 1, 1, 0) raising this error :

ERROR: No method matching arguments: java.lang.String, java.lang.Integer, java.lang.String, java.lang.Integer, java.lang.Integer, java.lang.Integer
InfusionAPIError: No method matching arguments: java.lang.String, java.lang.Integer, java.lang.String, java.lang.Integer, java.lang.Integer, java.lang.Integer
from /home/mcd/.rvm/gems/ruby-2.4.1/gems/infusionsoft-1.2.1/lib/infusionsoft/exception_handler.rb:28:in `initialize'

What is wrong with these arguments and what is merchange_id and bypass_commissions in

Infusionsoft.invoice_charge_invoice(invoice_id, notes, credit_card_id, merchange_id, bypass_commissions)

Missing examples in README

With the introduction of OAuth2 and REST support, it would be nice to see an example of:

  1. How to fetch the access token "on your own," as you say.
  2. How to instantiate and make a call to the REST API.

API Strings in Constants

It would make sense to have the strings that are passed to the API in constants. For example, in contact_add_with_dup_check, you need to pass either Email, EmailAndName, or EmailAndNameAndCompany. It would be nice if you could use Infusionsoft::CHECK_TYPE_EMAIL. Thoughts? If this sounds like a good idea, I'd be happy to create a pull-request.

Error loading follow-up sequence

Hi @nateleavitt i am integrating this gem in my rails app and i am facing the same issue with some of the methods. Like when i try to make an api call to add contac to campaign

contact_id = Infusionsoft.contact_add_with_dup_check({ FirstName:'Bill', LastName:'Joe', Email:'[email protected]' }, 'ContactName')

Infusionsoft.contact_add_to_campaign(contact_id,2)

This throws an error
<Infusionsoft::LoadingError: [Loading]Error loading follow-up sequence>
Any update on this ?

NameError: undefined local variable or method `api_logger'

Tried running 1.1.5, 1.1.6 and master... and I keep getting the below api_logger error.

Initializer is set up exactly as in the example. Am I missing something?

NameError: undefined local variable or method `api_logger' for #<InfusionAPIError: InfusionAPIError>
  from /Users/Walsh/.rvm/gems/ruby-2.0.0-p0@itglue/gems/infusionsoft-1.1.5/lib/infusionsoft/connection.rb:48:in `initialize'
  from /Users/Walsh/.rvm/gems/ruby-2.0.0-p0@itglue/gems/infusionsoft-1.1.5/lib/infusionsoft/connection.rb:23:in `new'
  from /Users/Walsh/.rvm/gems/ruby-2.0.0-p0@itglue/gems/infusionsoft-1.1.5/lib/infusionsoft/connection.rb:23:in `rescue in connection'
  from /Users/Walsh/.rvm/gems/ruby-2.0.0-p0@itglue/gems/infusionsoft-1.1.5/lib/infusionsoft/connection.rb:14:in `connection'
  from /Users/Walsh/.rvm/gems/ruby-2.0.0-p0@itglue/gems/infusionsoft-1.1.5/lib/infusionsoft/request.rb:29:in `request'
  from /Users/Walsh/.rvm/gems/ruby-2.0.0-p0@itglue/gems/infusionsoft-1.1.5/lib/infusionsoft/request.rb:5:in `get'
  from /Users/Walsh/.rvm/gems/ruby-2.0.0-p0@itglue/gems/infusionsoft-1.1.5/lib/infusionsoft/client/data.rb:24:in `data_load'
  from /Users/Walsh/.rvm/gems/ruby-2.0.0-p0@itglue/gems/infusionsoft-1.1.5/lib/infusionsoft.rb:19:in `method_missing'
  from (irb):1

Optin Option Not available

We can add any contact easily however there is no option to OptIn so that we can start any promotion.

bundler error

When i added gem 'infusionsoft'

I get

Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    rails (= 3.0.0) ruby depends on
      bundler (~> 1.0.0) ruby

  Current Bundler version:
    bundler (1.1.3)

This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?

Bug? ... InvoiceService.addRecurringOrder

The method invoice_add_recurring_order doesn't seem to work in the master branch due to the fact that not all the parameters that are listed as required under the Infusionsoft API docs are present in this method.

The missing parameters are: "qty", "price", "allowTax".

My assumption may be off, but either this method doesn't work correctly (because the required params are missing) or those three items aren't actually required parameters. Not sure if anyone else uses the method as is and without issue.

Regardless, I have been using a modified method to support all of the required parameters and the transactions are properly submitted via the api. When I revert back to using the master branch (nateleavitt/infusionsoft), the transactions fail.

This may be due to the fact that my application allows for variable pricing in the recurring order.

Question: would this be a case where the method could be modified to fully support the API docs, or would it be better to add a second method like, invoice_add_custom_recurring_order ... to avoid breaking some application that is currently using it successfully as is?

InfusionSoft Using Oauth2

I'm new to infusionsoft and looking to use it in my application to save contacts. I'm not able to get app_url after registering an app on infusionsoft as i think they stop supporting old way and only way to use it through oauth2.
Can i use this gem to connect with the API now? Please help me how to use it with the api latest version.

INFUSION API ERROR

Hi everyone,
I'm new here on infusionsoft, I followed the instruction correctly, I provide correct configuration
API URL & API Key.. but I'm having an error saying:

*** INFUSION API ERROR: retrying 1 ***
*** INFUSION API ERROR: retrying 2 ***
*** INFUSION API ERROR: retrying 3 ***
*** INFUSION API ERROR: retrying 4 ***
*** INFUSION API ERROR: retrying 5 ***

And I view the the xml file It said, "




faultCode

0



faultString

Failed to parse XML-RPC request: Premature end of file.





"

Can anyone help me? Thanks in advance

uninitialized constant Infusionsoft::Client::Search (NameError) when Rails loads

I have installed using 'bundle install' after adding gem 'infusionsoft' in my Gemfile. I have also, as instructed, created config/initializers/infusionsoft.rb and added the URL and api key configuration as shown (using my specific details). Now, every command I run with rails (e.g., 'rails generate migration AddXyzModel') bombs out with:

$ rails generate migration AddContentManagement
/usr/local/lib/ruby/gems/1.9.1/gems/infusionsoft-1.0.4/lib/infusionsoft/client.rb:25:in <class:Client>': uninitialized constant Infusionsoft::Client::Search (NameError) from /usr/local/lib/ruby/gems/1.9.1/gems/infusionsoft-1.0.4/lib/infusionsoft/client.rb:5:inmodule:Infusionsoft'
from /usr/local/lib/ruby/gems/1.9.1/gems/infusionsoft-1.0.4/lib/infusionsoft/client.rb:1:in <top (required)>' from /usr/local/lib/ruby/gems/1.9.1/gems/infusionsoft-1.0.4/lib/infusionsoft.rb:2:in<top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:68:in require' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:68:inblock (2 levels) in require'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:66:in each' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:66:inblock in require'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:55:in each' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:55:inrequire'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler.rb:120:in require' from /home/ellel/projects/ellel/apps/web/rails/ellel-cloud/config/application.rb:7:in<top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.1/lib/rails/commands.rb:21:in require' from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.1/lib/rails/commands.rb:21:in<top (required)>'
from script/rails:6:in require' from script/rails:6:in

'

This is running Rails 3.1.1.

Nonename or servname not provided?

I put

gem 'infusionsoft'
in my gemfile.

I added my API Key and URL as environmental variables that get loaded into an initializer like so:

Infusionsoft.configure do |config|
config.api_url = ENV['INFUSIONSOFT_URL'] # example infused.infusionsoft.com
config.api_key = ENV['INFUSIONSOFT_API_KEY']
config.api_logger = Logger.new("#{Rails.root}/log/infusionsoft_api.log") # optional logger file
end

But when I test the contact add service in my rails console I get this error:

SocketError: getaddrinfo: nodename nor servname provided, or not known
from /Users/Justus/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/http.rb:879:in `initialize'
Is anyone aware of a fix for this?

How to access the response (contact_id) when using contact_add ?

Thanks for your work on this gem. It's SO much nicer than dealing with the api directly.

I'm running into a simple issue in that I can't seem to figure out how to get the contact_id which comes in the response after adding a new contact using contact_add.

I see that it's going into the log, but I can't seem to find out how to save it to a variable for use in future calls pertaining to that contact.

Thanks in advance. I'm sure I'm just missing something simple.

Non-200 Infusionsoft API responses aren't being logged

When a request to the Infusionsoft API returns something other than a 200 response, we aren't able to determine the reason for the error as the response code/body isn't being logged:

In another non-Rails application we maintain, we log the failing Infusionsoft API response code/body as those can be helpful. I.e. 401 Unauthorized when a token is invalid, or seeing a 404 if we try to update a non-existent contact, or a 500 error if it's an issue on Infusionsoft's side (which we've encountered before).

Even something as simple as logging the err object would go a long way in helping us when it comes to troubleshooting issues with the Infusionsoft API. E.g.:

# https://github.com/nateleavitt/infusionsoft/blob/master/lib/infusionsoft/request.rb#L51

      resp = RestClient::Request.execute(opts)
    rescue RestClient::ExceptionWithResponse => err
      api_logger.info "RESPONSE: #{err.inspect}"
    else

I can create a PR for this if you'd like.

Rare but showstopper OpenSSL errors with xmlrpc

I'm getting some interesting errors occasionally when sending simple commands, like removing contacts from a group:

OpenSSL::SSL::SSLError: SSL_connect SYSCALL returned=5 errno=0 state=unknown state
/home/testbed/.rvm/gems/ruby-2.4.1@global/gems/xmlrpc-0.2.1/lib/xmlrpc/client.rb:495:in `do_rpc'
/home/testbed/.rvm/gems/ruby-2.4.1@global/gems/xmlrpc-0.2.1/lib/xmlrpc/client.rb:287:in `call2'
/home/testbed/.rvm/gems/ruby-2.4.1@global/gems/xmlrpc-0.2.1/lib/xmlrpc/client.rb:268:in `call'
/home/testbed/.rvm/gems/ruby-2.4.1/gems/infusionsoft-1.2.0/lib/infusionsoft/connection.rb:18:in `connection'
/home/testbed/.rvm/gems/ruby-2.4.1/gems/infusionsoft-1.2.0/lib/infusionsoft/request.rb:30:in `request'
/home/testbed/.rvm/gems/ruby-2.4.1/gems/infusionsoft-1.2.0/lib/infusionsoft/request.rb:6:in `get'
/home/testbed/.rvm/gems/ruby-2.4.1/gems/infusionsoft-1.2.0/lib/infusionsoft/client/contact.rb:134:in `contact_remove_from_group'
/home/testbed/.rvm/gems/ruby-2.4.1/gems/infusionsoft-1.2.0/lib/infusionsoft.rb:19:in `method_missing'

In the meantime I'm having to catch this error in a rescue block, to try again after a certain number of seconds. The gem seems unaware that this situation can happen.

REST Auth

I'm using REST API
And looking for the simple authorization way

namespace :token do
  desc 'generate access token'
  task :generate_access_token do
    require 'faraday'
    require 'uri'

    data = {
      application: ENV['INFUSIONSOFT_DEV_API_URL'],
      scope: 'full',
      client_id: ENV['INFUSIONSOFT_DEV_CLIENT_ID'],
      client_secret: ENV['INFUSIONSOFT_DEV_CLIENT_SECRET'],
    }
    authorization_string = "#{ENV['INFUSIONSOFT_DEV_CLIENT_ID']}:#{ENV['INFUSIONSOFT_DEV_CLIENT_SECRET']}"
    url = "https://accounts.infusionsoft.com/app/oauth/userToken"
  
    response = Faraday.post(url) do |req|
      req.headers['Authorization'] = "Basic #{Base64.strict_encode64(authorization_string)}"
      req.headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8'
      req.body = URI.encode_www_form(data)
    end
    response_body = JSON.parse(response.body)
    ...

  end
end

It works in case I add Cookie to reqest Header

req.headers['Cookie'] = "SESSION=YWU3ZjExMDgtNjliNS00ZGEyLWFmMmEtMWU5ODEwODM4ODFi"

But its inconvenient
Is there the simple way to using your library without Authorization to proceed REST API implementation?

My contacts shouldn't Authorize I just need to apply the tags actions to my contacts that using my App and already Authorized there

Please advise

Where do I place API Call

I'm new to rails so your patience with my rookie question is appreciated!

I've installed the gem successfully.
I created the infusionsoft configuration file.

But... where do I put this api call?

Infusionsoft.contact_add({:FirstName => 'first_name', :LastName => 'last_name', :Email => '[email protected]'})

Also does 'first_name', 'name' refer to database field names within infusionsoft?
Also do I replace '[email protected]' with the infusionsoft email field name?

Thanks for your help!

Updading Groups(tags)

Hello I have an issue where I am trying to update or create a customer with their associated Groups. But I can't seem to get it working using Infusionsoft.contact_add({:FirstName => first_name, :LastName => last_name, :Email => email, :Groups => tags.join(',')}) or using the contact_update or data_add or data_update. It seems I can only add or delete a single tag at the time. What am I doing wrong?

When I try to simply do a Infusionsoft.data_update('Contact', 8802, {"Groups" => "123, 321"}) I get an error No Fields sent for Update.

with the contact_add I can get the customer to be created but the tags/groups will not be added. Suggestions?

Thank you

funnel_achieve_goal returning weird error

Hi there, I am making the following call to put a customer into a sequence:

Infusionsoft.funnel_achieve_goal("no343","payingcustomer",1234)

As far as I can tell this should work, but when I do that I get this error:

RuntimeError: Wrong size. Was 1068, should be 307

Has this happened to anyone else before? How can I fix this?

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.