5. 小程序-模板消息

5.1. 模板列表接口

Type: GET

Content-Type: application/x-www-form-urlencoded;charset=utf-8

Description: 模板列表接口

Request-example:

curl -X GET -k -i https://dev.wanwuweb.com:8888/api/template/list

Response-fields:

FieldTypeDescriptionSince

code

int32

返回码

-

message

string

返回码描述信息

-

data

object

返回数据

-

└─magazine

object

杂志模板

-

     └─slogan1

string

标语1

-

     └─slogan2

string

标语2

-

     └─img

string

图片

-

     └─list

array

模板列表

-

          └─id

int64

主键id

-

          └─templateId

string

模板id

-

          └─title

string

模板标题

-

          └─subTitle

string

副标题

-

          └─isSubscribed

boolean

是否订阅

-

          └─isFreeTag

boolean

是否免费

-

└─media

object

媒体模板

-

     └─slogan1

string

标语1

-

     └─slogan2

string

标语2

-

     └─img

string

图片

-

     └─list

array

模板列表

-

          └─id

int64

主键id

-

          └─templateId

string

模板id

-

          └─title

string

模板标题

-

          └─subTitle

string

副标题

-

          └─isSubscribed

boolean

是否订阅

-

          └─isFreeTag

boolean

是否免费

-

Response-example:

{
	"code": 738,
	"message": "success",
	"data": {
		"magazine": {
			"slogan1": "kkyz8z",
			"slogan2": "sd6tsm",
			"img": "ij1gh3",
			"list": [
				{
					"id": 972,
					"templateId": "158",
					"title": "vc6qc0",
					"subTitle": "8kmqor",
					"isSubscribed": true,
					"isFreeTag": true
				}
			]
		},
		"media": {
			"slogan1": "b5h7j1",
			"slogan2": "o3jfz4",
			"img": "1tzc2d",
			"list": [
				{
					"id": 938,
					"templateId": "158",
					"title": "dwdi1f",
					"subTitle": "lwhsk8",
					"isSubscribed": true,
					"isFreeTag": true
				}
			]
		}
	}
}

5.2. 订阅模板消息接口

Type: POST

Content-Type: application/json; charset=utf-8

Description: 订阅模板消息接口

Body-parameters:

ParameterTypeDescriptionRequiredSince

templateId

string

模板id

false

-

Request-example:

curl -X POST -k -H 'Content-Type: application/json; charset=utf-8' -i https://dev.wanwuweb.com:8888/api/template/subscribe? --data '{
	"templateId": "158"
}'

Response-fields:

FieldTypeDescriptionSince

code

int32

返回码

-

message

string

返回码描述信息

-

data

object

返回数据

-

Response-example:

{
	"code": 63,
	"message": "success",
	"data": 846
}

5.3. 取消订阅模板消息接口

Type: POST

Content-Type: application/json; charset=utf-8

Description: 取消订阅模板消息接口

Body-parameters:

ParameterTypeDescriptionRequiredSince

templateId

string

模板id

false

-

Request-example:

curl -X POST -k -H 'Content-Type: application/json; charset=utf-8' -i https://dev.wanwuweb.com:8888/api/template/unsubscribe? --data '{
	"templateId": "158"
}'

Response-fields:

FieldTypeDescriptionSince

code

int32

返回码

-

message

string

返回码描述信息

-

data

object

返回数据

-

Response-example:

{
	"code": 986,
	"message": "success",
	"data": 211
}