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

[Bug]: export_events fail because of invalid url #32

Open
1 task done
vintersnow opened this issue Feb 22, 2024 · 0 comments · May be fixed by #33
Open
1 task done

[Bug]: export_events fail because of invalid url #32

vintersnow opened this issue Feb 22, 2024 · 0 comments · May be fixed by #33
Labels
bug Something isn't working

Comments

@vintersnow
Copy link

vintersnow commented Feb 22, 2024

What happened?

I tried to call the export_events endpoint, and an error occurs.

Steps to reproduce?

import onesignal
from onesignal.api import default_api
from pprint import pprint

app_id = "" # The ID of the app that the notification belongs to. 
notification_id = "" # The ID of the notification to export events from. 
app_key = ""
configuration = onesignal.Configuration(
    app_key = app_key,
)

with onesignal.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = default_api.DefaultApi(api_client)

    # example passing only required values which don't have defaults set
    try:
        # Export CSV of Events
        api_response = api_instance.export_events(notification_id, app_id)
        pprint(api_response)
    except onesignal.ApiException as e:
        print("Exception when calling DefaultApi->export_events: %s\n" % e)

Then below error happen

xception when calling DefaultApi->export_events: Status Code: 400
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Date': 'Thu, 22 Feb 2024 08:57:21 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'x-runtime': '0.002893', 'x-frame-options': 'SAMEORIGIN', 'x-xss-protection': '1; mode=block', 'x-content-type-options': 'nosniff', 'x-download-options': 'noopen', 'x-permitted-cross-domain-policies': 'none', 'referrer-policy': 'strict-origin-when-cross-origin', 'vary': 'Accept, Origin', 'cache-control': 'no-cache', 'x-request-id': '24318108-c138-4520-bf22-0e84df5d69b9', 'Via': '1.1 google', 'Alt-Svc': 'h3=":443"; ma=86400', 'CF-Cache-Status': 'DYNAMIC', 'Set-Cookie': '__cf_bm=VSykhFk5JQx4HQvlhEMUvUFmajyxkI.NtRLfAprxPfA-1708592241-1.0-AfV/2RSdnw2A11iY6ZRNMoGTvqYRDSETTQcEgm7f4BqhcYCXXkwujUGhh8J+4CvUdb2fS68dKJ5wAbswEC5RmIo=; path=/; expires=Thu, 22-Feb-24 09:27:21 GMT; domain=.onesignal.com; HttpOnly; Secure; SameSite=None', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains', 'Server': 'cloudflare', 'CF-RAY': '85960563e8ad7378-NRT'})
HTTP response body: {"errors":["Invalid app_id format"]}

What did you expect to happen?

Success to call the endpoint

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@vintersnow vintersnow added the bug Something isn't working label Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant