Guides & Tutorials

List subscribers of a segment

GET /api/contact.php?list=...

This endpoint returns a list of subscribers in a segment.

Request parameters

Parameter Value
list Segment ID.

Required.
offset Page number.

0 gives contacts from 0 to 25000. 1 gives 25001 to 50000 etc. If not specified, 0 will be set.

Default: 0
limit Number of subscribers to return per request.

Value is capped at 25000.

Default: 25000
fields Fields to return per subscriber.

Email address is always included. Unknown fields are silently ignored.

Default: All fields

Returned subscribers are sorted alphabetically by email address.

Response parameters

Response is formatted as a JSON list of JSON objects.

Parameter Value
email Subscriber’s email address.
is_unsubscribed Subscribers subscription status.

0 - subscribed, emails will be delivered;
1 - unsubscribed.
last_response_code Response code of the last failed message.

Values are described under Delivery response codes.
last_response_at Date and time of the last failed email.

Formatted as YYYY-MM-DD HH:MM:SS, and presented in Europe/Tallinn timezone.
created_at Date and time when subscriber was added to Smaily.

Formatted as YYYY-MM-DD HH:MM:SS, and presented in Europe/Tallinn timezone.
subscribed_at Date and time when subscriber was added to Smaily database or unsubscribed status was changed to subscribed.
modified_at Date and time when subscriber’s data was updated.

Formatted as YYYY-MM-DD HH:MM:SS, and presented in Europe/Tallinn timezone.
last_open_at Latest date and time when subscriber opened an email.

Formatted as YYYY-MM-DD HH:MM:SS, and presented in Europe/Tallinn timezone.
total_opens Total number of emails opened.
last_click_at Latest date and time when subscriber clicked a trackable link in an email.

Formatted as YYYY-MM-DD HH:MM:SS, and presented in Europe/Tallinn timezone.
total_clicks Total number of clicks made.
unsubscribed_at Date and time when subscriber was marked unsubscribed.
... Any subscriber’s custom data field.

Example

List subscribers of a segment

$ curl -X GET -u "${USERNAME}:${PASSWORD}" \
  "https://${SUBDOMAIN}.sendsmaily.net/api/contact.php?list=3"

(JavaScript/JSON)

[
  {
    "email": "subscriber+1@domain.tld",
    "is_unsubscribed": 0,
    "created_at": "2014-04-23 10:32:55",
    "subscribed_at": "2014-04-23 10:32:55",
    "modified_at": "2015-03-22 19:22:31",
    "last_open_at": "0000-00-00 00:00:00",
    "total_opens": "0",
    "last_click_at": "0000-00-00 00:00:00",
    "unsubscribed_at": "0000-00-00 00:00:00",
    "total_clicks": "0",
    "kuuluvus_1": "jah",
    ...
  },
  {
    "email": "subscriber+2@domain.tld",
    "is_unsubscribed": 1,
    "created_at": "2014-04-23 10:32:55",
    "subscribed_at": "2014-04-23 10:32:55",
    "modified_at": "2015-03-22 19:22:31",
    "last_open_at": "0000-00-00 00:00:00",
    "total_opens": "0",
    "last_click_at": "0000-00-00 00:00:00",
    "unsubscribed_at": "2015-03-23 11:11:51",
    "total_clicks": "0",
    "kuuluvus_1": "jah",
    ...
  },
  ...
]

List subscribers of a segment with specified fields

$ curl -X GET -u "${USERNAME}:${PASSWORD}" \
  "https://${SUBDOMAIN}.sendsmaily.net/api/contact.php?list=3&fields=is_unsubscribed,kuuluvus_1"

(JavaScript/JSON)

[
  {
    "email": "subscriber+1@domain.tld",
    "is_unsubscribed": 0,
    "kuuluvus_1": "jah"
  },
  {
    "email": "subscriber+2@domain.tld",
    "is_unsubscribed": 1,
    "kuuluvus_1": "jah"
  },
  ...
]