Curl 将IBM Watson Knowledge Studio模型id添加到IBM Discovery

Curl 将IBM Watson Knowledge Studio模型id添加到IBM Discovery,curl,ibm-watson,watson-discovery,Curl,Ibm Watson,Watson Discovery,我试图将我的Watson Knowledge Studio模型id添加到我的Watson Discovery配置中 使用此命令下载我的配置非常有效: curl-u“{username}”:“{password}”https://gateway.watsonplatform.net/discovery/api/v1/environments/{environment_id}/configurations/{configuration_id}?version=2016-12-01“>my_confi

我试图将我的Watson Knowledge Studio模型id添加到我的Watson Discovery配置中

使用此命令下载我的配置非常有效:

curl-u“{username}”:“{password}”https://gateway.watsonplatform.net/discovery/api/v1/environments/{environment_id}/configurations/{configuration_id}?version=2016-12-01“>my_config.json
但当我刚刚尝试上载此文件时,没有使用此命令进行任何更改:

curl-X PUT-u“{username}”:“{password}”-H”内容类型:application/json“-F configuration=@my_config.json”https://gateway.watsonplatform.net/discovery/api/v1/environments/{environment_id}/configurations/{configuration_id}?版本=2016-12-01“
我总是会得到一个:

{
“代码”:400,
“错误”:“意外令牌-
}

我错过了什么吗?

在IBM的帮助下,文档似乎是错的。 正确的命令是

curl -X PUT -u "{username}":"{password}" -H "Content-Type: application/json" -d@my_config.json "https://gateway.watsonplatform.net/discovery/api/v1/environments/{environment_ID}/configurations/{Configuration_ID}?version=2016-12-01"

我同意-文件是错误的。 对我有用的是:

1) 从已编辑的my_config.json配置文件中删除配置Id(因为这是默认配置)

2) 插入新配置(并获取新生成的配置Id>注意,请求中未设置配置Id)


您能否验证正在作为配置上载的JSON文件?它可能有错误。没有错误,我验证它。
 curl -X POST -u {username}":"{password}"  -H "Content-Type: application/json" -d@my_config.json "https://gateway.watsonplatform.net/discovery/api/v1/environments/{environment_id}/configurations?version=2016-12-01"