Edit header
Allows to update any header. Any information that won’t be given in this request, won’t be updated.
Request data format
Request URL parameters:
Element/attribute | Type | Notes |
---|---|---|
ID | integer | Header ID. Required as a part of address (not inside request body). See example below. |
Example URL (HTTP method: PUT):
https://api.esv2.com/v2/Api/Headers/3
Data part of request for updating header.
Data element children:
Element/attribute | Type | Notes |
---|---|---|
Name | string | Name of header. Optional. |
Html | string | HTML content of header. The data should be enclosed in CDATA section for XML transport. See examples. Optional. |
Plain | string | Plain text content of header. Optional. |
AmpHtml | string | AMP HTML content of header. The data should be enclosed in CDATA section for XML transport. See examples. Optional. |
IsDefault | boolean | If set to „true” (note the lowercase!), the new created header will be used as default in all new email messages. Optional. If not specified, default will be set to „false”. |
Response
By default, response is empty and HTTP code „204 – No Content” is returned.
Examples
Updating a header
Request:
PUT https://api.esv2.com/v2/Api/Headers HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
User-Agent: Jakarta Commons-HttpClient/3.1
Host: api.esv2.com
Content-Length: 1727
<ApiRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<ApiKey>test_api_key</ApiKey>
<Data>
<Name>New name of header</Name>
<Html><![CDATA[<h2>Completely new HTML of header</h2>]]></Html>
<Plain>Update of plain header</Plain>
</Data>
</ApiRequest>
Response:
HTTP/1.1 204 No Content
Content-Type: text/xml; charset=utf-8
Date: Tue, 27 Mar 2012 13:28:01 GMT
Content-Length: 0