参数 | 类型 | 描述 |
---|---|---|
ApiKey | string | API key用于验证身份. 必填. |
Id | int | 启用中的事务性邮件ID. 要求作为(GET方法)请求URL地址的一部分使用. 见下例. |
https://api.esv2.com/v2/Api/Snippets/234?apiKey=YOUR_API_KEY_HERE |
应答数据元素:
元素/属性名称 | 类型 | 描述 |
---|---|---|
Snippets | array[complex] | 片段数列集合. |
Snippet子元素:
元素/属性名称 | 类型 | 描述 |
---|---|---|
Snippet | string | 已启用的事务性邮件内容中定义的Snippet片段名称. |
请求:
GET
https://api.esv2.com/v2/Api/Snippets/234?apiKey=test_api_key1 HTTP/1.1
Accept-Encoding: gzip,deflate
User-Agent: Jakarta Commons-HttpClient/3.1
Host: api.esv2.com
|
OK 应答:
HTTP/1.1 200 OK Cache-Control: private Content-Type: text/xml; charset=utf-8 Content-Encoding: gzip Vary: Accept-Encoding Server: Microsoft-IIS/7.5 Set-Cookie: ASP.NET_SessionId=cu23cqm125fq1qih1kg4ux45; path=/; HttpOnly X-AspNetMvc-Version: 1.0 X-AspNet-Version: 2.0.50727 X-Powered-By: ASP.NET Date: Mon, 22 Jan 2018 12:56:22 GMT Content-Length: 349 <ApiResponse xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema”> <Data> <Snippets> <Snippet>SnippetName1</Snippet> <Snippet>SnippetName2</Snippet> <Snippet>SnippetName3</Snippet> <Snippet>SnippetName4</Snippet> </Snippets> </Data> </ApiResponse> |
当事务性邮件中不包含任何Snippet片段的OK 应答:
HTTP/1.1 200 OK Cache-Control: private Content-Type: text/xml; charset=utf-8 Content-Encoding: gzip Vary: Accept-Encoding Server: Microsoft-IIS/7.5 Set-Cookie: ASP.NET_SessionId=cu23cqm125fq1qih1kg4ux45; path=/; HttpOnly X-AspNetMvc-Version: 1.0 X-AspNet-Version: 2.0.50727 X-Powered-By: ASP.NET Date: Mon, 22 Jan 2018 12:56:22 GMT Content-Length: 171 <ApiResponse xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema”> <Data> <Snippets/> </Data> </ApiResponse> |