Method: GET
Endpoint: /api/getContact/{ids}
Parameter | Type | Description |
status | JSON | Success or Error |
result | JSON | Result of the operation |
response | JSON | Output of the operation |
<?php
// Authentication
$api_token = 'API_KEY'; // Mumara API Key (can be found in Settings -> API Key)
$domain = 'http://www.anydomain.com'; // Your Mumara Domain Name
// API Endpoint
$endpoint = '/api/getContact/';
//Contact id
$contact_id = 22;
// Defining cURL Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$domain.$endpoint.$contact_id);
curl_setopt($ch, CURLOPT_HTTPHEADER,
array('Content-Type: application/json', 'Authorization: Bearer ' . $api_token));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// Executing cURL
$output = curl_exec ($ch);
// Printing Output
echo "<pre>";
echo json_encode(json_decode($output),JSON_PRETTY_PRINT );
// Closing cURL
curl_close ($ch);
?>
{
"status": "success",
"result": [
{
"id": 22,
"email": "[email protected]",
"list_id": 10,
"bounced": "no_process",
"is_spamed": 0,
"is_unsubscribed": 1,
"is_confirmed": 0,
"is_verified": 0,
"is_active": 1,
"format": "text",
"user_id": 2,
"created_at": "2019-05-09 07:31:35",
"updated_at": "2019-05-09 07:31:35",
"additional_fields_data": {
"first_name": "John",
"last_name": "Lee"
}
}
]
}
{
"status": "error",
"result": "Error: Contact doesn't exist."
}