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

Conform to API spec for Sub Reads and Updates #28

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jptreen
Copy link

@jptreen jptreen commented May 9, 2024

The API Docs specify either an ID or an email are allowed for fetching and updating a subscriber. This client doesn't allow a subscriber_id in either case. I've fixed that.

I attempted to update the test suite to test out the regex and the new control flow, but I discovered that about 40% of the tests are currently failing, so I guess this is a WIP? I've left it alone (I did, however, update the test requirements file as it was missing a dependency).

Fetch: https://developers.mailerlite.com/docs/subscribers.html#fetch-a-subscriber

GET https://connect.mailerlite.com/api/subscribers/(:id or :email)

https://developers.mailerlite.com/docs/subscribers.html#update-a-subscriber

PUT https://connect.mailerlite.com/api/subscribers/(:id)
  • I've updated the regex to allow an int, and pulled the regexes out of the methods and popped them at the top of the class.
  • The 'update' method of subscribers was using the POST, which is also used by the 'create' method, which I've updated to better reflect the API spec.

@jptreen
Copy link
Author

jptreen commented May 17, 2024

Added in a refactor for parsing query params to improve code reuse, and fixed segments.py so you can now view subscriber listing for segments.

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 this pull request may close these issues.

None yet

1 participant