POST api/v1/Common/WxSendTmplMessage

发送微信模板消息

请求信息(Request)

URI 参数

None.

Body 参数

WxSendTmplMsgDTO
名称描述类型备注
Type

AppTmplType

None.

UserIds

integer 集合

None.

Message

WxTmplMsg

None.

请求格式

application/json, text/json

Sample:
{
  "Type": 1,
  "UserIds": [
    1,
    2
  ],
  "Message": {
    "touser": "sample string 1",
    "template_id": "sample string 2",
    "url": "sample string 3",
    "data": {
      "sample string 1": {
        "value": "sample string 1",
        "color": "sample string 2"
      },
      "sample string 2": {
        "value": "sample string 1",
        "color": "sample string 2"
      }
    }
  }
}

application/xml, text/xml

Sample:
<WxSendTmplMsgDTO xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WLife.Application.DTOs">
  <Message xmlns:d2p1="http://schemas.datacontract.org/2004/07/WLife.Application.WeiXin">
    <d2p1:data xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringWxTmplDatatiWuPZLQ>
        <d3p1:Key>sample string 1</d3p1:Key>
        <d3p1:Value>
          <d2p1:color>sample string 2</d2p1:color>
          <d2p1:value>sample string 1</d2p1:value>
        </d3p1:Value>
      </d3p1:KeyValueOfstringWxTmplDatatiWuPZLQ>
      <d3p1:KeyValueOfstringWxTmplDatatiWuPZLQ>
        <d3p1:Key>sample string 2</d3p1:Key>
        <d3p1:Value>
          <d2p1:color>sample string 2</d2p1:color>
          <d2p1:value>sample string 1</d2p1:value>
        </d3p1:Value>
      </d3p1:KeyValueOfstringWxTmplDatatiWuPZLQ>
    </d2p1:data>
    <d2p1:template_id>sample string 2</d2p1:template_id>
    <d2p1:touser>sample string 1</d2p1:touser>
    <d2p1:url>sample string 3</d2p1:url>
  </Message>
  <Type>HotelOrderSucess</Type>
  <UserIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:int>1</d2p1:int>
    <d2p1:int>2</d2p1:int>
  </UserIds>
</WxSendTmplMsgDTO>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'WxSendTmplMsgDTO'.

响应信息(Response)

资源描述

RequestResult
名称描述类型备注
Status

状态(0:成功,1:失败)

integer

None.

Message

导致失败的相关消息

string

None.

Total

集合总数,用于分页时使用

integer

None.

响应格式

application/json, text/json

Sample:
{
  "Status": 1,
  "Message": "sample string 2",
  "Total": 3
}

application/xml, text/xml

Sample:
<RequestResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WLife.Application">
  <Message>sample string 2</Message>
  <Status>1</Status>
  <Total>3</Total>
</RequestResult>