Skip to main content

Subscriptions - Get All

Description

Get all of a broadcaster’s subscriptions.

Required OAuth Scope: channel:read:subscriptions

Method Definition

@RequestLine("GET /subscriptions?broadcaster_id={broadcaster_id}&after={after}&before={before}&first={first}")
@Headers("Authorization: Bearer {token}")
HystrixCommand<SubscriptionList> getSubscriptions(
@Param("token") String authToken,
@Param("broadcaster_id") String broadcasterId,
@Param("after") String after,
@Param("before") String before,
@Param("first") Integer limit
);

Required Parameters

NameTypeDescription
tokenstringUser Access Token.
broadcaster_idstringID of the broadcaster. Must match the User ID in the Bearer token.

Optional Parameters

NameTypeDescription
afterstringCursor for forward pagination: tells the server where to start fetching the next set of results, in a multi-page response. The cursor value specified here is from the pagination response field of a prior query.
beforestringCursor for backward pagination: tells the server where to start fetching the next set of results, in a multi-page response. The cursor value specified here is from the pagination response field of a prior query.
limitintegerMaximum number of objects to return. Maximum: 100. Default: 20.

Code-Snippets

SubscriptionList resultList = client.getHelix().getSubscriptions(ACCESS_TOKEN, CHANNEL_ID, null, null,null).execute();
resultList.getSubscriptions().forEach(subscription -> {
System.out.println("Subscriber: "+subscription.getUserName());
});