简体   繁体   English

Twilio - 如何为入站呼叫更新 IVR 流中定义的任务属性?

[英]Twilio - How to update Task attributes defined in IVR flow for an inbound call?

I am wondering how to update event.TaskAttributes.我想知道如何更新event.TaskAttributes。 variable value of a current task.当前任务的变量值。 I thought it's straight forward from the example by Twilio but I am not seeing any change If I followed the same and try to set/update a value of a specific attribute (defined in IVR voice flow widget).我认为这是从 Twilio 的示例中直接得出的,但是如果我遵循相同的方法并尝试设置/更新特定属性的值(在 IVR 语音流小部件中定义),我没有看到任何变化。

https://www.twilio.com/docs/taskrouter/api/task#action-update https://www.twilio.com/docs/taskrouter/api/task#action-update

For example, there is an attribute called language which is a gather input digits field in IVR flow and at some point in the execution (while the caller is in waiting queue), we would like to update it to a different value.例如,有一个名为language的属性,它是 IVR 流中的一个收集输入数字字段,在执行的某个时刻(当呼叫者在等待队列中时),我们想将其更新为不同的值。 I tried via postman but it does nothing.我尝试通过 postman 但它什么也没做。 Any help is greatly appreciated.任何帮助是极大的赞赏。

https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXX/Tasks/WTXXXXXX https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXX/Tasks/WTXXXXXX

{ "attributes": { "language": "6" } } { “属性”:{ “语言”: “6” } }

Thanx!谢谢!

In Postman use url-encoded format.在 Postman 中使用 url 编码格式。 The request should be encoded.请求应该被编码。 Use 'Attributes' in place of 'attributes'.使用“属性”代替“属性”。 I am attaching a sample cURL request, this might be helpful我附上了一个示例 cURL 请求,这可能会有帮助

    curl -X POST \
  https://taskrouter.twilio.com/v1/Workspaces/WS...../Tasks/WTXXXX...... \
  -H 'Authorization: Basic XXXXXXXXXXXXX' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'Attributes=%7B%22test2%22%3A%201%7D'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM