Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid delayed_option on SegmentNotification #10

Open
evaldez89 opened this issue Nov 21, 2021 · 0 comments · May be fixed by #11
Open

Invalid delayed_option on SegmentNotification #10

evaldez89 opened this issue Nov 21, 2021 · 0 comments · May be fixed by #11

Comments

@evaldez89
Copy link

client = OneSignal(app_id, api_key)
notification_to_all_users = SegmentNotification(
    headings={
        "es": "Hello From Python"
    },
    contents={
        "en": "Python OneSignal Push Notification"
    },
    included_segments=["Test Users"]
)
response = client.send(notification_to_all_users)
details = client.details(notification_to_all_users)

print(response)

Result:

Traceback (most recent call last):
  File "openapi.py", line 20, in <module>
    response = client.send(notification_to_all_users)
  File "/home/user/.pyenv/versions/3.8.1/lib/python3.8/site-packages/onesignal/core.py", line 77, in send
    response = self.request("post", "notifications", json=data)
  File "/home/user/.pyenv/versions/3.8.1/lib/python3.8/site-packages/onesignal/core.py", line 48, in request
    raise OneSignalAPIError(r.json())
onesignal.errors.OneSignalAPIError: {'errors': ['invalid delayed_option'], 'success': False}

Expected Result:

print(response)
# {'id': '6xxxxxc7-5fxxx-4sxx-bea8-02f728xxxx02', 'recipients': 1, 'external_id': None}
print(response.status_code)
# 200 (OK)
@evaldez89 evaldez89 linked a pull request Nov 21, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant