REST HTTP Code 400
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2018 02:24 AM
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
And My workspace details as below
My post Method
Help would be appreciated..
Thanks,
Malai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2018 04:22 AM
Hi Malaisamy,
Most likely there is an error in your json payload:
{
"input":{
"text":"Radio"
},
"context":Hi <-- here Hi should be put into quotes
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2018 04:35 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2018 05:07 AM
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}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-07-2018 05:12 AM
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: