OneSignal / onesignal-python-api

Other
12 stars 6 forks source link

fix: query params isn't replaced by Endpoint class so no need to set … #33

Open vintersnow opened 4 months ago

vintersnow commented 4 months ago

Description

One Line Summary

Fix #32

Details

Motivation

query parameters that are passed to the Endpoint class were not removed. For example; When calling the export_events function, the API client send a request to the URL like https://onesignal.com/api/v1/notifications/4133437f-888c-4a6c-82af-a1d320ad8b31/export_events?app_id={app_id}. As app_id is not replaced, so that the server response 400 bad request error.

Scope

export_events and export_players will be fix.

OPTIONAL - Other

Testing

Manual testing

Confirm that the below code works

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)

Checklist

Overview

Testing

Final pass

vintersnow commented 3 months ago

@kesheshyan Hi, Could you check this?