dylanjha
dylanjha

Reputation: 2523

Balanced 403 Unauthorized

What am I doing wrong here? Using this gem with Rails: https://github.com/balanced/balanced-ruby

gem 'balanced'

config/initializers/balanced.rb

Balanced.configure("<%= ENV['BALANCED_SECRET_KEY'] %>")

Every request I make to a balanced endpoint comes back unauthorized.

Balanced::BankAccount.find('/v1/bank_accounts/BA6gbZuQlDs3GsavKj8iiDhu')

returns:

Balanced::Forbidden: Balanced::Forbidden(403)::Forbidden:: GET https://api.balancedpayments.com/v1/bank_accounts/BA6gbZuQlDs3GsavKj8iiDhu: not-authorized: Not permitted to perform show on bank_accounts. Your request id is OHM42265044840811e3abd7026ba7c1aba6.

How should I authenticate this request?

Upvotes: 1

Views: 119

Answers (1)

dylanjha
dylanjha

Reputation: 2523

Stupid mistake. Using erb tags in my initializer for no reason... Too tired for this. Should be:

Balanced.configure(ENV['BALANCED_SECRET_KEY'])

Upvotes: 1

Related Questions