TwitchApi.EventSub.CreateEventSubSubscription (TwitchApi v0.1.3) View Source
⛔ This module is autogenerated please do not modify manually.
Example request from twitch api docs:
descriptions:
This example adds a user.update subscription.
requests:
curl -X POST 'https://api.twitch.tv/helix/eventsub/subscriptions'
-H'Authorization: Bearer 2gbdx6oar67tqtcmt49t3wpcgycthx'
-H'Client-Id: wbmytr93xzw8zbg0p1izqyzzc5mbiz'
-H'Content-Type: application/json'
-d'{"type":"user.update","version":"1","condition":{"user_id":"1234"},"transport":{"method":"webhook","callback":"https://this-is-a-callback.com","secret":"s3cre7"}}'
Example response from twitch api docs:
descriptions:
responses:
{"data":[{"id":"26b1c993-bfcf-44d9-b876-379dacafe75a","status":"webhook_callback_verification_pending","type":"user.update","version":"1","condition":{"user_id":"1234"},"created_at":"2020-11-10T14:32:18.730260295Z","transport":{"method":"webhook","callback":"https://this-is-a-callback.com"},"cost":1}],"total":1,"total_cost":1,"max_total_cost":10000}
Twitch CLI example that adds a user.update subscription.
twitch api post /eventsub/subscriptions -b'{"type":"user.update","version":"1","condition":{"user_id":"1234"},"transport":{"method":"webhook","callback":"https://this-is-a-callback.com","secret":"s3cre7"}}'
Link to this section Summary
Functions
Description:
Creates an EventSub subscription.
Link to this section Functions
Specs
call( %{ condition: String.t(), transport: String.t(), type: String.t(), version: String.t() } | nil ) :: {:ok, Finch.Response.t()} | {:error, Exception.t()}
Description:
Creates an EventSub subscription.
Required authentication:
Requires an app access token. To create a subscription, you must use an app access token; however, if the subscription type requires user authorization, the user must have granted your app permissions to receive those events before you subscribe to them. For example, to subscribe to channel.subscribe events, the user must have granted your app permission which adds the channel:read:subscriptions scope to your app’s client ID.