feat: add get_live_match_events for the DataCore /live PBP endpoint - #31
Open
mad4ms wants to merge 1 commit into
Open
feat: add get_live_match_events for the DataCore /live PBP endpoint#31mad4ms wants to merge 1 commit into
mad4ms wants to merge 1 commit into
Conversation
The /live play-by-play endpoint needs the read:organization_live scope on top of read:organization; without it the API returns a 403 explicit-deny rather than an auth error, which looks like a broken token refresh until you notice the plain PBP endpoint still works. Verified live against org h1s44: requesting both scopes issues a token that the /live endpoint accepts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HandballAPI.get_live_match_events, wrapping the generatedfixture_pbp_list_live(/handball/o/{org}/fixtures/{fixture_id}/playbyplay/live) endpoint the same wayget_match_eventswraps the non-live PBP export./liveneedsread:organization_livein addition toread:organization. Without it, the API returns403with"explicit deny in an identity-based policy"— not a normal auth failure, so it's easy to mistake for a broken token refresh.h1s44: a token requested with both scopes is accepted by/live; the same token without the extra scope is denied even though every other endpoint keeps working normally.Changes
src/sportradar_datacore_api/handball.py: newget_live_match_events(match_id, *, limit=1000, offset=None), mirroringget_match_events's shape and error handling.test/test_handball.py:apifixture now requestsread:organization_livetoo; addedtest_live_fixture_events.docs/api-reference.md,README.md: document the new method and the scope requirement.Test plan
uv run ruff check src testuv run mypy src/sportradar_datacore_apiuv run pytest(6/6 passed against the live API, including the new live-PBP test)read:organizationalone ->403explicit-deny on/live;read:organization+read:organization_live->200with real live PBP events.