GLBasic forum

Main forum => Off Topic => Topic started by: Schranz0r on 2017-May-30

Title: Twitch API v5 anyone have a clue?
Post by: Schranz0r on 2017-May-30
Hi guys,

anyone have a clue how to get the access-token from the TwitchAPI v5?
This is the link: https://dev.twitch.tv/docs/v5/guides/authentication/

I have all things together to sent my stuff to Twitch, but HOW? :D

NETWEBGET is not working for me...
I don't know,is it possible with Sockets?

For the case i/we can send it to twitchAPI, we need the returned URL with the access-token in it.  :puke:

Connection to the TwitchIRC was easy, but this...
Title: Re: Twitch API v5 anyone have a clue?
Post by: r0ber7 on 2017-May-31
I would suggest reading up on OAuth 2 authentication. It's counterintuitive at first. There are many libraries in PHP that take care of this low-level problem. Of course, GLBasic, you would have to write your own.

On the other hand, it seems they explain right on the page you sent:

GET https://api.twitch.tv/kraken/oauth2/authorize
    ?client_id=<your client ID>
    &redirect_uri=<your registered redirect URI>
    &response_type=code
    &scope=<space-separated list of scopes>
Title: Re: Twitch API v5 anyone have a clue?
Post by: WPShadow on 2017-May-31
The question is how to get the information with the GLBasic network commands... Is that possible?
Title: Re: Twitch API v5 anyone have a clue?
Post by: spacefractal on 2017-May-31
property also require https. im not sure its works with https. Howover a php based might also works and communicate to that and let glbasic such a script.

On iOS im would property use xcode directly.
Title: Re: Twitch API v5 anyone have a clue?
Post by: Schranz0r on 2017-Jun-01
One option is CURL, maybe i write a DLL-Wrapper for this one.
Any other opinions?
Title: Re: Twitch API v5 anyone have a clue?
Post by: r0ber7 on 2017-Jun-05
I would set up a PHP relay. So I could use NETWEBGET on the PHP site, and it would use a PHP library which is made for the Twitch API, like this:

Code (glbasic) Select

        NETWEBGET("www.example.com", "/page.php?get_certificate=1", 80, "twitch_response.txt")



This is a universal PHP interface designed specifically to connect to and interact with the twitch.tv Kraken API servers. It was designed with the intention of being very controlled, safe and light for both the user server and the Kraken API servers. Almost, if not all capable calls are coded directly into the interface, allowing the interface to perform almost, if not all functions that the API allows. Any functions that you believe need to be added or improved can be done via a pull request or opening up an issue.

Currently this interface supports all V5 API calls.


https://github.com/IBurn36360/Twitch_Interface (https://github.com/IBurn36360/Twitch_Interface)

The relay would cause an extra network latency, but it would save you from having to reinvent the wheel I think.