Comments (5)
same!
from active_campaign.
same
from active_campaign.
@lorenzsell @jmburges @shenst1 -- I think the problem here is that master branch is not consistent with what is pushed to Rubygems.
see last known published gem https://github.com/mhenrixon/active_campaign/tree/v0.1.16
sync_contact became contact_sync
add_contact became contact_add
etc
from active_campaign.
this seems like all developer confusion to me. I went down these same rabbit holes, explained here: #84
@lorenzsell @jmburges @shenst1
as well, you must take note that the comment in the setup has the critical piece of hidden information: /admin/api.php
must be added to your active campaign subdomain for it to work (this is all working on the V1 API)
client = ::ActiveCampaign::Client.new(
api_endpoint: 'https://[YOUR ACTIVE CAMPAIGN DOMAIN]/admin/api.php', # e.g. 'https://yourendpoint.api-us1.com/admin/api.php'
api_key: '[YOUR-API-KEY]')
@mhenrixon -- as a point of feedback, your code has lots of comments with important hidden details, which other developers (like me and the ones above) won't read when we're moving quickly. I'd recommend making some of this stuff more explicit in the actual code so that our editors show it as a color we should pay attention to (and not grey, signaling irrelevance.) just to make it easier to grok for people new to the gem.
from active_campaign.
also to debug the actual API, I had to do a little low-level monkey patching. Since the published version of the gem is currently old and I see that master is refactored, I won't bother making a pull request. As well, I see that on the new gem code there are already begin/rescue to handle this.
however, when working on v0.1.16, you will get crashes on client.rb line 71 if the JSON fails to parse.
To debug it, I had to re-write the method like to see the actual responses from the API:
I would highly recommend patterns like this when making wrappers because you can't anticipate all of the things that can (will) go wrong with these responses and it's probably best just to leave the responses spit back to us the developer to figure out where went wrong.
def request(method, api_method, data)
req = create_request method, api_method, data
response = HTTPI.send(method, req)
begin
response = JSON.parse(response.body)
rescue StandardError => e
puts "********* There was an error parsing the response from ActiveCampaign: #{response.inspect}"
raise(e)
end
normalize(response)
end
from active_campaign.
Related Issues (20)
- Error when using contact_add (but likely other endpoints too) HOT 5
- Automation Contact Remove HOT 1
- Getting "You are not authorized to access this file" error when calling list_list HOT 2
- Any plans on releasing a new version? HOT 9
- Is it possible to update custom fields HOT 6
- Upgrading to 3.0 HOT 6
- contact_sync method raising SSL error HOT 20
- undefined method `each_with_object' for "400":String
- Add endpoints for campaigns
- Add endpoints for contacts HOT 5
- Bundle Not Installing Latest Version HOT 1
- Add endpoints for calendar feeds
- Add endpoints for Branding
- Add endpoints for custom account fields
- Live tests failing on master HOT 2
- Using `Client` directly breaks following README examples HOT 1
- JSON Error HOT 1
- uninitialized constant ActiveCampaign::Client::Unreachable (NameError)
- "Undefined method `dependency`" when requiring the gem
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from active_campaign.