arena icon indicating copy to clipboard operation
arena copied to clipboard

401 while reading private channels

Open sblbl opened this issue 10 months ago • 0 comments

Hello, I'm testing this library to automate some are.na actions, and in particular I'm trying to read and write blocks in channels. Here are my two functions:

from arena import Arena
with open(os.path.join('secrets', 'config.json')) as f:
	config = json.load(f)
	arena = Arena( config.get("arena_token")

async def get_arena_board(board_slug):
	try:
		board = arena.channels.channel(board_slug)
		logger.info(f"Board {board_slug} has {board.id} id\n{board}")
		items, page = board.contents()
		logger.info(f"Board {board_slug} has {len(items)} items: \n{items}")
		return items
	except Exception as e:
		logger.error(f"Error getting arena board: {e}")
		return None
async def post_to_arena_board(title, url):
  		channel = arena.channels.channel(board_slug)
		block = channel.add_block(content=title, source=url)
		block_id = block.id
		return block_id

post_to_arena_board() works perfectly with public and private channels, however get_arena_board() only lists blocks of public channels. For private ones i can log them as <arena.channels.Channel object at 0x1094854c0> but when I try to extract the content I get 401 Unauthorized. Am I doing something incorrrectly? The channel I'm testing on it's part of a groupt, I don't know if this helps.

Thanks in advance for the help 😊

sblbl avatar Feb 20 '25 14:02 sblbl