i wanna create a subscribe to a specific channel,and if someone follow this channel or start stream with specific game,i wanna get notification that someone go online or follow me …
i already create the subscribe request with c# in unity
public IEnumerator GetNotification()
{
// POST https://api.twitch.tv/helix/webhooks/hub
string _link = "https://api.twitch.tv/helix/webhooks/hub";
_link += "?hub.topic=https://api.twitch.tv/helix/streams?user_id=454392228";
_link += "&hub.lease_seconds=86400";
_link += "&hub.callback=http://test/webhook/TwitchWebhook.js";
_link += "&hub.mode=subscribe";
_link += "&hub.secret=123456789";
Debug.Log(_link);
UnityWebRequest request = new UnityWebRequest(_link, "POST");
request.SetRequestHeader("Authorization", "Bearer 7xaxy9dkaahitq6mt4uuylnzo72j5v");
request.SendWebRequest();
while (!request.isDone)
{
yield return null;
}
Debug.Log("Response code :" + request.responseCode);
i get 202 response ,but i don’t know how to menage the POST request that i get from twitch if my condition in already true … i wanna create this server with node JS … someone help me !!!