3

I am trying to integrate watson from salesforce (Http Callout) and received 404 error. Then I tried the sameusing Postman tool but getting the same result

Added conversation credentials in request header

Request Endpoint

https://gateway.watsonplatform.net/conversation/api/v1/workspaces/883c7704-02c4-41fc-b8a0-aea1d0325c5a/message?version=2016-09-20

Request Body

{
  "application/json": {
    "input": {
      "text": "Hi"
    },       
    "alternate_intents": true
  }
}

Response Body

{
  "error": "Resource not found"
}

Status 404 Not found

Please let me know what is the issue here. I am not sure whether the way I added version and workspace id in the endpoint went wrong

Ram
  • 33
  • 1
  • 5

2 Answers2

2

I had the same issue and I found that it's simply rate limiting that kicks in.

According to the docs here there is no limit for the endpoint, however that turns out to be untrue. If you send a few thousand messages in quick succession, you'll start getting 404 Not Found until the quota resets, which seems to take around 1 hour.

1

The request body doesn't seem right. It should be JSON with e.g. this structure (see api ref. page in watson conversation service doc.):

{
  "input": {
    "text": "Hi"
  }
}

application/json should be the content type. Sample request with curl:

curl -X POST -u "{username}":"{password}" -H "Content-Type:application/json" --data "{\"input\": {\"text\": \"Hi\"}}" "https://gateway.watsonplatform.net/conversation/api/v1/workspaces/<workspace_id>/message?version=2017-02-10"

See the API Reference for more details: https://www.ibm.com/watson/developercloud/conversation/api/v1/

anjosh
  • 3
  • 1
Michal Bida
  • 1,316
  • 9
  • 24
  • I tried this input but the error is same. I believe something wrong with my endpoint or parameters – Ram Feb 15 '17 at 10:03
  • Also, you can try to use conversation-simple app sample available on git hub, link in the doc. – Michal Bida Feb 15 '17 at 10:30