OneSignal / onesignal-python-api

Other
12 stars 6 forks source link

[Bug]: Showing "Please include a case-sensitive header......" even if the api key included #26

Closed mohammed-algh closed 7 months ago

mohammed-algh commented 7 months ago

What happened?

Showing: "Please include a case-sensitive header of Authorization: Basic \u003cYOUR-REST-API-KEY-HERE\u003e or Bearer token=\"\u003cYOUR-REST-API-KEY-HERE\u003e\" with a valid REST API key."],"reference":["https://documentation.onesignal.com/docs/accounts-and-keys#section-keys-ids"

even if the API key included in the configuration

Steps to reproduce?

1. Put if condition for checking if API key is exist or not

if self.api_key is not None:
        auth['app_key'] = {
        'type': 'bearer',
        'in': 'header',
        'key': 'Authorization',
        'value': 'Bearer ' + self.api_key
    }

the code should be under user_key condition in configuration auth variable assign

What did you expect to happen?

Calling API using api_key should return the endpoint's response

Relevant log output

No response

Code of Conduct