Overview
You can use this request to retrieve the subscription status of a contact on a specific list.
The Method
API | - | Method |
---|---|---|
REST | POST | https://[Your URL]/api/2.0/list_subscriptions/:list_id/:contact_id |
XML-RPC | Call | list._subscriptions.GetListSubscription |
Your URL is the address of your install.
Your method must be structured as follows:
GetListSubscription(int $list_id, int $contact_id) : \pmaContactsListsMappingsObject
Parameters
Property | Type | Description | Required |
---|---|---|---|
$list_id | integer | The list ID. | yes |
$contact_id | integer | The contact ID. | yes |
Responses
\pmaContactsListsMappingsObject
Code Samples
PHP (using REST API):
$url = '(Your URL)/api/2.0/list_subscriptions/:list_id/:contact_id'; $method = 'GET'; $cSession = curl_init(); $headers = array(); $auth = base64_encode($username . ':' . $apikey); $headers[] = 'Authorization: Basic ' . $auth; curl_setopt($cSession, CURLOPT_URL, $url); curl_setopt($cSession, CURLOPT_RETURNTRANSFER, true); curl_setopt($cSession, CURLOPT_HEADER, false); curl_setopt($cSession, CURLOPT_CUSTOMREQUEST, strtoupper($method)); curl_setopt($cSession, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($cSession); curl_close($cSession);