-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcoze-final.yaml
More file actions
156 lines (156 loc) · 5.1 KB
/
Copy pathcoze-final.yaml
File metadata and controls
156 lines (156 loc) · 5.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
openapi: 3.0.0
info:
title: 微信文章发布
description: 微信公众号文章发布插件
version: 1.0.0
servers:
- url: https://mp.miyucaicai.cn
paths:
/coze/token:
get: # 改为GET,符合微信官方规范
operationId: getAccessToken
parameters: # 改为QUERY传参
- name: appid
in: query
required: true
schema: { type: string }
description: 微信公众号AppID
- name: secret
in: query
required: true
schema: { type: string }
description: 微信公众号AppSecret
- name: grant_type
in: query
required: false
schema: { type: string, default: client_credential }
description: 授权类型(固定值)
responses:
'200':
description: 令牌获取成功
content:
application/json:
schema:
type: object
properties:
success: { type: boolean, example: true }
data:
properties:
access_token: { description: 微信API访问令牌, type: string }
expires_in: { description: 过期时间(秒), type: integer }
type: object
type: object
summary: 获取微信访问令牌
/coze/upload:
post:
operationId: uploadImage
parameters:
- description: 微信API访问令牌
in: query
name: access_token
required: true
schema: {type: string}
requestBody:
content:
multipart/form-data:
schema:
properties:
media:
description: 封面图片文件(≤2MB,JPG/PNG)
format: binary
type: string
type: {default: thumb, description: 素材类型(固定为thumb), type: string}
required: [media]
type: object
responses:
'200':
content:
application/json:
schema:
properties:
success:
example: true
type: boolean
data:
properties:
media_id: {description: 图片素材ID, type: string}
url: {description: 图片在线链接, type: string}
type: object
type: object
summary: 上传图片素材
/coze/draft:
post:
operationId: createDraft
parameters:
- description: 微信API访问令牌
in: query
name: access_token
required: true
schema: {type: string}
requestBody:
content:
application/json:
schema:
properties:
articles:
items:
properties:
author: {description: 文章作者(可选), type: string}
content: {description: 文章内容(HTML格式), type: string}
digest: {description: 文章摘要(可选), type: string}
show_cover_pic: {default: 1, description: 是否显示封面(1=显示,0=不显示), type: integer}
thumb_media_id: {description: 封面图片media_id, type: string}
title: {description: 文章标题, type: string}
required: [title, content, thumb_media_id]
type: object
type: array
required: [articles]
type: object
responses:
'200':
content:
application/json:
schema:
properties:
success:
example: true
type: boolean
data:
properties:
media_id: {description: 草稿ID(用于发布), type: string}
type: object
type: object
summary: 创建文章草稿
/coze/publish:
post:
operationId: publishArticle
parameters:
- description: 微信API访问令牌
in: query
name: access_token
required: true
schema: {type: string}
requestBody:
content:
application/json:
schema:
properties:
media_id: {description: 草稿ID(从createDraft获取), type: string}
required: [media_id]
type: object
responses:
'200':
content:
application/json:
schema:
properties:
success:
example: true
type: boolean
data:
properties:
msg_id: {description: 公众号消息ID(可选), type: integer}
publish_id: {description: 发布ID, type: string}
type: object
type: object
summary: 发布文章到公众号