'how do I get the slack channels list from python REPL?

I'm getting started with slack API using python. I tried to get my slack channels using Tokens in the python REPL using the following code:

import os
from slackclient import SlackClient

SLACK_TOKEN = os.environ.get('SLACK_TOKEN')
slack_client = SlackClient(SLACK_TOKEN)
channels_call = slack_client.api_call("channels_list")

but got an error message:

    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source