GET

mailing-lists/{mailingListId}/entries

Get contact list entries from a specific "Contacts" list

Request example:

  • mailing-lists/47/entries

Response example:

  • Status code: 200 OK

{
"success": true,
"data": {
"current_page": 1,
"data": [
{
"id": 2,
"mailing_list_id": 47,
"email": "[email protected]",
"first_name": "John",
"last_name": "Example",
"title": "",
"phone_number": "",
"external_id": null,
"source": null,
"status": "Subscribed",
"active": null,
"opened_at": "2020-12-04 10:40:06",
"clicked_at": "2020-12-04 10:43:22",
"bounced_at": null,
"replied_at": null,
"unsubscribed_at": null,
"unsubscribe_reason_id": null,
"created_at": "2020-11-27 09:48:44",
"updated_at": "2020-11-27 09:48:44",
"sent_at": "2020-12-04 10:38:58",
"bounce_message": null,
"custom_attributes": []
},
{
"id": 3,
"mailing_list_id": 47,
"email": "[email protected]",
"first_name": null,
"last_name": null,
"title": null,
"phone_number": null,
"external_id": null,
"source": null,
"status": "Subscribed",
"active": null,
"opened_at": "2020-12-04 07:57:28",
"clicked_at": "2020-12-04 07:57:30",
"bounced_at": null,
"replied_at": null,
"unsubscribed_at": null,
"unsubscribe_reason_id": null,
"created_at": "2020-11-27 09:48:44",
"updated_at": "2020-11-27 09:48:44",
"sent_at": "2020-12-07 10:00:12",
"bounce_message": null,
"custom_attributes": []
},
{
"id": 4,
"mailing_list_id": 47,
"email": "[email protected]",
"first_name": null,
"last_name": null,
"title": null,
"phone_number": null,
"external_id": null,
"source": null,
"email_status": null,
"status": "Subscribed",
"active": null,
"opened_at": null,
"clicked_at": null,
"bounced_at": null,
"replied_at": null,
"unsubscribed_at": null,
"unsubscribe_reason_id": null,
"created_at": "2021-01-07 11:21:53",
"updated_at": "2021-01-07 11:21:53",
"sent_at": null,
"bounce_message": null,
"custom_attributes": []
}
],
"first_page_url": ".../mailing-lists/47/entries?page=1",
"from": 1,
"last_page": 1,
"last_page_url": ".../mailing-lists/47/entries?page=1",
"next_page_url": ".../mailing-lists/47/entries?page=2",
"path": ".../mailing-lists/47/entries",
"per_page": 25,
"prev_page_url": null,
"to": 25,
"total": 3,
"total_filtered": 3
}
}
  • Status code: 401 Unauthorized

{
"success": false,
"message": "This mailing list does not belong to your organization",
"status_code": 401
}

Code example:

<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '.../mailing-lists/47/entries', //replace ... with the whole API url
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'x-api-key: YOUR-API-KEY' //replace with your generated API key
),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Did this answer your question?