The CreatorCon Call for Content is officially open! Get started here.

REST HTTP Code 400

malaisamyj
Tera Contributor

Hi All,

I am trying to integrate IBM Watson Conversation to service now chat. Basically i am trying to create Chatbot..

For that i have followed Service now Whitepaper. But i am facing problem with REST Message.

I have created a POST method to get response from IBM Watson. As per the Whitepaper document.

When i tested its giving me error as 400 and as below

find_real_file.png

And My workspace details as below

find_real_file.png

My post Method

find_real_file.png

Help would be appreciated..

Thanks,

Malai

5 REPLIES 5

vitaly_sukharev
Kilo Guru

Hi Malaisamy,



Most likely there is an error in your json payload:


{


"input":{




"text":"Radio"


},


"context":Hi <-- here Hi should be put into quotes


}


400 is a credentials issue i believe.   So it's probably an issue with the account details you have in SN that are leading upto he Wason interface.  



Have you tried it in Postman, I always try new connections there to ensure the creds are working correctly


Dave,



Error 400 is "Bad Request", according to http specs, not credentials issue.


First screenshot gives the response from Watson: {"error":"Unexpected token H in JSON..."}, so not valid JSON is to blame.



HTTP Request (screenshot 3) has to be modified to fix this: "context":"${context}" instead of "context":${context}


dave_edgar
Mega Guru

i believe its a bad request as it's not finding the oauth token that I'd expect the Watson interface to be looking for.



just to prove that a 400 series error could be related to creds I just changed the authentication on our of my POST calls so it would fail and this is what i got:



comun1.JPG