Unable to access Ad Stats using Twurl



I have been trying to access ads analytics using twurl. I am able to successfully authenticate and get token and secret that work successfully with Postman. However, I am not able to access the end points using twurl. When I give this command twurl -H “ads-api.twitter.com” “/4/accounts” I get this error

{“errors”:[{“code”:“UNAUTHORIZED_ACCESS”,“message”:“This request is not properly authenticated”}],“request”:{“params”:{}}}

I don’t know why this is not working. Can some one help me with sending an API call using twurl or curl?



Did the authorize command complete successfully - Setting up Twurl?

twurl authorize --consumer-key key --consumer-secret secret

If so, can you confirm that the correct account is selected as the (default) for

twurl accounts

You can use twurl set default [account_name] [consumer-key] to change the default.



Many thanks @osowskit1 that did the magic!!