OneSignal / onesignal-python-api

Other
12 stars 6 forks source link

[Bug]: Include External User Ids Requires REST API KEY #27

Open vdiaza opened 7 months ago

vdiaza commented 7 months ago

What happened?

the param include_external_user_ids requires the REST API KEY. I have checked the documentation and I don't see how can I add it to the client.

I tried using this:

api_client = onesignal.ApiClient(config, "Authorization", f"Basic {api_key}")

But it does not send the headers to the API.

Anything am I missing?

Steps to reproduce?

notification = Notification(
                app_id="xxx",
                channel_for_external_user_ids="push",
                include_player_ids=None,
                include_external_user_ids=['xxx'],
                headings={"en": "Testing"},
                subtitle={"en": "Subtitulo"},
                contents={"en": "Contenido"},
            )

            client.create_notification(notification)

### What did you expect to happen?

To send it correctly

### Relevant log output

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

Code of Conduct

Innovat-ED commented 5 months ago

I have this same issue

markmelnic commented 3 weeks ago

Did you find a solution to this issue?