{"_id":"580cfbbc2cc1c91900c3d714","__v":1,"project":"55e58b63d101191900f30b13","category":{"_id":"55e58d1bd101191900f30b1d","version":"55e58b63d101191900f30b16","__v":13,"pages":["55e58d27191aa90d0052b52f","55e58d56191aa90d0052b531","55e58d6ff493c11700584315","55e58d81f493c11700584318","55e59b9bd101191900f30b75","55e59c1ff11ba80d003238f1","55e7325f2d0d3021000db050","55e732ca58e25f35001437a6","55e7339e2d0d3021000db052","55e734aa7991b92100b209ed","55f7028ba7ceef0d00251c19","56669144ce8caf0d006018b6","56d04587376b040b005b2f7d"],"project":"55e58b63d101191900f30b13","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-09-01T11:33:47.501Z","from_sync":false,"order":2,"slug":"rest-api","title":"REST API"},"githubsync":"","user":"5554788cb450630d00041dbc","version":{"_id":"55e58b63d101191900f30b16","__v":3,"project":"55e58b63d101191900f30b13","createdAt":"2015-09-01T11:26:27.668Z","releaseDate":"2015-09-01T11:26:27.668Z","categories":["55e58b65d101191900f30b17","55e58d16f493c11700584314","55e58d1bd101191900f30b1d"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"parentDoc":null,"metadata":{"title":"","description":"","image":[]},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-10-23T18:04:44.483Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"language":"text","code":""}]},"method":"get","results":{"codes":[{"name":"","code":"{\n  \"status\": \"success\",\n  \"count_active\": 4,\n  \"count_total\": 6,\n  \"subscriber_list\": [\n    {\n      \"subscriber_id\": \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\n      \"ip_address\": \"103.51.153.0\",\n      \"user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36\",\n      \"browser\": \"Chrome\",\n      \"browser_version\": \"58.0.3029.110\",\n      \"platform\": \"web-push\",\n      \"device_platform\": \"desktop\",\n      \"operating_system\": \"MacOS\",\n      \"device\": \"\",\n      \"country\": \"India\",\n      \"region\": \"\",\n      \"city\": \"\",\n      \"is_inactive\": \"0\",\n      \"is_ghost\": \"0\",\n      \"subscriber_added_timestamp\": \"2017-05-31 17:47:30\",\n      \"added_to_segment_timestamp\": \"2017-09-11 08:08:24\"\n    },\n    {\n      \"subscriber_id\": \"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\n      \"ip_address\": \"182.75.139.0\",\n      \"user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36\",\n      \"browser\": \"Chrome\",\n      \"browser_version\": \"57.0.2987.133\",\n      \"platform\": \"web-push\",\n      \"device_platform\": \"desktop\",\n      \"operating_system\": \"MacOS\",\n      \"device\": \"\",\n      \"country\": \"India\",\n      \"region\": \"\",\n      \"city\": \"\",\n      \"is_inactive\": \"1\",\n      \"is_ghost\": \"0\",\n      \"subscriber_added_timestamp\": \"2017-05-02 06:56:18\",\n      \"added_to_segment_timestamp\": \"2017-09-11 08:08:24\"\n    }\n  ],\n  \"next_page\": \"https://pushcrew.com/api/v1/segments/1/subscribers?page=2&per_page=2\"\n}","language":"json","status":200},{"name":"","code":"{\n  \"status\": \"success\",\n  \"subscriber_list\": [\n    {\n      \"subscriber_id\": \"cccccccccccccccccccccccccccccccc\",\n      \"ip_address\": \"49.248.77.0\",\n      \"user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36\",\n      \"browser\": \"Chrome\",\n      \"browser_version\": \"57.0.2987.133\",\n      \"platform\": \"web-push\",\n      \"device_platform\": \"desktop\",\n      \"operating_system\": \"MacOS\",\n      \"device\": \"\",\n      \"country\": \"India\",\n      \"region\": \"Goa\",\n      \"city\": \"Panjim\",\n      \"is_inactive\": \"0\",\n      \"is_ghost\": \"0\",\n      \"subscriber_added_timestamp\": \"2017-04-20 07:09:48\",\n      \"added_to_segment_timestamp\": \"2017-09-11 08:08:24\"\n    },\n    {\n      \"subscriber_id\": \"dddddddddddddddddddddddddddddddd\",\n      \"ip_address\": \"182.75.139.0\",\n      \"user_agent\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:53.0) Gecko/20100101 Firefox/53.0\",\n      \"browser\": \"Firefox\",\n      \"browser_version\": \"53.0\",\n      \"platform\": \"web-push\",\n      \"device_platform\": \"desktop\",\n      \"operating_system\": \"MacOS\",\n      \"device\": \"\",\n      \"country\": \"India\",\n      \"region\": \"\",\n      \"city\": \"\",\n      \"is_inactive\": \"0\",\n      \"is_ghost\": \"0\",\n      \"subscriber_added_timestamp\": \"2017-05-02 06:39:24\",\n      \"added_to_segment_timestamp\": \"2017-09-11 08:08:24\"\n    }\n  ],\n  \"previous_page\": \"https://pushcrew.com/api/v1/segments/1/subscribers?page=1&per_page=2\",\n  \"next_page\": \"https://pushcrew.com/api/v1/segments/1/subscribers?page=3&per_page=2\"\n}","language":"json","status":200},{"code":"{\n  \"status\": \"success\",\n  \"subscriber_list\": [\n    {\n      \"subscriber_id\": \"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\",\n      \"ip_address\": \"49.248.77.0\",\n      \"user_agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36\",\n      \"browser\": \"Chrome\",\n      \"browser_version\": \"63.0.3239.132\",\n      \"platform\": \"web-push\",\n      \"device_platform\": \"desktop\",\n      \"operating_system\": \"windows\",\n      \"device\": \"\",\n      \"country\": \"India\",\n      \"region\": \"Maharashtra\",\n      \"city\": \"Pune\",\n      \"is_inactive\": \"0\",\n      \"is_ghost\": \"0\",\n      \"subscriber_added_timestamp\": \"2018-01-15 08:55:44\",\n      \"added_to_segment_timestamp\": \"2018-01-15 08:54:59\"\n    },\n    {\n      \"subscriber_id\": \"ffffffffffffffffffffffffffffffff\",\n      \"ip_address\": \"49.248.77.0\",\n      \"user_agent\": \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36\",\n      \"browser\": \"Chrome\",\n      \"browser_version\": \"62.0.3239.132\",\n      \"platform\": \"web-push\",\n      \"device_platform\": \"mobile\",\n      \"operating_system\": \"\",\n      \"device\": \"android\",\n      \"country\": \"India\",\n      \"region\": \"Maharashtra\",\n      \"city\": \"Pune\",\n      \"is_inactive\": \"1\",\n      \"is_ghost\": \"0\",\n      \"subscriber_added_timestamp\": \"2018-01-15 08:55:44\",\n      \"added_to_segment_timestamp\": \"2018-01-15 08:54:59\"\n    }\n  ],\n  \"previous_page\": \"https://pushcrew.com/api/v1/segments/1/subscribers?page=2&per_page=2\"\n}","language":"json","status":200},{"code":"{\n  \"status\": \"success\",\n  \"message: \"No Subscribers exist in the segment\"\n}","language":"json","status":200},{"code":"{\n  \"status\": \"failure\",\n  \"message: \"Invalid Segment ID\"\n}","language":"json","status":400}]},"settings":"","auth":"required","params":[],"url":"/segments/:segmentId/subscribers?page=1&per_page=2"},"isReference":false,"order":13,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Response Description:\"\n}\n[/block]\n**Status:** To denote whether the request succeeded or not. Values can be 'success' or 'failure'.\n\n**Message:** Present if subscriber list can't be fetched. A string denoting why the request failed.\n\n**Subscriber List:** Array of subscribers. It contains the following fields:\n\na) SubscriberID: Unique SubscriberID for the subscriber\nb) Ip_address: The IP Address of the subscriber. Can be in IPV4/IPV6. PushCrew masks certain octets (depending upon the format) by default in the IP Address to make sure that the IP address cannot be used to personally identify a subscriber.\nc) User_agent: The user agent string can be used for identifying the browser, browser version and operating system for the push subscription.\nd) Browser: The browser through which the subscriber subscribed. Should be present if platform is web-push(For example: Chrome, Firefox, Opera etc)\ne) Browser_version: The version number of the browser through which subscriber subscribed. (For example: 58.0.3029.110 )\nf) Platform: The platform through which the subscriber subscribed(For example: \"web-push\")\ng) Device_platform: Value can be 'desktop' / 'mobile'. Depending upon the device from which the subscriber subscribed.\nh) Operating_system: The operating system of the device through which subscriber subscribed (For example: MacOS, Windows)\ni) Device: The device through which the subscriber subscribed. It's value will be 'android' for subscriptions on Chrome on Android or '' (empty string) for subscriptions on browsers on desktops/laptops.\nj) Country: The country from where the subscriber subscribed (For example: India, Germany)\nk) Region: The region is the sub division or state from where the subscriber subscribed. (For example: New Delhi, Texas). \nl) City: The city from where the subscriber subscribed. (For example: Houston, Milwaukee)\nm) IsInactive: Integer field which denotes if subscriber has unsubscribed. 1 stands for unsubscribed and 0 stands for subscribed.\nn) IsGhost(*): Integer field which denotes if subscriber is a ghost. Ghosts is a terminology for subscribers whom we're not able to reach. 1 stands for unsubscribed and 0 stands for subscribed.\no) Subscriber Added TimeStamp: The GMT timestamp of the time when the subscriber got added into our system.\np) Added To Segment TimeStamp: The GMT timestamp of the time when the subscriber got added into the segment.\n\n**Count Active**: Denotes the count of active subscribers in the segment. Active subscribers are those for whom is_inactive is 0 and is_ghost is 0.\n\n**Count Total**: Denotes the count of all subscribers in the segment. Includes inactive and ghost subscribers.\n\n**Previous Page:** It is a RESTFUL link to the previous page of results. Should be present on all pages except the first page.\n\n**Next Page:** It is a RESTFUL link to the next page of results. Should be present on all pages except the last page.\n\n\n(*) For more information on ghosts, please refer to: https://pushcrew.com/blog/product-announcement-improving-website-browser-push-notifications-delivery-rate/","excerpt":"This endpoint is used to get a list of subscribers present in a segment. The request method of this call needs to be \"GET\".\n\nYou need to supply the SegmentID in the URL. This is the same SegmentID which you get in the response after making a segment through the REST API.\n\nSince the response can be large(in case the segment contains a lot of subscribers), pagination will need to be applied to get all the subscribers in the segment. You can specify 'page' and 'per_page' parameters in the URL for pagination. The default value for both parameters if not specified are 1(page) and per_page(1024).","slug":"get-subscribers-in-a-segment","type":"endpoint","title":"Get Subscribers in a Segment"}

getGet Subscribers in a Segment

This endpoint is used to get a list of subscribers present in a segment. The request method of this call needs to be "GET". You need to supply the SegmentID in the URL. This is the same SegmentID which you get in the response after making a segment through the REST API. Since the response can be large(in case the segment contains a lot of subscribers), pagination will need to be applied to get all the subscribers in the segment. You can specify 'page' and 'per_page' parameters in the URL for pagination. The default value for both parameters if not specified are 1(page) and per_page(1024).

Definition

{{ api_url }}{{ page_api_url }}

Result Format


Documentation

[block:api-header] { "type": "basic", "title": "Response Description:" } [/block] **Status:** To denote whether the request succeeded or not. Values can be 'success' or 'failure'. **Message:** Present if subscriber list can't be fetched. A string denoting why the request failed. **Subscriber List:** Array of subscribers. It contains the following fields: a) SubscriberID: Unique SubscriberID for the subscriber b) Ip_address: The IP Address of the subscriber. Can be in IPV4/IPV6. PushCrew masks certain octets (depending upon the format) by default in the IP Address to make sure that the IP address cannot be used to personally identify a subscriber. c) User_agent: The user agent string can be used for identifying the browser, browser version and operating system for the push subscription. d) Browser: The browser through which the subscriber subscribed. Should be present if platform is web-push(For example: Chrome, Firefox, Opera etc) e) Browser_version: The version number of the browser through which subscriber subscribed. (For example: 58.0.3029.110 ) f) Platform: The platform through which the subscriber subscribed(For example: "web-push") g) Device_platform: Value can be 'desktop' / 'mobile'. Depending upon the device from which the subscriber subscribed. h) Operating_system: The operating system of the device through which subscriber subscribed (For example: MacOS, Windows) i) Device: The device through which the subscriber subscribed. It's value will be 'android' for subscriptions on Chrome on Android or '' (empty string) for subscriptions on browsers on desktops/laptops. j) Country: The country from where the subscriber subscribed (For example: India, Germany) k) Region: The region is the sub division or state from where the subscriber subscribed. (For example: New Delhi, Texas). l) City: The city from where the subscriber subscribed. (For example: Houston, Milwaukee) m) IsInactive: Integer field which denotes if subscriber has unsubscribed. 1 stands for unsubscribed and 0 stands for subscribed. n) IsGhost(*): Integer field which denotes if subscriber is a ghost. Ghosts is a terminology for subscribers whom we're not able to reach. 1 stands for unsubscribed and 0 stands for subscribed. o) Subscriber Added TimeStamp: The GMT timestamp of the time when the subscriber got added into our system. p) Added To Segment TimeStamp: The GMT timestamp of the time when the subscriber got added into the segment. **Count Active**: Denotes the count of active subscribers in the segment. Active subscribers are those for whom is_inactive is 0 and is_ghost is 0. **Count Total**: Denotes the count of all subscribers in the segment. Includes inactive and ghost subscribers. **Previous Page:** It is a RESTFUL link to the previous page of results. Should be present on all pages except the first page. **Next Page:** It is a RESTFUL link to the next page of results. Should be present on all pages except the last page. (*) For more information on ghosts, please refer to: https://pushcrew.com/blog/product-announcement-improving-website-browser-push-notifications-delivery-rate/