Method: PUT
Endpoint: /api/updateList/{id}
Parameter | Type | Required |
Description |
list_name | string | No | Update contact list name |
group_name | string | No | Update contact list group |
owner_name | string | No | Update owner name |
owner_email | string | No | Update owner email address |
reply_email | string | No | Update reply email address |
bounce_email | string | No | Update return-path email address where you want to receive bounced emails |
additional_field | string | No | Re-assign custom fields. If skipped then no change will apply to the pre-assigned custom fields |
response | 0, 1 (default: 0) | No | Get full response of the operation |
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
$list_id = '22';
// API Endpoint
$endpoint = '/api/updateList/';
//parameters
$params =
[
'list_name' => 'Test List via Api',
'owner_name' => 'John Lee',
'owner_email' => '[email protected]',
'reply_email' => '[email protected]',
'group_name' => 'Test',
'bounce_email' => '[email protected]',
'response' => 1,
'additional_fields' => 'first_name'
];
// Defining cURL Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$domain.$endpoint.$list_id);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_HTTPHEADER,
array('Content-Type: application/json', 'Authorization: Bearer ' . $api_token));
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Executing cURL
$output = curl_exec($ch);
// Printing Output
echo "<pre>";
print_r(json_decode($output,true));
// Closing cURL
curl_close ($ch);
?>
{
"status": "success",
"result": "Success: List has been successfully updated.",
"response": {
"id": 23,
"name": "Test List via Api",
"group_id": 5,
"owner_name": "John Lee",
"owner_email": "[email protected]",
"reply_email": "[email protected]",
"bounce_email_id": 3,
"user_id": 4,
"created_at": "2019-05-13 09:58:18",
"updated_at": "2019-05-14 10:52:13",
"custom_fields": {
"2": "First Name"
}
}
}
{
"status": "error",
"result": "Error: Group doesn't exist."
}