Trying to read the positions on paper mode to test run my bot

I am developing a trading bot . I am trying to run it in the paper account. Apparently the Api key is not allowing to get the position

The following does not work?
from alpaca.trading.client import TradingClient
trading_client = TradingClient(key, secret, paper=True)
positions = trading_client.get_all_positions()
for position in positions:
NOTE: a single tab indents this–> print(position)