简体   繁体   中英

How do I run IBM Watson Tone Analysis example code?

I am trying to run the test code for IBM Watson Tone Analysis

curl -X POST -u "apikey:{apikey}" \
--header "Content-Type: application/json" \
--data-binary @{path_to_file}tone.json \
"{url}/v3/tone?version=2017-09-21

However, I keep getting the error:

Warning: Couldn't read data from file Warning: "{pathname}tone.json", this makes an empty POST.

{"code":401, "error": "Unauthorized"}%

You have two different errors.

The first indicates that the path that you have specified for the tone.json file is incorrect.

The second indicates that you are using the wrong credentials for the url that you are attempting to hit. Ie. Either your apikey or your endpoint is incorrect.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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