I am trying to access contacts via the API using the ruby gem in a Ruby on Rails app. Have a test workspace and have created an app in the developer portal in this workspace. Also generated an access token.
I am able to create a client object in the rails console.
However I get an authentication error when I try and make any calls to the api:
>1] pry(main)> intercom = Intercom::Client.new(token: ENVV'INTERCOM_TOKEN'], api_version: '2.9')
=> #<Intercom::Client:0x0000000130716a48
@api_version="2.9",
@base_url="https://api.intercom.io",
@handle_rate_limit=false,
@rate_limit_details={},
@timeouts={:open_timeout=>30, :read_timeout=>90},
@token="'***************************************">
>2] pry(main)> intercom.contacts.find(id: '56f0399fc1f09a1bf6000200')
Intercom::AuthenticationError: Unauthorized
from /Users/dsingh/.rbenv/versions/2.7.6/lib/ruby/gems/2.7.0/gems/intercom-4.2.1/lib/intercom/request.rb:164:in `raise_errors_on_failure'
Is there some other configuration needed for authentication.
(I am able to make calls successfully via the API Explorer by the way but want to do wholesale deletion of all users and import a fresh set so want to be able to loop through each contact)