Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Got error saying api_key not found #297

Closed
swriddle opened this issue May 13, 2020 · 1 comment
Closed

Got error saying api_key not found #297

swriddle opened this issue May 13, 2020 · 1 comment

Comments

@swriddle
Copy link

I define a rake task as this:

  task dev: :environment do
    api_key = ENV.fetch("MAILCHIMP_API_KEY")
    puts "is the api key even defined? #{api_key}"
    gibbon = Gibbon::Request.new(api_key: api_key, symbolize_keys: true, debug: true)
    data = gibbon.lists.retrieve
    puts "response? #{data}"
  end
% bundle exec rake email:dev
is the api key even defined? [[hex formatted api key]]
rake aborted!
Gibbon::GibbonError: You must set an api_key prior to making a call

The exception points to the data = gibbon.lists.retrieve line. What am I doing wrong here?

@swriddle
Copy link
Author

I didn't realize the server indicator at the end of the api key was part of it. Adding that back resolves the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant