WebexCommunity/WebexPythonSDK

Cannot set `be_geo_id`

fbradyirl opened this issue · 2 comments

Version 1.6

Trying to set an attribute in the user agent, but I get a key error.

  File "/Users/fibrady/projects/core/venv/lib/python3.9/site-packages/webexteamssdk/api/__init__.py", line 182, in __init__
    self._session = RestSession(
  File "/Users/fibrady/projects/core/venv/lib/python3.9/site-packages/webexteamssdk/restsession.py", line 230, in __init__
    "User-Agent": user_agent(be_geo_id=be_geo_id, caller=caller),
  File "/Users/fibrady/projects/core/venv/lib/python3.9/site-packages/webexteamssdk/restsession.py", line 155, in user_agent
    data["organization"]["be_geo_id"] = be_geo_id
KeyError: 'organization'

data["organization"] does not exist. See https://github.com/CiscoDevNet/webexteamssdk/blob/49a0a0d07d8d7c11abdf599396c814455261cc76/webexteamssdk/restsession.py#L155

E.g.

        self.tracking_id = f"{str(uuid.uuid4())}".upper()
        self.teams = WebexTeamsAPI(access_token=access_token,
                                   be_geo_id=self.tracking_id)

Merged the PR. Thanks for the contribution @fbradyirl! Closing the issue.