Drops - Get Entitlements
Description
Gets an organization's list of entitlements that have been granted to a game, a user, or both.
The client ID in the access token must own the game. App access tokens can pass any combination of request parameters (below) while requests using user access tokens must not specify any userId.
Valid combinations of request parameters are (given appropriate oauth access):
- no fields
- only userId
- only gameId
- both userId and gameId
Method Definition
@RequestLine("GET /entitlements/drops?id={id}&user_id={user_id}&game_id={game_id}&fulfillment_status={fulfillment_status}&after={after}&first={first}")
@Headers("Authorization: Bearer {token}")
HystrixCommand<DropsEntitlementList> getDropsEntitlements(
@Param("token") String authToken,
@Param("id") String id,
@Param("user_id") String userId,
@Param("game_id") String gameId,
@Param("fulfillment_status") DropFulfillmentStatus status,
@Param("after") String after,
@Param("first") Integer limit
);
Required Parameters
Name | Type | Description |
---|---|---|
authToken | string | App access token or user access token |
Optional Parameters
Name | Type | Description |
---|---|---|
id | string | Unique identifier of the entitlements |
user_id | string | User ID, that was granted entitlements |
game_id | string | Game ID, that offered entitlements |
fulfillment_status | enum | Status used to filter entitlements. Example- 'claimed' or 'fulfilled' |
after | string | The cursor used to get the next page of results. |
first | integer | The maximum number of entitlements to return per page in the response. |
Code Snippets
Print entitlements with a specific ID
- Java
- Kotlin
- Groovy
DropsEntitlementList resultList = twitchClient.getHelix().getDropsEntitlements("appAccessToken", "entitlementId", null, null, null, null, 1000).execute();
resultList.getData().forEach(drop -> System.out.printf("User ID: %s - Status: %s\n", drop.getUserId(), drop.getFulfillmentStatus()));
val resultlist = twitchClient.helix.getDropsEntitlements("appAccessToken","entitlementId",null,null,null,null,1000).execute()
resultList.data.forEach {
println("User ID: ${it.userId} - Status: ${it.fulfillmentStatus}")
}
def resultList = twitchClient.helix.getDropsEntitlements("appAccessToken", "entitlementId", null, null, null, null, 1000).execute()
resultList.data.each { drop ->
System.out.println "User ID: ${drop.userId} - Status: ${drop.fulfillmentStatus}"
}
Print entitlements for a specific Game
- Java
- Kotlin
- Groovy
DropsEntitlementList resultList = twitchClient.getHelix().getDropsEntitlements("appAccessToken", null, null, "gameId", null, null, 1000).execute();
resultList.getData().forEach(drop -> System.out.printf("User ID: %s - Status: %s\n", drop.getUserId(), drop.getFulfillmentStatus()));
val resultList = twitchClient.helix.getDropsEntitlements("appAccessToken", null, null, "gameId", null, null, 1000).execute()
resultList.data.forEach {
println("User ID: ${it.userId} - Status: ${it.fulfillmentStatus}")
}
def resultList = twitchClient.helix.getDropsEntitlements("appAccessToken", null, null, "gameId", null, null, 1000).execute();
resultList.data.each { drop ->
System.out.println "User ID: ${drop.userId} - Status: ${drop.fulfillmentStatus}"
}
Print the entitlements associated with a specific user
- Java
- Kotlin
- Groovy
DropsEntitlementList resultList = twitchClient.getHelix().getDropsEntitlements("appAccessToken", null, "userId", null, null, null, 1000).execute();
resultList.getData().forEach(drop -> System.out.printf("Game ID: %s - Status: %s\n", drop.getGameId(), drop.getFulfillmentStatus()));
val resultList = twitchClient.helix.getDropsEntitlements("appAccessToken", null, "userId", null, null, null, 1000).execute()
resultList.data.forEach {
println("Game ID: ${it.gameId} - Status: ${it.fulfillmentStatus}")
}
def resultList = twitchClient.helix.getDropsEntitlements("appAccessToken", null, "userId", null, null, null, 1000).execute();
resultList.data.each { drop ->
System.out.println "Game ID: ${drop.gameId} - Status: ${drop.fulfillmentStatus}"
}
Print claimed but not fulfilled entitlements across games owned by the organization
- Java
- Kotlin
- Groovy
DropsEntitlementList resultList = twitchClient.getHelix().getDropsEntitlements("appAccessToken", null, null, null, DropFulfillmentStatus.CLAIMED, null, 1000).execute();
resultList.getData().forEach(drop -> System.out.printf("User ID: %s - Timestamp: %s\n", drop.getUserId(), drop.getUpdatedAt()));
val resultList = twitchClient.helix.getDropsEntitlements("appAccessToken", null, null, null, DropFulfillmentStatus.CLAIMED, null, 1000).execute()
resultList.data.forEach {
println("User ID: ${it.userId} - Timestamp: ${it.updatedAt}")
}
def resultList = twitchClient.helix().getDropsEntitlements("appAccessToken", null, null, null, DropFulfillmentStatus.CLAIMED, null, 1000).execute();
resultList.data.each { drop ->
System.out.println "User ID: ${drop.userId} - Timestamp: ${drop.updatedAt}"
}