WebexCommunity / WebexPythonSDK

Work with the Webex APIs in native Python!
https://webexcommunity.github.io/WebexPythonSDK/
MIT License
236 stars 152 forks source link

api.rooms.list() returns nothing #87

Closed SelComputas closed 5 years ago

SelComputas commented 5 years ago

I am trying to set up an App Engine proxy in which I would like to post messages to a Webex space. However, when trying to get the room list for a bot api.rooms.list, thought to take care of publishing the messages in the Webex space, I receive nothing.

The code looks like this:

from webexteamssdk import WebexTeamsAPI

bot_token = '<bot token>'

def get_rooms():
    api = WebexTeamsAPI(access_token=bot_token)

    all_rooms = api.rooms.list()
    for room in all_rooms:
        print(room)

if __name__ == '__main__':
    get_rooms()    

If I use my personal access token I get the rooms that I am currently a part of. I think I have added the bot to a room, 'proven' by posting messages from it using the Incoming webhooks API: https://apphub.webex.com/teams/applications/incoming-webhooks-cisco-systems

SelComputas commented 5 years ago

It literally started working overnight, after changing nothing.