首页 文章

webhook在API.ai中不起作用

提问于
浏览
1

我有API.AI的以下自定义JavaScript代码 . 我在php中实现了一个简单的webhook来接收某些动作的数据 . 每当我检查API.AI控制台时它工作正常 . 但是使用以下代码会出现 Webhook call failed. Error: Webhooks can be used with version '20150415' or greater. 错误 . 请帮忙 .

$.ajax({
                type: "POST",
                url: baseUrl + "query",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                headers: {
                    "Authorization": "Bearer " + accessToken
                },

                data: JSON.stringify({query: text, lang: "en", sessionId: "<?php echo uniqid();?>", v:"20170712"}),
                success: function(data,url) {
                    console.log(url);
                    prepareResponse(data);
                },
                error: function(text) {
            console.log(text);
                    respond(messageInternalError);
                }
            });

1 回答

相关问题