{"_id":"580ce71a2cc1c91900c3d70e","__v":1,"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"},"project":"55e58b63d101191900f30b13","user":"5554788cb450630d00041dbc","githubsync":"","parentDoc":null,"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"},"metadata":{"title":"","description":"","image":[]},"updates":["584fa18cf462e823008e3c75"],"next":{"pages":[],"description":""},"createdAt":"2016-10-23T16:36:42.184Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"settings":"","examples":{"codes":[]},"method":"get","results":{"codes":[{"name":"","code":"{\n  \"status\": \"success\",\n  \"count\": 4,\n  \"segment_list\": [\n    {\n      \"segment_id\": \"1\",\n      \"segment_name\": \"segment1\"\n    },\n    {\n      \"segment_id\": \"2\",\n      \"segment_name\": \"segment2\"\n    },\n    {\n      \"segment_id\": \"3\",\n      \"segment_name\": \"segment3\"\n    },\n    {\n      \"segment_id\": \"4\",\n      \"segment_name\": \"segment4\"\n    }\n  ]\n}","language":"json","status":200},{"name":"","code":"{\n  \"status\": \"failure\",\n  \"message\": \"Subscriber ID is invalid\"\n}","language":"json","status":400},{"status":200,"language":"json","code":"{\n  \"status\": \"success\",\n  \"message\": \"This subscriber isn't present in any segments\"\n}"}]},"auth":"required","params":[],"url":"/subscribers/:subscriberid/segments"},"isReference":false,"order":14,"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 segment list can't be fetched. A string denoting why the request failed.\n\n**Count:** Denotes the number of segments the subscriber is a part of.\n\n**Segment List:** Array of segments with their name and IDs","excerpt":"This endpoint is used to get a list of segments which a subscriber is present in. The request method of this call needs to be \"GET\".\n\nYou need to supply the SubscriberID in the URL. This is the same SubscriberID which you get in the 'SuccessfulSubscription Callback' in the JS API.","slug":"get-segments-for-a-subscriber","type":"endpoint","title":"Get Segments for a Subscriber"}

getGet Segments for a Subscriber

This endpoint is used to get a list of segments which a subscriber is present in. The request method of this call needs to be "GET". You need to supply the SubscriberID in the URL. This is the same SubscriberID which you get in the 'SuccessfulSubscription Callback' in the JS API.

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 segment list can't be fetched. A string denoting why the request failed. **Count:** Denotes the number of segments the subscriber is a part of. **Segment List:** Array of segments with their name and IDs