TwitchApi.Entitlements.RedeemCode (TwitchApi v0.1.2) View Source

⛔ This module is autogenerated please do not modify manually.

Example request from twitch api docs:

descriptions:

requests:

curl -X POST 'https://api.twitch.tv/helix/entitlements/codes?code=8CD5P-V3J92-2S6JY&code=PUN4G-HYFVP-MMFET'
-H'Authorization: Bearer cfabdegwdoklmawdzdo98xt2fo512y'
-H'Client-Id: uo6dggojyb8d6soh92zknwmi5ej1q2'

Example response from twitch api docs:

descriptions:

responses:

{"data":[{"code":"8CD5P-V3J92-2S6JY","status":"SUCCESSFULLY_REDEEMED"},{"code":"PUN4G-HYFVP-MMFET","status":"ALREADY_CLAIMED"}]}

Link to this section Summary

Types

The code to redeem to the authenticated user’s account.A fifteen character (plus optional hyphen separators) alphanumeric string, e.g. ABCDE-12345-FGHIJRepeat this query parameter additional times to redeem multiple codes.Ex: ?code=code1&code=code21-20 code parameters are allowed.

Represents a numeric Twitch user ID.The user account which is going to receive the entitlement associated with the code.

Functions

Description:

Redeems one or more provided codes to the authenticated Twitch user. This API requires that the caller is an authenticated Twitch user. This API requires that the caller is an authenticated Twitch user. The API is throttled to one request per second per authenticated user.

Link to this section Types

Specs

code() :: %{code: String.t()}

The code to redeem to the authenticated user’s account.A fifteen character (plus optional hyphen separators) alphanumeric string, e.g. ABCDE-12345-FGHIJRepeat this query parameter additional times to redeem multiple codes.Ex: ?code=code1&code=code21-20 code parameters are allowed.

Specs

user_id() :: %{user_id: integer()}

Represents a numeric Twitch user ID.The user account which is going to receive the entitlement associated with the code.

Link to this section Functions

Specs

call(code() | user_id()) :: {:ok, Finch.Response.t()} | {:error, Exception.t()}

Description:

Redeems one or more provided codes to the authenticated Twitch user. This API requires that the caller is an authenticated Twitch user. This API requires that the caller is an authenticated Twitch user. The API is throttled to one request per second per authenticated user.

Required authentication:

Access is controlled via an app access token on the calling service. The client ID associated with the app access token must be approved by Twitch.

Required authorization:

Callers with an app access token are authorized to redeem codes on behalf of any Twitch user account.