Current section

Files

Jump to
scrapped_twitch_api lib resources streams get_stream_key.ex
Raw

lib/resources/streams/get_stream_key.ex

defmodule TwitchApi.Streams.GetStreamKey do
@moduledoc """
⛔ This module is autogenerated please do not modify manually.
## Example request from twitch api docs:
### descriptions:
### requests:
curl -X GET 'https://api.twitch.tv/helix/streams/key'
-H'Authorization: Bearer cfabdegwdoklmawdzdo98xt2fo512y'
-H'Client-Id: uo6dggojyb8d6soh92zknwmi5ej1q2'
## Example response from twitch api docs:
### descriptions:
### responses:
{"data":[{"stream_key":"live_44322889_a34ub37c8ajv98a0"},]}
"""
alias TwitchApi.MyFinch
alias TwitchApi.ApiJson.Template.Method.Headers
@doc """
### Description:
Gets the channel stream key for a user.
### Required authentication:
User OAuth token
Required scope: channel:read:stream_key
### Required authorization:
"""
# User ID of the broadcaster
@type broadcaster_id :: %{required(:broadcaster_id) => String.t()}
# Map containing the user needed information for the user OAuth access token fetch
@type user_info :: %{user_id: integer | binary} | %{user_name: binary}
@spec call(broadcaster_id, user_info) :: {:ok, Finch.Response.t()} | {:error, Exception.t()}
def call(%{broadcaster_id: broadcaster_id}, user_info) do
MyFinch.request(
"GET",
"https://api.twitch.tv/helix/streams/key?broadcaster_id=#{broadcaster_id}",
Headers.config_oauth_headers(user_info),
nil
)
end
end