我使用的是以下curl命令:
curl -X POST –user “apikey:xxx” \ –header “Content-Type: application/json” \ –header “Accept: application/json” \ –data-binary @profile.json \ “https://gateway-fra.watsonplatform.net/personality-insights/api“
IBM返回的响应是:
x{“code”:404,”sub_code”:”S00004″,”error”:”Not Found”}%
有人知道为什么吗?
这是我的.json文件
https://watson-developer-cloud.github.io/doc-tutorial-downloads/personality-insights/profile.json
回答:
尝试使用以下curl命令:
curl -X POST --user "apikey:xxxxxxxx" --header "Content-Type: application/json" --header "Accept: application/json" --data-binary @profile.json "https://gateway-fra.watsonplatform.net/personality-insights/api/v3/profile?version=2017-10-13&consumption_preferences=true&raw_scores=true"
将xxxxxxxx
替换为你的apikey。请避免在公共场合使用真实的apikey
,任何人都可以使用你的密钥。我已经编辑了问题以隐藏它。请参考Personality Insights API参考获取更多信息。