{"_id":"56b29a4965ddf50d0076baed","category":{"_id":"56b29a019621f20d00efb37e","pages":["56b29a4965ddf50d0076baed","56b517ac7bccae0d00e9a1ad"],"project":"56acd71213ac890d001c3c7a","version":"56acd71213ac890d001c3c7d","__v":2,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-02-04T00:23:29.263Z","from_sync":false,"order":5,"slug":"subscriber-resource","title":"User Resource"},"editedParams":true,"editedParams2":true,"user":"56acd6caa040860d00ac94a2","project":"56acd71213ac890d001c3c7a","__v":3,"version":{"_id":"56acd71213ac890d001c3c7d","project":"56acd71213ac890d001c3c7a","__v":15,"createdAt":"2016-01-30T15:30:26.928Z","releaseDate":"2016-01-30T15:30:26.928Z","categories":["56acd71313ac890d001c3c7e","56acd8f113ac890d001c3c81","56acd8f95ac4060d0027865e","56acd93a13ac890d001c3c82","56ad20660ab3c00d00ce3347","56ad356a2a7860170013f714","56ad47eb0ab3c00d00ce334f","56afd523bc304a0d00ace1df","56b29a019621f20d00efb37e","56b657e11bc6970d009feee7","5845cc3c39950c1b002afe77","5845cde163c11b250037967e","5846efd45d064323007b17b4","588604da4674e32300efd160","588627882393d50f00f1322c"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"githubsync":"","parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-02-04T00:24:41.465Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"method":"get","results":{"codes":[{"name":"","code":"{\n  \"result\": {\n    \"status\": 1,\n    \"message\": \"Subscriptions Retrieved\"\n  },\n  \"data\": [\n    {\n      \"id\": 43,\n      \"user_id\": 5,\n      \"status\": \"grace_period\",\n      \"subscribed_at\": \"2015-09-03 00:00:00\",\n      \"tier_id\": \"1\",\n      \"channel_id\": \"3\",\n      \"user\": {\n        \"data\": {\n          \"id\": 5,\n          \"username\": \"eli\",\n          \"banned\": false,\n          \"deactivated\": false,\n          \"created_at\": \"-0001-11-30 00:00:00\",\n          \"links\": {\n            \"uri\": \"/user/5\"\n          }\n        }\n      },\n      \"benefits\": {\n        \"data\": [\n          {\n            \"benefit\": {\n              \"id\": \"1\",\n              \"delivery\": \"delivery-video\",\n              \"title\": \"Exclusive Videos\",\n              \"description\": \"You will get extra videos!\",\n              \"channel_data\": null,\n              \"type\": \"videos-exclusve\",\n              \"month_delay\": null,\n              \"recurring\": false,\n              \"recurring_input\": false,\n              \"receieve_immediately\": false,\n              \"removed_at\": null,\n              \"subscriber_limit\": null,\n              \"tier_bonus\": false,\n              \"quantity\": \"1\",\n              \"multiplier\": \"1\"\n            },\n            \"fulfillment\": {\n              \"id\": 6,\n              \"benefit_id\": 1,\n              \"tier_id\": 1,\n              \"channel_fulfillment_response\": null,\n              \"fulfilled_at\": \"2015-08-03 16:08:26\",\n              \"previously_fulfilled_at\": null,\n              \"disabled_at\": \"2015-08-28 16:25:06\",\n              \"user_input_provided_at\": null,\n              \"recurring\": true,\n              \"granted_at\": \"2015-04-20 19:02:54\",\n              \"channel_cancelled_at\": null,\n              \"status\": \"inactive\",\n              \"user_input\": null\n            }\n          },\n          //...more benefit fulfillment pairs\n        ]\n      },\n      \"channel\": {\n        \"data\": {\n          \"id\": 3,\n          \"display_name\": \"Test Channel\",\n          \"owner_user_id\": 39,\n          \"blurb\": \"This is where you dev\",\n          \"name\": \"test\",\n          \"deactivated\": false,\n          \"description\": \"Test description\",\n          \"links\": {\n            \"uri\": \"/channel/test\"\n          }\n        }\n      }\n    },\n    //...additional subscriber entries for this user.\n  ]\n}","language":"json","status":200}]},"settings":"","examples":{"codes":[{"language":"javascript","code":"var params = {\n  access_token: \"SUBSCRIBER_ACCESS_TOKEN\",\n  channel_name: 'test',\n  include: 'user,channel,benefits'\n};\n\n$.getJSON('https://api.gamewisp.com/pub/v1/user/subscriptions/', params, function(json) {\n    console.log(json);\n});"},{"code":"<?php\n\n$client = new GuzzleHttp\\Client();\n\ntry {\n\n  $response = $client->get('https://api.gamewisp.com/pub/v1/user/subscriptions', [\n    'query' => [\n      'access_token' => \"SUBSCRIBER_ACCESS_TOKEN\",\n  \t\t'channel_id' => 3,\n  \t\t'include' => 'user,channel,benefits'\n    ]\n  ]);\n\n  $result = $response->json();\n\n} catch (Exception $e) {\n\n  //error\n  $result = $e->getResponse()->json();\n\n}","language":"php"},{"language":"text","name":"Sample URL","code":"https://api.gamewisp.com/pub/v1/user/subscriptions?access_token=CHANNEL_ACCESS_TOKEN&include=user,channel,benefits&channel_id=3"}]},"auth":"required","params":[{"_id":"56b29a4965ddf50d0076baef","ref":"","in":"query","required":false,"desc":"OAuth2 access token, identifies the user whose subscriptions you're requesting","default":"","type":"string","name":"access_token"},{"_id":"56b29a4965ddf50d0076baee","ref":"","in":"query","required":false,"desc":"Optional parameter to provide additional information. See \"Include Parameters\" below.","default":"","type":"string","name":"include"},{"_id":"56b3866ca48d0f37000ab3aa","ref":"","in":"query","required":false,"desc":"Filters results by a GameWisp channel id. Cannot be present if 'channel_name' is present.","default":"","type":"int","name":"channel_id"},{"_id":"56b3866ca48d0f37000ab3a9","ref":"","in":"query","required":false,"desc":"Filters results by a GameWisp channel name. Cannot be present if 'channel_id' is present","default":"","type":"string","name":"channel_name"}],"url":"/user/subscriptions"},"isReference":false,"order":0,"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"The user_read scope is required\",\n  \"body\": \"The user_read scope is required to access subscriber specific information.\"\n}\n[/block]\nThis endpoint is crucial if your application wants to work with subscribers: doing benefit fulfillment for individual subscribers, providing extended functionality for subscribers, etc. If your application is only intended to target GameWisp channels, you likely don't need this endpoint.\n\nIf the ```channel_name``` or the ```channel_id``` parameter are not included, the response will include every subscriber entry for the user regardless of channel. Despite the ```channel_name``` and ```channel_id``` parameters being included, multiple subscriber entries may be included in the response if the user is subscribed to a GameWisp channel on Twitch and on GameWisp.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"This endpoint returns user input!\",\n  \"body\": \"Note, the data returned for this endpoint will contain user input for the returned [benefit-fulfillment pairs](https://gamewisp.readme.io/docs/working-with-benefits-and-fulfillment) if 'benefits' is included in the ```include``` parameter string.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Include Parameters\"\n}\n[/block]\nThe parameters below can also be included in any combination as a comma separated list (e.g, include=tier,user,benefits in the query string).\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"tier\",\n    \"1-0\": \"user\",\n    \"2-0\": \"benefits\",\n    \"3-0\": \"channel\",\n    \"1-1\": \"Returns a user object nested with each subscriber object.\",\n    \"0-1\": \"Returns a tier object nested within each subscriber object.\",\n    \"2-1\": \"Returns the [benefit-fulfillment pairs](https://gamewisp.readme.io/docs/working-with-benefits-and-fulfillment) for each subscriber object. **User input is also returned in each fulfillment pair**.\",\n    \"3-1\": \"Returns a channel object nested in each subscriber object.\",\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]","excerpt":"Gets all the subscriptions for a GameWisp user based on the passed in OAuth access token","slug":"subscribersubscriptions","type":"endpoint","title":"/user/subscriptions"}

get/user/subscriptions

Gets all the subscriptions for a GameWisp user based on the passed in OAuth access token

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Query Params

access_token:
string
OAuth2 access token, identifies the user whose subscriptions you're requesting
include:
string
Optional parameter to provide additional information. See "Include Parameters" below.
channel_id:
integer
Filters results by a GameWisp channel id. Cannot be present if 'channel_name' is present.
channel_name:
string
Filters results by a GameWisp channel name. Cannot be present if 'channel_id' is present

Examples


Result Format


Documentation

[block:callout] { "type": "info", "title": "The user_read scope is required", "body": "The user_read scope is required to access subscriber specific information." } [/block] This endpoint is crucial if your application wants to work with subscribers: doing benefit fulfillment for individual subscribers, providing extended functionality for subscribers, etc. If your application is only intended to target GameWisp channels, you likely don't need this endpoint. If the ```channel_name``` or the ```channel_id``` parameter are not included, the response will include every subscriber entry for the user regardless of channel. Despite the ```channel_name``` and ```channel_id``` parameters being included, multiple subscriber entries may be included in the response if the user is subscribed to a GameWisp channel on Twitch and on GameWisp. [block:callout] { "type": "warning", "title": "This endpoint returns user input!", "body": "Note, the data returned for this endpoint will contain user input for the returned [benefit-fulfillment pairs](https://gamewisp.readme.io/docs/working-with-benefits-and-fulfillment) if 'benefits' is included in the ```include``` parameter string." } [/block] [block:api-header] { "type": "basic", "title": "Include Parameters" } [/block] The parameters below can also be included in any combination as a comma separated list (e.g, include=tier,user,benefits in the query string). [block:parameters] { "data": { "0-0": "tier", "1-0": "user", "2-0": "benefits", "3-0": "channel", "1-1": "Returns a user object nested with each subscriber object.", "0-1": "Returns a tier object nested within each subscriber object.", "2-1": "Returns the [benefit-fulfillment pairs](https://gamewisp.readme.io/docs/working-with-benefits-and-fulfillment) for each subscriber object. **User input is also returned in each fulfillment pair**.", "3-1": "Returns a channel object nested in each subscriber object.", "h-0": "Parameter", "h-1": "Description" }, "cols": 2, "rows": 4 } [/block]