Improve Doc "Create a subscription" for EventSub
In https://dev.twitch.tv/docs/eventsub step "5. Return the value of challenge from the callback verification request to complete the verification process. Your response must be a raw string. If your server is using a web framework, be careful that your web framework isn’t modifying the response in an incompatible way. For example, some web frameworks default to converting responses into JSON objects.
pogchamp-kappa-360noscope-vohiyo"
It is not understandable where need to send challenge variable, on what api endpoint? Please maybe add a curl example
We’ve updated the documentation, so this issue may be resolved.
-
GreybeardTV commented
I think I can explain this for you actually as it seems more a misunderstanding you may have regarding the http request process =)
See, if an http request is sent to a server, it sends you the response and that's the data you get. If I sent a request to a dadjoke api=>the text I receive back is the dadjoke.
If I try to load a webpage I'm sending a GET request and the response is the page data.
If your server hosts a page that says "hello world", I open a page via a GET http request, and the response is the page that says "hello world"
In step 1 when _you_ send an http request(a POST request to https://api.twitch.tv/helix/eventsub/subscriptions), the server sends the response shown in step 2. Twitch didn't try to send you a curl command or its own http request, it just responded over the http connection you opened, and then closed the connection.
Request->Response
You sent a request, Twitch responded
So on step 3 because this is a webhook, it's Twitch's turn to send your server a request.(in the examples case a POST request to https://example.com/webhooks/callback) and so in step 5, it's time for _you_ to respond. There isn't an endpoint this is just what you display back to twitch from their http request. No curl request, etc.
Request->Response
Twitch opened an http request with your server, you need to respond with the data =) Tell twitch "hello world", etc