twitchdev / issues

Issue tracker for third party developers.
Apache License 2.0
73 stars 6 forks source link

Get Stream Markers: is not behaving as documented #314

Open BarryCarlyon opened 3 years ago

BarryCarlyon commented 3 years ago

Brief description

The documentation states ( https://dev.twitch.tv/docs/api/reference#get-stream-markers )

Get Stream Markers will return only the markers created by the authenticating user

However if you authenticate as the "channel owner" it would return all the Markers.

So I went to file a documentation bug. But tested my docs fix first

Which was when I found out that

Regardless of whom you authenticate it returns all markers created by everyone. But then it also nests all markers in all users that created a marker.

So you can't match who made which marker. And the documentation is wrong as the endpoint is not behaving

How to reproduce

I called

https://api.twitch.tv/helix/streams/markers?user_id=26610234

As myself and the broadcaster

The output was the same

{
    "data": [
        {
            "user_id": "15185913",
            "user_name": "BarryCarlyon",
            "user_login": "barrycarlyon",
            "videos": [
                {
                    "video_id": "917544120",
                    "markers": [
                        {
                            "id": "66dc7614ebac317037068064d3166de0",
                            "created_at": "2021-02-17T15:45:55.632608638Z",
                            "description": "test",
                            "position_seconds": 10487,
                            "URL": "https://twitch.tv/barrycarlyon/manager/highlighter/917544120?t=2h174m10487s"
                        },
                        {
                            "id": "7f02aa144515169fd5805524d29daae4",
                            "created_at": "2021-02-17T15:52:56.275821483Z",
                            "description": "TEST FOR BARRY",
                            "position_seconds": 10908,
                            "URL": "https://twitch.tv/theb0atman/manager/highlighter/917544120?t=3h181m10908s"
                        }
                    ]
                }
            ]
        },
        {
            "user_id": "53526221",
            "user_name": "theb0atman",
            "user_login": "theb0atman",
            "videos": [
                {
                    "video_id": "917544120",
                    "markers": [
                        {
                            "id": "66dc7614ebac317037068064d3166de0",
                            "created_at": "2021-02-17T15:45:55.632608638Z",
                            "description": "test",
                            "position_seconds": 10487,
                            "URL": "https://twitch.tv/barrycarlyon/manager/highlighter/917544120?t=2h174m10487s"
                        },
                        {
                            "id": "7f02aa144515169fd5805524d29daae4",
                            "created_at": "2021-02-17T15:52:56.275821483Z",
                            "description": "TEST FOR BARRY",
                            "position_seconds": 10908,
                            "URL": "https://twitch.tv/theb0atman/manager/highlighter/917544120?t=3h181m10908s"
                        }
                    ]
                }
            ]
        }
    ],
    "pagination": {}
}

Expected behavior

Given the nature of the broken ness of this endpoint, I'm really not sure.

BarryCarlyon commented 3 years ago

Same API call

Got another user to make a marker

{
    "data": [
        {
            "user_id": "53526221",
            "user_name": "theb0atman",
            "user_login": "theb0atman",
            "videos": [
                {
                    "video_id": "917544120",
                    "markers": [
                        {
                            "id": "66dc7614ebac317037068064d3166de0",
                            "created_at": "2021-02-17T15:45:55.632608638Z",
                            "description": "test",
                            "position_seconds": 10487,
                            "URL": "https://twitch.tv/barrycarlyon/manager/highlighter/917544120?t=2h174m10487s"
                        },
                        {
                            "id": "7f02aa144515169fd5805524d29daae4",
                            "created_at": "2021-02-17T15:52:56.275821483Z",
                            "description": "TEST FOR BARRY",
                            "position_seconds": 10908,
                            "URL": "https://twitch.tv/theb0atman/manager/highlighter/917544120?t=3h181m10908s"
                        },
                        {
                            "id": "ee10eefd55570d295f7c879e4deb7928",
                            "created_at": "2021-02-17T16:23:24.164696913Z",
                            "description": "end tip freefly cam",
                            "position_seconds": 12736,
                            "URL": "https://twitch.tv/kimen91/manager/highlighter/917544120?t=3h212m12736s"
                        }
                    ]
                }
            ]
        },
        {
            "user_id": "52796285",
            "user_name": "kimen91",
            "user_login": "kimen91",
            "videos": [
                {
                    "video_id": "917544120",
                    "markers": [
                        {
                            "id": "66dc7614ebac317037068064d3166de0",
                            "created_at": "2021-02-17T15:45:55.632608638Z",
                            "description": "test",
                            "position_seconds": 10487,
                            "URL": "https://twitch.tv/barrycarlyon/manager/highlighter/917544120?t=2h174m10487s"
                        },
                        {
                            "id": "7f02aa144515169fd5805524d29daae4",
                            "created_at": "2021-02-17T15:52:56.275821483Z",
                            "description": "TEST FOR BARRY",
                            "position_seconds": 10908,
                            "URL": "https://twitch.tv/theb0atman/manager/highlighter/917544120?t=3h181m10908s"
                        },
                        {
                            "id": "ee10eefd55570d295f7c879e4deb7928",
                            "created_at": "2021-02-17T16:23:24.164696913Z",
                            "description": "end tip freefly cam",
                            "position_seconds": 12736,
                            "URL": "https://twitch.tv/kimen91/manager/highlighter/917544120?t=3h212m12736s"
                        }
                    ]
                }
            ]
        },
        {
            "user_id": "15185913",
            "user_name": "BarryCarlyon",
            "user_login": "barrycarlyon",
            "videos": [
                {
                    "video_id": "917544120",
                    "markers": [
                        {
                            "id": "66dc7614ebac317037068064d3166de0",
                            "created_at": "2021-02-17T15:45:55.632608638Z",
                            "description": "test",
                            "position_seconds": 10487,
                            "URL": "https://twitch.tv/barrycarlyon/manager/highlighter/917544120?t=2h174m10487s"
                        },
                        {
                            "id": "7f02aa144515169fd5805524d29daae4",
                            "created_at": "2021-02-17T15:52:56.275821483Z",
                            "description": "TEST FOR BARRY",
                            "position_seconds": 10908,
                            "URL": "https://twitch.tv/theb0atman/manager/highlighter/917544120?t=3h181m10908s"
                        },
                        {
                            "id": "ee10eefd55570d295f7c879e4deb7928",
                            "created_at": "2021-02-17T16:23:24.164696913Z",
                            "description": "end tip freefly cam",
                            "position_seconds": 12736,
                            "URL": "https://twitch.tv/kimen91/manager/highlighter/917544120?t=3h212m12736s"
                        }
                    ]
                }
            ]
        }
    ],
"pagination": {}
}

All three users have all three markers