List subscribers in a segment
Returns a list of all subscribers in this segment.
Endpoint
Section titled “Endpoint”HTTP method: GET
https://api.sender.net/v2/segments/{id}/subscribers
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
id | string required | Segment ID |
Request Examples
Section titled “Request Examples”const url = new URL("https://api.sender.net/v2/segments/{id}/subscribers");
let headers = { "Authorization": "Bearer [your-token]", "Content-Type": "application/json", "Accept": "application/json",};
fetch(url, { method: "GET", headers,}).then(response => response.json()).then(data => console.log(data)).catch(error => console.error('Error:', error));$client = new \GuzzleHttp\Client();$response = $client->get( 'https://api.sender.net/v2/segments/{id}/subscribers', [ 'headers' => [ 'Authorization' => 'Bearer [your-token]', 'Content-Type' => 'application/json', 'Accept' => 'application/json', ], ]);
$body = $response->getBody()->getContents();$data = json_decode($body, true);print_r($data);import requestsimport json
url = "https://api.sender.net/v2/segments/{id}/subscribers"
headers = { "Authorization": "Bearer [your-token]", "Content-Type": "application/json", "Accept": "application/json",}
response = requests.request('GET', url, headers=headers)
print(response.json())curl -X GET \-G "https://api.sender.net/v2/segments/{id}/subscribers" \-H "Authorization: Bearer [your-token]" \-H "Content-Type: application/json" \-H "Accept: application/json"Response
Section titled “Response”{ "data": [ { "id": "o2lk68Y", "firstname": "Support", "lastname": "Sender", "unsubscribed_at": null, "bounced_at": null, "created": "2021-04-08 11:06:34", "unsubscribed": 0, "location": null, "bounced": 0, "spam_reported": 0, "subscriber_tags": [ "eZVD4w", "b2vAR1" ], "columns": { "bDqoKd": 1 } } ], "links": { "first": "https://api.sender.net/v2/segments/elY9Ma/subscribers?page=1", "last": "https://api.sender.net/v2/segments/elY9Ma/subscribers?page=1", "prev": null, "next": null }, "meta": { "current_page": 1, "from": 1, "last_page": 1, "links": [ { "url": null, "label": "pagination.previous", "active": false }, { "url": "https://api.sender.net/v2/segments/elY9Ma/subscribers?page=1", "label": 1, "active": true }, { "url": null, "label": "pagination.next", "active": false } ], "path": "https://api.sender.net/v2/segments/elY9Ma/subscribers", "per_page": 10, "to": 1, "total": 1 }, "has_more_not_deleted_subscribers": true}