Giter Site home page Giter Site logo

active-campaign-rails's People

Stargazers

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

Watchers

 avatar  avatar

active-campaign-rails's Issues

Params not submitting

Having an issue where params are not making their way to the system in AC.

My implementation:

Note: the connection works fine, it's submitting the contact, just not all the fields. Fields not making it into the system state, role/position, organization - and the contact is not being added to any listโ€” there is a list number 3, there is a state, org (account name), and role/position within the admin tool.

def activecampaign_connect
  ac = ActiveCampaign.new(
    api_endpoint: ENV['ACTIVE_CAMPAIGN_API_URL'],
    api_key: ENV['ACTIVE_CAMPAIGN_API_KEY']
  ) 
  return ac
end


def activecampaign_add_dotm_user( first_name, last_name, email, org, position, state )
  # connect to api..
  ac = activecampaign_connect
  # add user to dotm email list.. 
  # response = ac.contact_add(
  response = ac.contact_sync(
    first_name: first_name,
    last_name: last_name,
    email: email,

    roleposition: position,
    role_position: position,
    state: state,

    'field[%ACCT_NAME%,0]' => org,
    'field[%ROLEPOSITION%,0]' => position,
    'field[%STATE%,0]' => state,

    'p[3]' => 3,
  )

  puts response
end

Active Campaign Support response:

A test API call on my end and this worked as expected.
Here's the request URL I used:

https://edumotion.api-us1.com/admin/api.php?api_action=contact_sync&api_key=YOUR_API_KEY_HERE

And here's the body of the request (I replicated what I'm seeing in your code, in that screenshot you sent):

first_name=Pedro&last_name=from ActiveCampaign&[email protected]&roleposition=position&role_position=position&state=state&field[%ACCT_NAME%,0]=org&field[%ROLEPOSITION%,0]=position&field[%STATE%,0]=state&p[3]=3

TypeError (can't dup NilClass):

Hi,

I'm using your gem and I got stuck at some point.
This is the code I use to verify user account on ActiveCampaign exists:

#1  def test_active_campaign(params)
#2    verified = false
#3    if params[:user][:ac_api_endpoint].present? && params[:user][:ac_api_key].present?
#4      require 'active-campaign-rails'
#5      active_campaign = ActiveCampaign.new(
#6          api_endpoint: params[:user][:ac_api_endpoint],
#7          api_key: params[:user][:ac_api_key])
#8      result = eval active_campaign.account_view
#9      verified = true if result[:result_code] == 1
#10    end
#11    verified
#12  end

Unfortunately I keep this getting this error TypeError (can't dup NilClass): for line #8.

Do you know why this happens?

Thanks

How to add contact to a list?

I've read the documentation but I keep running into problems. In the official API documentation, it says to use p[#]: # (where # is the list ID) to add the contact to a list. However, Rails won't accept that.

Here's what I use:

active_campaign.contact_sync(
  email: 'EMAIL-ADDRESS-HERE',
  p[3]: '3'
)

Here's the error I receive:

syntax error, unexpected ':', expecting =>
 p[3]: '3'

If I replace : with =>, I receive:

NoMethodError: undefined method `[]' for nil:NilClass

I suspect the same issue would occur with any other bracket-using variable.

Error being thrown on 0.2.2

Hi team,

The latest version is causing an error to be thrown:

client.list_list(ids: 'all')
NameError: uninitialized constant ActiveCampaign::RestClient
from /Users/lcp/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/active-campaign-rails-0.2.2/lib/active-campaign-rails.rb:40:in `method_missing'

0.2.1 works fine

OpenSSL::SSL::SSLErrorWaitReadable

I'm getting this error repeatedly whenever an contact_sync is attempted. I've narrowed it down to this API call, but I can't figure out what's causing it.

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.