entitlements - YoYoGames/GMEXT-Twitch GitHub Wiki

Entitlements

Functions

These are the functions of this module:



Back To Top

twitch_ccls_get_content_classification_labels

Twitch Endpoint: Get Content Classification Labels

This function gets information about Twitch content classification labels.

This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Success Callback, or Failure Callback.


Syntax:

twitch_ccls_get_content_classification_labels(optionals, callback_success, callback_failed)
Argument Type Description
optionals Struct The optional parameters to be passed into the function:

- locale : String : Locale for the Content Classification Labels. You may specify a maximum of 1 locale. Default: "en-US". Supported locales: "bg-BG", "cs-CZ", "da-DK", "da-DK", "de-DE", "el-GR", "en-GB", "en-US", "es-ES", "es-MX", "fi-FI", "fr-FR", "hu-HU", "it-IT", "ja-JP", "ko-KR", "nl-NL", "no-NO", "pl-PL", "pt-BT", "pt-PT", "ro-RO", "ru-RU", "sk-SK", "sv-SE", "th-TH", "tr-TR", "vi-VN", "zh-CN", "zh-TW"
callback_success Function Triggered if the request succeeded
callback_failed Function Triggered if the request failed



Returns:

N/A


Triggers:

Success Callback

These members are returned in the success callback:

Member Type Description
data Array A list that contains information about the available content classification labels.
 └── content_classification_labels Array The list of CCLs available.
         ├── id String Unique identifier for the CCL.
         ├── description String Localized description of the CCL.
         └── name String Localized name of the CCL.

Failure Callback

This method is triggered on failure.




Back To Top

twitch_entitlements_get_drops_entitlements

Twitch Endpoint: Get Drops Entitlements

This function gets an organization's list of entitlements that have been granted to a game, a user, or both.

Note

Entitlements returned in the response body data are not guaranteed to be sorted by any field returned by the API. To retrieve CLAIMED or "FULFILLED" entitlements, use the fulfillment_status parameter to filter results. To retrieve entitlements for a specific game, use the game_id parameter to filter results.

Note

Requires an app access token or user access token. The client ID in the access token must own the game.

The following table identifies the request parameters that you may specify based on the type of access token used.

Member Type Description
App None If you don't specify request parameters, the request returns all entitlements that your organization owns.
App user_id The request returns all entitlements for any game that the organization granted to the specified user.
App user_id, game_id The request returns all entitlements that the specified game granted to the specified user.
App game_id The request returns all entitlements that the specified game granted to all entitled users.
User None If you don't specify request parameters, the request returns all entitlements for any game that the organization granted to the user identified in the access token.
User user_id Invalid.
User user_id, game_id Invalid.
User game_id The request returns all entitlements that the specified game granted to the user identified in the access token.

This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Success Callback, or Failure Callback.


Syntax:

twitch_entitlements_get_drops_entitlements(optionals, callback_success, callback_failed)
Argument Type Description
optionals Struct The optional parameters to be passed into the function:

- id : String or Array of String : An ID that identifies the entitlement to get. Pass an array of IDs to get multiple entitlements. You may specify a maximum of 100 IDs.
- user_id : String : An ID that identifies a user that was granted entitlements.
- game_id : String : An ID that identifies a game that offered entitlements.
- fulfillment_status : String : The entitlement's fulfillment status. Used to filter the list to only those with the specified status. Possible values are: "CLAIMED", "FULFILLED"
- after : String : The cursor used to get the next page of results. The Pagination struct in the response contains the cursor's value. Read more
- first : Real : The maximum number of entitlements to return per page in the response. The minimum page size is 1 entitlement per page and the maximum is 1000. The default is 20.
callback_success Function Triggered if the request succeeded
callback_failed Function Triggered if the request failed



Returns:

N/A


Triggers:

Success Callback

These members are returned in the success callback:

Member Type Description
data Array The list of entitlements.
 ├── id String An ID that identifies the entitlement.
 ├── benefit_id String An ID that identifies the benefit (reward).
 ├── timestamp String The UTC date and time (in RFC3339 format) of when the entitlement was granted.
 ├── user_id String An ID that identifies the user who was granted the entitlement.
 ├── game_id String An ID that identifies the game the user was playing when the reward was entitled.
 ├── fulfillment_status String The entitlement's fulfillment status. Possible values are: "CLAIMED", "FULFILLED"
 └── last_updated String The UTC date and time (in RFC3339 format) of when the entitlement was last updated.
pagination Struct The information used to page through the list of results. The struct is empty if there are no more pages left to page through. Read More
 └── cursor String The cursor used to get the next page of results. Set the request's after parameter to this value to page forward through the results.

Failure Callback

This method is triggered on failure.



⚠️ **GitHub.com Fallback** ⚠️