# addInstructToSiriShortcut ^8.7
添加Siri自定义指令 Shortcut
# 请求参数
| Prop | Type | Default | Comment | 
|---|---|---|---|
| sceneName | String | N/A | 执行的场景名称,同一个sceneId下不能同名 | 
| sceneId | String | N/A | 执行的场景ID,可以用deviceId | 
| jsonData | String | N/A | 执行场景需要的参数 json字符串 | 
| url | String | N/A | 执行场景的url,如执行场景的url为/v2/scene/execute,(scheme为https://mp-prod.smartmidea.net:443/mas/v5/app/proxy?alias=),执行的url返回成功的code必须为0 | 
| httpMethod: | String | N/A | "get/post",不区分大小写 | 
# 接口调用示例
const params = {
    sceneName:"空调控制123", //string:执行的场景名称,同一个sceneId下不能同名
    sceneId:"11934323", //string:执行的场景ID,可以用deviceId
    jsonData: "{'control':'on','temp':'24.5'}",
    url:"/v2/scene/execut", 
    httpMethod:"get", //string:不区分大小写,
}
this.$bridge
  .addInstructToSiriShortcut(params)
  .then(res => {
    this.$alert(res)
  })
  .catch(err => {
    this.$toast(err)
  })
 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
- 成功时返回 Object(res)
 
| Prop | Type | Default | Comment | 
|---|---|---|---|
status |  string |  N/A |  "0"用户取消添加 “1” 添加成功 | 
- 失败时返回
 
| Prop | Type | Default | Comment | 
|---|---|---|---|
error |  string |  N/A |  参数不全 | 
# 接口返回示例
{
    "status": "0"  // // "0"用户取消添加 “1” 添加成功
}
{
  "error":"参数不全"
}
 1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9