Comments (3)
we apply app access token or user access token automatically before sending requests...
from helix.
Yep, we already do this by default: https://github.com/nicklaw5/helix/blob/master/helix.go#L383-L393
from helix.
Hey, this doesn't seem to work as you say. I have this code:
if time.Now().After(authExpiry) {
authExpiry = time.Now()
res, err := twitch.GetAppAccessToken()
exitIfError(err)
authExpiry = authExpiry.Add(time.Duration(res.Data.ExpiresIn) * time.Second)
log.Insta <- fmt.Sprintf("< | token generated: %s (for %ds)", res.Data.AccessToken, res.Data.ExpiresIn)
}
res, err := twitch.GetStreams(&getStreamsParams)
if err == nil && res.StatusCode != 200 { // reinterpret HTTP error as actual error
err = fmt.Errorf("HTTP %d: %s", res.StatusCode, res.ErrorMessage)
}
if err != nil {
log.Insta <- fmt.Sprintf("x | < : %s", err)
}
and my program output
< | token generated: pfzn88vavmt9hlgy6c33aonf2imako (for 5444223s)
x | < : HTTP 401: OAuth token is missing
during the migration test window that just ended (is back to normal now). Any ideas?
from helix.
Related Issues (20)
- Allow querying multiple channels with `GetChannelInformation`
- Proposal: Add option to pass in state for each API request HOT 5
- Proposal: Add default rate limit function HOT 2
- Client does not use AppAccessToken on calls that must use AppAccessToken HOT 4
- missing api endpoints
- Need to add VodOffset. HOT 2
- Latest Release is 12.13.0 not 2.13.0 HOT 1
- Endpoint errors but returned error is nil
- Support `tags` for the stream resource HOT 1
- Implement Schedule endpoints
- Auto Refreshing Access Tokens
- Update follows endpoint to new version HOT 1
- When scope for endpoint is missing in the access token, it gets locked in a loop refreshing the access token
- Proposal: Context for methods, not for struct itself
- GetBlockedTerms() does not use provided data HOT 2
- AddBlockedTerm() does not use provided data HOT 2
- Add send message endpoint request
- GetBannedUsers() returns nothing HOT 14
- event EventSubChannelPredictionEndEvent json ended_at typo HOT 1
- Most recent patch release broke "API" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from helix.