在 twilio studio 液体模板中提取数据

Extracting data in twilio studio liquid template

我正在尝试在 studio liquid 中获取 phone 数字-template.No 不管我变成什么模式它都不会提取 data.considering 数据是 return来自 http post

的对象

{{widgets.http_1.parsed.attributes.phone}}

{{widgets.http_1.parsed["attributes"].phone}}

{{widgets.http_1.parsed.[attributes].phone }}

{{widgets.http_1.body["attributes"].phone }}

{{widgets.http_1.body.attributes.phone}}

{{widgets.http_1.parsed["attributes"].phone}}

{accountSid=ac, activityName=Offline, activitySid=wa, 
      attributes={
        "onlyOutboundCallMode": false,
        "routing": {
            "skills": [
               "english"
            ]
        },
        "email": "@gmail.com",
        "phone":"12323"
    }, 
    available=false}

对于深度嵌套的对象,您需要在 Studio 外解析数据。查看 Studio 流程的 Studio 执行日志。查看 HTTP 请求小部件是否能够解析 JSON 结构。

返回此结构适用于解析它的 Studio:

let respObj = {
    accountSid: "ac", 
    activityName: "Offline",
    activitySid: "wa", 
    attributes: {
      onlyOutboundCallMode: false,
      routing: {
        skills: [
        "english"
        ]
        },
        email: "@gmail.com",
        phone:"12323"
    }, 
    available: false}

Studio 中的结果:

"parsed": {
        "accountSid": "ac",
        "activityName": "Offline",
        "activitySid": "wa",
        "attributes": {
          "onlyOutboundCallMode": false,
          "routing": {
            "skills": [
              "english"
            ]
          },
          "email": "@gmail.com",
          "phone": "12323"
        },
        "available": false
      }