telstra/MessagingAPI-SDK-python

Fails to get Oauth token

slinkymanbyday opened this issue · 1 comments

The following class only takes in 3 arguments, however when I tried using this library, the Telstra Oauth service returns an extra piece of data (scope), as such I get this error:

return TToken(**json.loads(response.read().decode()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: TToken.__init__() got an unexpected keyword argument 'scope'

Given the arguments are passed in dynamically, it should probably look something more like the following to prevent breakages:

def __init__(self, access_token: str, token_type: str, expires_in: str, **_kwargs):

https://github.com/telstra/MessagingAPI-SDK-python/blob/release/messaging-v3/telstra/messaging/oauth.py#L31

This issue is resolved. Please re-install telstra.messaging with the latest version 3.3.5: https://pypi.org/project/telstra.messaging/3.3.5

pip uninstall telstra.messaging
pip install telstra.messaging