@prueba88888 twurl actually uses the same oauth gem so both approaches should be the same unless you’re using different user tokens (access tokens).
The only thing that would cause you to see different responses on GET /accounts would be if you did indeed use a different user token in twurl then you are in your own application. To be sure you’re making the twurl request under the right user, you can run twurl accounts to see the default being used.
For example:
~ ❯ twurl accounts
brandonmblack
OIDntXZULiYrCzSBq23BQ (default)
On a related note, have you checked out the Ads API SDK for Ruby from Twitter? Accessing a specific account object or enumerating all accounts available to the user token using the Ruby SDK is quite simple.
# installing the latest release
gem install twitter-ads
require 'twitter-ads'
# initialize the client
client = TwitterAds::Client.new(
CONSUMER_KEY,
CONSUMER_SECRET,
ACCESS_TOKEN,
ACCESS_TOKEN_SECRET
)
# iterate through all accounts available to your access token
client.accounts.each do |account|
# do something
end
# load a specific advertiser account instance
account = client.accounts('c3won9gy')