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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
|
<?php return [
'version' => '1.0',
'info' => ['style' => 'AliGenie', 'product' => 'AliGenie', 'version' => 'oauth2_1.0'],
'directories' => [
[
'id' => 196076,
'title' => null,
'type' => 'directory',
'children' => ['GetSmartHomeSceneList', 'ExecuteSmartHomeScene', 'GetUserBasicInfo', 'GetUserPhone', 'GetSceneList', 'ExecuteScene', 'QueryDeviceList', 'PushDeviceNotification', 'CreatePlayingList'],
],
[
'id' => 196077,
'title' => null,
'type' => 'directory',
'children' => ['OAuth2TokenEndpoint', 'OAuth2RevocationEndpoint'],
],
],
'components' => [
'schemas' => [],
],
'apis' => [
'GetSmartHomeSceneList' => [
'summary' => '获取场景列表(全屋)',
'path' => '/v1.0/oauth2/iot/smart_home/scene/list',
'methods' => ['get'],
'schemes' => ['https'],
'security' => [
[
'OAuth 2.0 Bearer Token' => [],
],
],
'produces' => ['application/json'],
'operationType' => 'read',
'deprecated' => false,
'systemTags' => ['operationType' => 'get'],
'parameters' => [],
'responses' => [
200 => [
'schema' => [
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
'RequestId' => ['title' => 'Id of the request', 'description' => '', 'type' => 'string', 'example' => '435CF567-12DC-5761-AFA8-650774502E2D'."\n"],
'FamilySceneList' => [
'description' => '',
'type' => 'array',
'items' => [
'description' => '',
'type' => 'object',
'properties' => [
'familyId' => ['description' => '', 'type' => 'string', 'example' => '2iS1AH5eo8qrw1PYBL/Ulq=='],
'familyName' => ['description' => '', 'type' => 'string', 'example' => ''],
'sceneList' => [
'description' => '',
'type' => 'array',
'items' => [
'type' => 'object',
'properties' => [
'SceneId' => ['description' => '', 'type' => 'string', 'example' => '6813AH5586qrw1P5ln/123=='],
'SceneName' => ['description' => '', 'type' => 'string', 'example' => ''],
],
],
],
],
],
],
],
],
],
],
'staticInfo' => ['returnType' => 'synchronous'],
'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"435CF567-12DC-5761-AFA8-650774502E2D\\\\n\\",\\n \\"FamilySceneList\\": [\\n {\\n \\"familyId\\": \\"2iS1AH5eo8qrw1PYBL/Ulq==\\",\\n \\"familyName\\": \\"我的家\\",\\n \\"sceneList\\": [\\n {\\n \\"SceneId\\": \\"6813AH5586qrw1P5ln/123==\\",\\n \\"SceneName\\": \\"温馨模式\\"\\n }\\n ]\\n }\\n ]\\n}","type":"json"}]',
],
'ExecuteSmartHomeScene' => [
'summary' => '执行场景(全屋)',
'path' => '/v1.0/oauth2/iot/smart_home/scene/execute',
'methods' => ['post'],
'schemes' => ['https'],
'security' => [
[
'OAuth 2.0 Bearer Token' => [],
],
],
'consumes' => ['application/x-www-form-urlencoded'],
'produces' => ['application/json'],
'deprecated' => false,
'systemTags' => ['operationType' => 'none'],
'parameters' => [
[
'name' => 'FamilyId',
'in' => 'formData',
'schema' => ['description' => '', 'type' => 'string', 'required' => true, 'example' => '2iS1AH5eo8qrw1PYBL/Ulq=='],
],
[
'name' => 'SceneId',
'in' => 'formData',
'schema' => ['description' => '', 'type' => 'string', 'required' => true, 'example' => 'Y1lCALepjYmTEouxsTrkjB=='],
],
],
'responses' => [
200 => [
'schema' => [
'title' => 'Schema of Response',
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
'RequestId' => ['title' => 'Id of the request', 'description' => '', 'type' => 'string', 'example' => '435CF567-12DC-5761-AFA8-650774502E2D'],
],
],
],
],
'staticInfo' => ['returnType' => 'synchronous'],
'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"435CF567-12DC-5761-AFA8-650774502E2D\\"\\n}","type":"json"}]',
],
'GetUserBasicInfo' => [
'summary' => '获取',
'path' => '/v1.0/oauth2/users/basic',
'methods' => ['get'],
'schemes' => ['https'],
'security' => [
[
'OAuth 2.0 Bearer Token' => [],
],
],
'produces' => ['application/json'],
'operationType' => 'read',
'deprecated' => false,
'systemTags' => ['operationType' => 'get'],
'parameters' => [],
'responses' => [
200 => [
'schema' => [
'title' => 'Schema of Response',
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
'OpenId' => ['title' => '用户openId', 'description' => '', 'type' => 'string', 'example' => '3hPPBd9YuhfJQCzZ/07AAWdoO3K8zCb/KAqW96zPHXPiFkzjB/JfcWuuFHQQDaGZ4wVbNMV6wYuj075p/rhVLg=='],
'UnionIds' => [
'title' => '用户unionId列表',
'type' => 'array',
'items' => [
'type' => 'object',
'properties' => [
'OrganizationId' => ['title' => '组织id', 'type' => 'string'],
'UnionId' => ['title' => 'unionId', 'type' => 'string'],
],
],
],
'Nickname' => ['title' => '用户昵称', 'description' => '', 'type' => 'string', 'example' => 'xxxxxx'],
'AvatarUrl' => ['title' => '用户头像地址', 'description' => '', 'type' => 'string', 'example' => 'https://xxxxxx'],
'RequestId' => ['title' => '请求ID', 'description' => '', 'type' => 'string', 'example' => '4070039E-5822-1F32-9295-1D2883E48BA5'],
],
],
],
],
'staticInfo' => ['returnType' => 'synchronous'],
'responseDemo' => '[{"errorExample":"","example":"{\\n \\"OpenId\\": \\"3hPPBd9YuhfJQCzZ/07AAWdoO3K8zCb/KAqW96zPHXPiFkzjB/JfcWuuFHQQDaGZ4wVbNMV6wYuj075p/rhVLg==\\",\\n \\"UnionIds\\": [\\n {\\n \\"OrganizationId\\": \\"\\",\\n \\"UnionId\\": \\"\\"\\n }\\n ],\\n \\"Nickname\\": \\"xxxxxx\\",\\n \\"AvatarUrl\\": \\"https://xxxxxx\\",\\n \\"RequestId\\": \\"4070039E-5822-1F32-9295-1D2883E48BA5\\"\\n}","type":"json"}]',
],
'GetUserPhone' => [
'summary' => '获取天猫精灵用户绑定的手机号',
'path' => '/v1.0/oauth2/user/profile/phone',
'methods' => ['get'],
'schemes' => ['https'],
'security' => [
[
'OAuth 2.0 Bearer Token' => [],
],
],
'produces' => ['application/json'],
'operationType' => 'read',
'deprecated' => false,
'systemTags' => ['operationType' => 'get'],
'parameters' => [],
'responses' => [
200 => [
'schema' => [
'title' => 'Schema of Response',
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
'Phone' => ['title' => '天猫精灵用户绑定的手机号', 'description' => '', 'type' => 'string', 'example' => '18612345678'],
'RequestId' => ['title' => 'Id of the request', 'description' => 'Id of the request', 'type' => 'string', 'example' => 'CEADB586-51CB-1B6B-95BD-AB85A7A08E97'],
],
],
],
],
'staticInfo' => ['returnType' => 'synchronous'],
'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Phone\\": \\"18612345678\\",\\n \\"RequestId\\": \\"CEADB586-51CB-1B6B-95BD-AB85A7A08E97\\"\\n}","type":"json"}]',
],
'GetSceneList' => [
'summary' => '获取场景列表',
'path' => '/v1.0/oauth2/iot/scene/list',
'methods' => ['get'],
'schemes' => ['https'],
'security' => [
[
'OAuth 2.0 Bearer Token' => [],
],
],
'produces' => ['application/json'],
'operationType' => 'read',
'deprecated' => false,
'systemTags' => ['operationType' => 'get'],
'parameters' => [],
'responses' => [
200 => [
'schema' => [
'title' => 'Schema of Response',
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
'SceneList' => [
'title' => '场景列表',
'description' => '',
'type' => 'array',
'items' => [
'title' => '场景对象',
'description' => '',
'type' => 'object',
'properties' => [
'SceneId' => ['title' => '场景Id', 'description' => '', 'type' => 'string', 'example' => '840960b85c3c48e0bd7260c1718295fd'],
'SceneName' => ['title' => '场景名称', 'description' => '', 'type' => 'string', 'example' => ''],
],
],
],
'RequestId' => ['title' => '请求ID', 'description' => '', 'type' => 'string', 'example' => '435CF567-58DC-5761-AFA8-650772602E2D'],
],
],
],
],
'staticInfo' => ['returnType' => 'synchronous'],
'responseDemo' => '[{"errorExample":"","example":"{\\n \\"SceneList\\": [\\n {\\n \\"SceneId\\": \\"840960b85c3c48e0bd7260c1718295fd\\",\\n \\"SceneName\\": \\"回家场景\\"\\n }\\n ],\\n \\"RequestId\\": \\"435CF567-58DC-5761-AFA8-650772602E2D\\"\\n}","type":"json"}]',
],
'ExecuteScene' => [
'summary' => '执行场景',
'path' => '/v1.0/oauth2/iot/scene/execute',
'methods' => ['post'],
'schemes' => ['https'],
'security' => [
[
'OAuth 2.0 Bearer Token' => [],
],
],
'consumes' => ['application/x-www-form-urlencoded'],
'produces' => ['application/json'],
'deprecated' => false,
'systemTags' => ['operationType' => 'none'],
'parameters' => [
[
'name' => 'SceneId',
'in' => 'formData',
'schema' => ['title' => '场景Id', 'description' => '', 'type' => 'string', 'required' => false, 'example' => 'a84a55aa410e460a9ac753570c76fecc'],
],
],
'responses' => [
200 => [
'schema' => [
'title' => 'Schema of Response',
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
'RequestId' => ['description' => '', 'type' => 'string', 'example' => '191C79AD-F9F9-531E-B8C1-73DF6433B920'],
],
],
],
],
'staticInfo' => ['returnType' => 'synchronous'],
'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"191C79AD-F9F9-531E-B8C1-73DF6433B920\\"\\n}","type":"json"}]',
],
'QueryDeviceList' => [
'summary' => '查询设备列表',
'path' => '/v1.0/oauth2/device/list',
'methods' => ['get'],
'schemes' => ['https'],
'security' => [
[
'OAuth 2.0 Bearer Token' => [],
],
],
'produces' => ['application/json'],
'operationType' => 'read',
'deprecated' => false,
'systemTags' => ['operationType' => 'get'],
'parameters' => [],
'responses' => [
200 => [
'schema' => [
'title' => '返回数据体',
'description' => '',
'type' => 'object',
'properties' => [
'EncodeType' => ['title' => '实体类型', 'description' => '', 'type' => 'string', 'example' => 'PROJECT_ID'],
'EncodeKey' => ['title' => '实体key', 'description' => '', 'type' => 'string', 'example' => '125****0946'],
'DeviceList' => [
'title' => '设备列表',
'description' => '',
'type' => 'array',
'items' => [
'type' => 'object',
'properties' => [
'DeviceOpenId' => ['title' => '设备唯一标识', 'description' => '', 'type' => 'string', 'example' => 'jMR2********ojVJXk='],
'DeviceUnionIds' => [
'title' => '设备UnionId信息列表',
'type' => 'array',
'items' => [
'title' => '设备UnionId信息',
'type' => 'object',
'properties' => [
'OrganizationId' => ['title' => '组织ID', 'type' => 'string'],
'UnionId' => ['title' => 'UnionId', 'type' => 'string'],
],
],
],
'DeviceName' => ['title' => '设备名称', 'description' => '', 'type' => 'string', 'example' => ''],
'DeviceIconUrl' => ['title' => '设备图片地址', 'description' => '', 'type' => 'string', 'example' => 'https://XXXXXX'],
'Online' => ['title' => '在线状态,1:在线,0离线', 'description' => '', 'type' => 'string', 'example' => '1'],
],
],
],
'RequestId' => ['title' => '请求id', 'description' => '', 'type' => 'string', 'example' => '0EC7*726E'],
],
],
],
],
'staticInfo' => ['returnType' => 'synchronous'],
'responseDemo' => '[{"errorExample":"","example":"{\\n \\"EncodeType\\": \\"PROJECT_ID\\",\\n \\"EncodeKey\\": \\"125****0946\\",\\n \\"DeviceList\\": [\\n {\\n \\"DeviceOpenId\\": \\"jMR2********ojVJXk=\\",\\n \\"DeviceUnionIds\\": [\\n {\\n \\"OrganizationId\\": \\"123456\\",\\n \\"UnionId\\": \\"cJwXrIut3zIgcKyCiS7aKMAiEiE\\"\\n }\\n ],\\n \\"DeviceName\\": \\"CC10电池版\\",\\n \\"DeviceIconUrl\\": \\"https://XXXXXX\\",\\n \\"Online\\": \\"1\\"\\n }\\n ],\\n \\"RequestId\\": \\"0EC7*726E\\"\\n}","type":"json"}]',
],
'PushDeviceNotification' => [
'summary' => '推送设备通知',
'path' => '/v1.0/oauth2/device/notification/push',
'methods' => ['post'],
'schemes' => ['https'],
'security' => [
[
'OAuth 2.0 Bearer Token' => [],
],
],
'consumes' => ['application/x-www-form-urlencoded'],
'produces' => ['application/json'],
'operationType' => 'write',
'deprecated' => false,
'systemTags' => ['operationType' => 'none'],
'parameters' => [
[
'name' => 'body',
'in' => 'formData',
'style' => 'json',
'schema' => [
'title' => '消息推送入参对象。',
'description' => '',
'type' => 'object',
'properties' => [
'SendTarget' => [
'title' => '消息推送的目标信息。',
'description' => '',
'type' => 'object',
'properties' => [
'TargetType' => [
'title' => '推送的目标类型,获取到对应设备的类型 '."\n"
.'DEVICE_UNION_ID:设备unionId'."\n"
.'DEVICE_OPEN_ID:设备openId',
'description' => '',
'type' => 'string',
'required' => false,
'example' => 'DEVICE_OPEN_ID',
'enum' => ['DEVICE_UNION_ID', 'DEVICE_OPEN_ID'],
],
'TargetIdentity' => ['title' => '推送目标类型对应的标识值。', 'description' => '', 'type' => 'string', 'required' => false, 'example' => '2VpiDQ6aMjxz******Eo7r6e08oIVZ3fKrm5TyEfY='],
],
'required' => true,
],
'MessageTemplateId' => ['title' => '消息模板,在天猫精灵应用平台中申请消息模板时得到的模板id。', 'description' => '', 'type' => 'string', 'required' => true, 'example' => '2iU81*****G9elJ'],
'PlaceHolder' => [
'title' => '占位符信息,例如:模板是【你好,{nick}!】这里可以是:{"nick":"小甜甜"}',
'description' => '',
'type' => 'object',
'required' => false,
'additionalProperties' => ['type' => 'string', 'example' => '', 'description' => ''],
],
'EncodeType' => ['title' => '实体类型', 'description' => '', 'type' => 'string', 'required' => true, 'example' => 'PROJECT_ID'],
'EncodeKey' => ['title' => '实体key', 'description' => '', 'type' => 'string', 'required' => true, 'example' => '1923792******8R7392'],
'OrganizationId' => ['title' => '组织标识,推送类型是XX_UNION_XX时才需要配。当存在多种途径获取猫精设备或用户标识且又需要能互通的情况下需要找平台申请组织,申请通过后由平台分配得到。', 'description' => '', 'type' => 'string', 'required' => false, 'example' => '29837******2938'],
'IsDebug' => ['title' => '调试标识', 'description' => '', 'type' => 'boolean', 'required' => false, 'example' => 'false'],
],
'required' => false,
],
],
[
'name' => 'TenantInfo',
'in' => 'formData',
'style' => 'json',
'schema' => [
'title' => '身份信息。',
'description' => '',
'type' => 'object',
'properties' => [
'SubjectId' => ['title' => '猫精应用id,【开发者平台-技能应用】创建应用后得到的应用id', 'description' => '', 'type' => 'string', 'required' => false, 'example' => '12797******304102'],
],
'required' => false,
],
],
],
'responses' => [
200 => [
'schema' => [
'title' => 'Schema of Response',
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
'requestId' => ['title' => '请求ID', 'description' => '', 'type' => 'string', 'example' => '908FA068-529C-0C20-8DB5-63B0EF7CFF1F'],
],
],
],
],
'staticInfo' => ['returnType' => 'synchronous'],
'responseDemo' => '[{"errorExample":"","example":"{\\n \\"requestId\\": \\"908FA068-529C-0C20-8DB5-63B0EF7CFF1F\\"\\n}","type":"json"}]',
],
'CreatePlayingList' => [
'summary' => '创建播放列表',
'path' => '/v1.0/oauth2/content/playing/create',
'methods' => ['post'],
'schemes' => ['https'],
'security' => [
[
'OAuth 2.0 Bearer Token' => [],
],
],
'consumes' => ['application/x-www-form-urlencoded'],
'produces' => ['application/json'],
'operationType' => 'readAndWrite',
'deprecated' => false,
'systemTags' => ['operationType' => 'none'],
'parameters' => [
[
'name' => 'OpenCreatePlayingListRequest',
'in' => 'formData',
'style' => 'json',
'schema' => [
'title' => '业务参数',
'description' => '',
'type' => 'object',
'properties' => [
'PlayFrom' => ['title' => '播放来源,配置播控能力的唯一标识'."\n"
."\n"
.'可空,默认为default', 'description' => '', 'type' => 'string', 'required' => false, 'example' => 'default'],
'ContentType' => [
'title' => '播放内容类型'."\n"
."\n"
.'内容:content;专辑:album;歌单:collect',
'description' => '',
'type' => 'string',
'required' => true,
'example' => 'content',
'enum' => ['content', 'album', 'collect'],
],
'ContentList' => [
'title' => '播放内容列表'."\n"
."\n"
.'若是内容,支持多个;若是专辑,只有第一个有效。'."\n",
'description' => '',
'type' => 'array',
'items' => [
'type' => 'object',
'properties' => [
'RawId' => ['title' => '三方id'."\n"
."\n"
.'如果是内容则是内容id;如果是专辑则是专辑id'."\n", 'description' => '', 'type' => 'string', 'required' => true, 'example' => '12345'],
'Source' => ['title' => '来源'."\n", 'description' => '', 'type' => 'string', 'required' => true, 'example' => 'ximalayaH5'],
],
'required' => true,
],
'required' => true,
],
'Index' => ['title' => '播放的index'."\n"
."\n"
.'可空。默认为0,表示从头播放', 'description' => '', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '1'],
'NeedAlbumContinued' => ['title' => '专辑是否续播,比如上次专辑听到第五集,是否继续从第五集开始。默认为true', 'description' => '', 'type' => 'boolean', 'required' => false, 'example' => 'true', 'default' => 'true'],
'PlayMode' => [
'title' => '播放模式'."\n"
."\n"
.'列表循环:Repeat;随机:Shuffle;单曲循环:RepeatOne;顺序播放:Normal。',
'description' => '',
'type' => 'string',
'required' => false,
'example' => 'Normal',
'enum' => ['Repeat', 'Shuffle', 'RepeatOne', 'Normal'],
],
'ExtendInfo' => ['title' => '扩展信息', 'description' => '', 'type' => 'object', 'required' => false, 'example' => '{}'],
'RequestId' => ['title' => '系统RequestId,调用方不需要传 系统自动填写', 'type' => 'string'],
],
'required' => true,
],
],
[
'name' => 'DeviceInfo',
'in' => 'query',
'style' => 'json',
'schema' => [
'title' => '设备标识信息',
'description' => '',
'type' => 'object',
'properties' => [
'EncodeType' => [
'title' => '编码类型,此处填写UC_CLIENT_ID。',
'description' => '',
'type' => 'string',
'required' => true,
'example' => 'UC_CLIENT_ID',
'enum' => ['UC_CLIENT_ID'],
],
'EncodeKey' => ['title' => '编码类型对应的值,此处填写该产品所在项目的Project ID。请在天猫精灵AI平台的控制台中查看。', 'description' => '', 'type' => 'string', 'required' => true, 'example' => '123'],
'IdType' => [
'title' => '设备Id的类型 : OPEN_ID:默认的设备ID标识。 UNION_ID: 组织维度的设备ID标识,需要提前在开放平台申请组织。',
'description' => '',
'type' => 'string',
'required' => true,
'example' => 'OPEN_ID',
'enum' => ['OPEN_ID', 'UNION_ID'],
],
'Id' => ['title' => '设备标识,填写deviceOpenId或deviceUnionId的值。', 'description' => '', 'type' => 'string', 'required' => true, 'example' => '123'],
'OrganizationId' => ['title' => '组织ID,如果IdType为UNION_ID时必填。', 'description' => '', 'type' => 'string', 'required' => false, 'example' => '1'],
],
'required' => true,
],
],
],
'responses' => [
200 => [
'schema' => [
'title' => 'Schema of Response',
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
'RequestId' => ['description' => '', 'type' => 'string', 'example' => '10002398812'],
],
],
],
],
'staticInfo' => ['returnType' => 'synchronous'],
'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"10002398812\\"\\n}","type":"json"}]',
],
'OAuth2TokenEndpoint' => [
'summary' => 'OAuth2令牌端点',
'path' => '/v1.0/oauth2/token',
'methods' => ['post'],
'schemes' => ['https'],
'security' => [
[
'AliGenie_Auth_SPI' => [],
],
],
'consumes' => ['application/x-www-form-urlencoded'],
'produces' => ['application/json'],
'deprecated' => false,
'systemTags' => ['operationType' => 'none'],
'parameters' => [
[
'name' => 'GrantType',
'in' => 'formData',
'schema' => ['title' => '授权类型,必填。'."\n"
.'authorization_code: 用授权码来获取访问令牌'."\n"
.'refresh_token: 刷新访问令牌', 'description' => '', 'type' => 'string', 'required' => false, 'example' => 'authorization_code'],
],
[
'name' => 'Code',
'in' => 'formData',
'schema' => ['title' => '授权码,通过授权码换取访问令牌时必填。', 'description' => '', 'type' => 'string', 'required' => false, 'example' => 'rf3mi4JOU-xRIX2zEuRLHi-U9mPnvISeSphbwiBHJ5mEKZtG-xJsbBWrq8RmhQEPRYh0JOd3DaS_VZ90soD_YrsT4OBtgD06DmdIKL2_5KFfI6p_SjXX2-UMJuGfXDkB'],
],
[
'name' => 'RedirectUri',
'in' => 'formData',
'schema' => ['title' => '重定向地址,该值必须与您发起授权请求的参数值完全一致。通过授权码换取访问令牌时必填。', 'description' => '', 'type' => 'string', 'required' => false, 'example' => 'https://xxx.xxx.com/xxx'],
],
[
'name' => 'RefreshToken',
'in' => 'formData',
'schema' => ['title' => '刷新令牌,刷新访问令牌时必填。', 'description' => '', 'type' => 'string', 'required' => false, 'example' => 'zsEcmaUeb8-NZW4IIUDD7qdgBNflrj6fH8BXJYbW9iXihZTgvbcr1_utC9p5HJLn_lXVwhfivBTgUQZBCGvGl5lxqaxFhmFtt-OrBduFQKL9x8p2lpEMKlxuKHZZZJ3A'],
],
],
'responses' => [
200 => [
'schema' => [
'title' => 'Schema of Response',
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
'AccessToken' => ['title' => '天猫精灵给您的应用颁发的令牌。', 'description' => '', 'type' => 'string', 'example' => 'UJMiksSwuMJvwXrJLULMykSw6qZ6VqaxOkN4qd5cW1Q4HhsLxvUR5xVOIv1WB3br5LoP20lPa8xiYLSMbt8JqHACXdSdw7fNkhRTIHnadxWW5jfDg7BELUB0FcFfPiv0'],
'ExpiresIn' => ['title' => '访问令牌的剩余生命周期(以秒为单位)。', 'description' => '', 'type' => 'integer', 'format' => 'int64', 'example' => '604799'],
'RefreshToken' => ['title' => '可用于获取新访问令牌的令牌。', 'description' => '', 'type' => 'string', 'example' => 'zsEcmaUeb8-NZW4IIUDD7qdgBNflrj6fH8BXJYbW9iXihZTgvbcr1_utC9p5HJLn_lXVwhfivBTgUQZBCGvGl5lxqaxFhmFtt-OrBduFQKL9x8p2lpEMKlxuKHZZZJ3A'."\n"],
'Scope' => ['title' => 'access_token 授予的访问权限范围,表示为以空格分隔、区分大小写的字符串列表。', 'description' => '', 'type' => 'string', 'example' => 'aligenie:user:basic:read aligenie:iot:scene:read'],
'TokenType' => ['title' => '返回的令牌的类型。此时,此字段的值始终设置为 Bearer。', 'description' => '', 'type' => 'string', 'example' => 'Bearer'],
'RequestId' => ['title' => '请求ID。', 'description' => '', 'type' => 'string', 'example' => '4070039E-5822-1F32-9295-1D2883E48BA5'],
],
],
],
],
'staticInfo' => ['returnType' => 'synchronous'],
'responseDemo' => '[{"errorExample":"","example":"{\\n \\"AccessToken\\": \\"UJMiksSwuMJvwXrJLULMykSw6qZ6VqaxOkN4qd5cW1Q4HhsLxvUR5xVOIv1WB3br5LoP20lPa8xiYLSMbt8JqHACXdSdw7fNkhRTIHnadxWW5jfDg7BELUB0FcFfPiv0\\",\\n \\"ExpiresIn\\": 604799,\\n \\"RefreshToken\\": \\"zsEcmaUeb8-NZW4IIUDD7qdgBNflrj6fH8BXJYbW9iXihZTgvbcr1_utC9p5HJLn_lXVwhfivBTgUQZBCGvGl5lxqaxFhmFtt-OrBduFQKL9x8p2lpEMKlxuKHZZZJ3A\\\\n\\",\\n \\"Scope\\": \\"aligenie:user:basic:read aligenie:iot:scene:read\\",\\n \\"TokenType\\": \\"Bearer\\",\\n \\"RequestId\\": \\"4070039E-5822-1F32-9295-1D2883E48BA5\\"\\n}","type":"json"}]',
],
'OAuth2RevocationEndpoint' => [
'summary' => 'OAuth2令牌撤销端点',
'path' => '/v1.0/oauth2/revoke',
'methods' => ['post'],
'schemes' => ['https'],
'security' => [
[
'AliGenie_Auth_SPI' => [],
],
],
'consumes' => ['application/x-www-form-urlencoded'],
'produces' => ['application/json'],
'deprecated' => false,
'systemTags' => ['operationType' => 'none'],
'parameters' => [
[
'name' => 'Token',
'in' => 'formData',
'schema' => ['title' => '要撤销的令牌,可以是访问令牌或刷新令牌。'."\n"
.'如果传递的是access_token,则仅会撤销access_token,refresh_token依然可以刷新获取新的访问令牌。'."\n"
.'如果传递的是refresh_token,则会同时撤销access_token和对应的refresh_token。', 'description' => '', 'type' => 'string', 'required' => false, 'example' => 'UJMiksSwuMJvwXrJLULMykSw6qZ6VqaxOkN4qd5cW1Q4HhsLxvUR5xVOIv1WB3br5LoP20lPa8xiYLSMbt8JqHACXdSdw7fNkhRTIHnadxWW5jfDg7BELUB0FcFfPiv0'],
],
[
'name' => 'TokenTypeHint',
'in' => 'formData',
'schema' => ['title' => '令牌类型的提示,可以是access_token或refresh_token,用于帮助授权服务器理解要撤销的是哪种类型的令牌。', 'description' => '', 'type' => 'string', 'required' => false, 'example' => 'refresh_token'],
],
],
'responses' => [
200 => [
'schema' => [
'title' => 'Schema of Response',
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
'RequestId' => ['title' => 'Id of the request', 'description' => 'Id of the request', 'type' => 'string', 'example' => '4070039E-5822-1F32-9295-1D2883E48BA5'],
],
],
],
],
'staticInfo' => ['returnType' => 'synchronous'],
'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"4070039E-5822-1F32-9295-1D2883E48BA5\\"\\n}","type":"json"}]',
],
],
'endpoints' => [
['regionId' => 'cn-zhangjiakou', 'endpoint' => 'openapi.aligenie.com'],
],
];
|