Can't access Stream analytics

Hello!

I’m trying to fetch some analytics data for one of the accounts I have access to.

I created an API Token with the following permissions:

XYZ - Stream:Read
    All zones - Analytics:Read

When I query the GraphQL endpoint, I receive an auth error:

{
    "data": null,
    "errors": [
        {
            "message": "not authorized for that account",
            "path": [
                "viewer",
                "accounts"
            ],
            "extensions": {
                "code": "authz",
                "timestamp": "2020-12-20T16:18:51.921589029Z"
            }
        }
    ]
}

The query I used:

query {  
    viewer {    
        accounts(filter: {      
            accountTag:"$ACCOUNT_ID"
        }) {      
            videoPlaybackEventsAdaptiveGroups(
                filter: {          
                    date_geq: "2020-09-01"       
                }        
                orderBy: [uid_ASC]        
                limit: 1000      
            ) {        
                count        
                sum {          
                    timeViewedMinutes        
                }        
                dimensions {          
                    uid        
                }      
            }    
        }  
    }
}

I checked the account tag and auth token. Both should be valid. I also have access to the XYZ account.
Am I missing some particular permission for the token?

Thank you!

I was having a similar issue, but after about 24 hours after generation, my token suddenly started working. Did you just recently generate your auth token?

I tested the token right after creation and after a few hours (and days). Same issue.

I added broader access scope and it seemed to do the trick. I still have to figure out how I can tighten the scope.

Thanks!

@radoslaw Stream videos belong to accounts, not zones. Allowing account-level analytics access should do the trick.

Thank you!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.