maximadeka / convertkit-ruby Goto Github PK
View Code? Open in Web Editor NEWA Ruby gem that wraps the ConvertKit API v3
Home Page: https://tomobloq.com
License: MIT License
A Ruby gem that wraps the ConvertKit API v3
Home Page: https://tomobloq.com
License: MIT License
Right now, this gem doesn't do any error handling. This introduces inconsistent behaviour in case of errors:
irb(main):001:0> client = Convertkit::Client.new
#<Convertkit::Client:0x00007f96030ecc20 @api_secret=nil, @api_key=nil>
irb(main):002:0> client.forms
nil
irb(main):003:0> client.custom_fields
nil
irb(main):004:0> client.subscribers
{
:method => :get,
:body => {
"error" => "Authorization Failed",
"message" => "API Key not present"
},
... # this is Faraday::Response
irb(main):005:0> client.account
{
"error" => "Authorization Failed",
"message" => "API Key not present"
}
I could handle this in my own wrapper around this gem, but it would be much easier to handle errors directly in the gem. In that case we could raise errors based on on HTTP response, like:
Convertkit::AuthorizationError
for HTTP 401Convertkit::ServerError
for HTTP 500Convertkit::BadRequest
for HTTP 422Convertkit::ConnectionFailed
instead of Faraday::ConnectionFailed
@rkcudjoe Would you accept a PR which implements this?
Hey!
I just stumbled upon your library and I wanted to contribute. I just realized that the spec aren't mocking the HTTP calls, is it OK if I add webmock for example? That'd be easier to contribute then.
Please let me know what you think :)
If I grab this gem from RubyGems.org with v0.0.2, alot of the changes including Form
and Account
are not included in the gem.
Currently I need to define in my Gemfile
file as follows:
gem 'convertkit-ruby', git: 'https://github.com/HookOps/convertkit-ruby', require: 'convertkit'
Can you please update the gem version on RubyGems.org?
Hi @rkcudjoe
I've noticed your gem is missing support for webhooks. I'm happy to contribute.
Do you accepts PRs?
Cheers
Definition in module Subscriber on line 31 is
def remove_tag_from_subscriber(subscriber_id, tag_id)
Definition in module Tags on line 17 is
def remove_tag_from_subscriber(tag_id, subscriber_id)
Which may lead to confusion.
Can we get a new release please? The current version of this gem on RubyGems.org is over 3 years old. A lot of new stuff has been added in that time, including the #remove_tag_from_subscriber
method which I'd like to use.
Update README to show new installation instructions
Yank library from RubyGems and release package on GitHub
Update README to show that custom_field actions are now available as methods on the client object.
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.