function cc::update_list in Constant Contact 6.2
Same name and namespace in other branches
- 6.3 class.cc.php \cc::update_list()
- 7.3 class.cc.php \cc::update_list()
* Updates an existing contact list * * * @access public
File
- ./
class.cc.php, line 396
Class
- cc
- @file
Code
function update_list($id, $name, $default = "false") {
// build the XML put data
$url = $this
->get_list_url($id);
$xml_data = '
<entry xmlns="http://www.w3.org/2005/Atom">
<id>' . $url . '</id>
<title type="text">' . $name . '</title>
<author />
<updated>2008-04-16T18:39:35.710Z</updated>
<content type="application/vnd.ctct+xml">
<ContactList xmlns="http://ws.constantcontact.com/ns/1.0/"
id="' . $url . '">
<OptInDefault>' . $default . '</OptInDefault>
<Name>' . $name . '</Name>
<ShortName>' . $name . '</ShortName>
</ContactList>
</content>
<link href="/ws/customers/' . $this->api_username . '/lists/' . $id . '" rel="update" />
</entry>
';
$this
->http_set_content_type('application/atom+xml');
$xml = $this
->load_url("lists/{$id}", 'put', $xml_data, 204);
if (intval($this->http_response_code) === 204) {
return true;
}
return false;
}