Dialogflow POST:方法列表意图代码 400:方法:projects.agent.intents.list
Dialogflow POST: Method List Intents Code 400: Method: projects.agent.intents.list
在 API 参考中指出,除项目名称外,所有参数都是可选的。
但是当我尝试这个时:
url = 'https://dialogflow.googleapis.com/v2beta1/projects/'+config["DFproject"]+'/agent/intents'
headers = {'Authorization': "Bearer "+access_token, 'content-type': 'application/json'}
r = requests.post(url, headers=headers)
我得到:
{'error': {'code': 400, 'message': "Errors in '' intent: display_name is a required field.", 'status': 'INVALID_ARGUMENT'}}
我认为 display_name 来自响应。
那我应该怎么设置呢?
这是API:Google API
错误是您在 url 中使用了 POST。您应该使用 GET 来代替检索。
如果您想使用 API 并且似乎无法在 Postman 上设置身份验证,请随意使用:https://developers.google.com/oauthplayground/
此供参考:https://cloud.google.com/dialogflow/docs/reference/rest/v2-overview
在 API 参考中指出,除项目名称外,所有参数都是可选的。
但是当我尝试这个时:
url = 'https://dialogflow.googleapis.com/v2beta1/projects/'+config["DFproject"]+'/agent/intents'
headers = {'Authorization': "Bearer "+access_token, 'content-type': 'application/json'}
r = requests.post(url, headers=headers)
我得到:
{'error': {'code': 400, 'message': "Errors in '' intent: display_name is a required field.", 'status': 'INVALID_ARGUMENT'}}
我认为 display_name 来自响应。 那我应该怎么设置呢? 这是API:Google API
错误是您在 url 中使用了 POST。您应该使用 GET 来代替检索。
如果您想使用 API 并且似乎无法在 Postman 上设置身份验证,请随意使用:https://developers.google.com/oauthplayground/
此供参考:https://cloud.google.com/dialogflow/docs/reference/rest/v2-overview