tone-analyzer

Can't access IBM Tone Analyzer API?

狂风中的少年 提交于 2021-01-27 04:27:52
问题 I'm trying to use the Tone Analyzer API in a Laravel application. No matter what I try, I always get the same response of {"code":401, "error": "Unauthorized"} . I suspect my issue is that I can't figure out how to pass in the API key, but the official documentation is no help whatsoever because it only contains instructions for using cURL in the command line. My code currently looks like this (though I have tried many many other iterations. If anyone needs me to I can post all the other

Can't access IBM Tone Analyzer API?

孤街醉人 提交于 2021-01-27 04:27:29
问题 I'm trying to use the Tone Analyzer API in a Laravel application. No matter what I try, I always get the same response of {"code":401, "error": "Unauthorized"} . I suspect my issue is that I can't figure out how to pass in the API key, but the official documentation is no help whatsoever because it only contains instructions for using cURL in the command line. My code currently looks like this (though I have tried many many other iterations. If anyone needs me to I can post all the other

Error on client side when using iBM Bluemix tone analyzer token fetched on server side

荒凉一梦 提交于 2019-12-12 02:46:57
问题 I've already gotten a token on the server side and stored it in a cookie, but I can't seem to figure out why I'm getting an error when I query the api with that token. Here's the jQuery ajax request I'm sending: $.ajax({ url:'https://gateway.watsonplatform.net/tone-analyzer/api/v3/tone', data:{ 'X-Watson-Authorization-Token':readCookie('token'), 'text':input, 'version':'v3', 'version_date':'2016-05-19' }, dataType:'jsonp', contentType:'application/json', method:'GET', success:function(tone){

iOS/IBM Cloud/Swift: Post to Watson API using AlamoFire

核能气质少年 提交于 2019-12-11 06:47:54
问题 I am trying to post to the Watson tone analyzer API using AlamoFire with the following code. It keeps getting a 401 error which apparently means failed authorization. The same userid/password info, however, works find with a curl request. So the problem does not seem to be with the userid/password but rather with how I am forming the AlamoFire request. func postToWatson () { print("post to watson called") let url: String = "https://gateway.watsonplatform.net/tone-analyzer/api/v3/tone?version