Request the tiers for a particular channel.
This event is used to return the tiers for a channel. It is used as follows:
socket.emit('channel-tiers', {
access_token: "channel Oauth2 access token"
params: {
subscriberInfo: true,
subscriberCount: true,
sort: 'oldest'
}
});
params is a JSON object of optional parameters that can be used to request particular subscriber data for the specified channel(s) for each tier. Each element of params is described as follows:
Parameter | Type | Description |
---|---|---|
subscriberInfo | Boolean | Default false. Returns subscriber info for each tier. |
subscriberCount | Boolean | Default is false. If true, returns the subscriber count for each tier. |
sort | String | Applies a sort to the returned results. Options include: newest: Default. Sort from newest to tier to oldest. oldest: Sort from oldest tier to newest. |
This event emits app-channel-tiers back to your application upon completion. If using Socket.IO, you would listen for the event as follows:
socket.on('app-channel-tiers', function(response){
// Do something with response.
});
The response JSON object has the following structure:
{
result: {
status: 1,
message: "Channel Tiers."
},
channel: {
names: {
gamewisp: "GameWisp channel name",
twitch: "twitch channel name",
youtube: "youtube channel name"
},
ids: {
gamewisp: "channel identifier",
twitch: "12312312q",
youtube: "UCiqp4J8asdkssssssssdfae"
}
},
data:{
channel_id: "channel-identifier",
status: "authenticated",
tiers: [
{
id: "123",
title: "Tier Title",
level: "1",
cost: "4.99",
description: "Tier description",
published: true,
subscriber_count: "12",
subscribers: [
{
ids: {
gamewisp: "12354",
twitch: null
},
usernames: {
gamewisp: "gamewisp-user-name",
twitch: null
},
status: "active",
amount: "4.99",
subscribed_at: "2015-05-21 00:00:00",
end_of_access: "2016-01-21 00:00:00",
tier_id: "123"
},
//More subscribers...
],
benefits: [
{
id: "3",
delivery: "delivery-messaging",
title: "Subscriber Messaging",
description: "Receive Subscriber-only messages from me.",
channel_data: null,
type: "unknown-type",
month_delay: null,
recurring: false,
recurring_input: false,
receieve_immediately: false,
removed_at: null,
subscriber_limit: null,
tier_bonus: false,
quantity: 1,
multiplier: 1
},
//More benefits...
]
},
//More tiers...
]
}
}
Note that if subscriberCount and subscriberInfo are false, the subscriber_count and subscribers fields will not be present.
This response may be very large
Depending on how you use this event, the resulting response object can be very large.