Reputation: 35
When I launch the Watson Question and Answer service in IBM Bluemix it comes with a set of credentials that include a User ID, Password and URL defined in the Q&A VCAP file.
I assume that that is the URL I should use when connecting to the Watson Q/A REST API and no other?
I also assume that the REST API for the Watson Q&A API that is documented on this link: https://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/apis/#!/question-and-answer and that includes four REST API endpoints:
GET V1/ping,
GET V1/services,
POST /v1/question/{dataset} and
PUT /v1/feedback,
refers to the Q&A Service in Bluemix that I have just instantiated?
I should now be able to use Basic Authentication with 'username:password' and connect to the endpoints, where 'userid' and 'password', seperated by a colon, are the values contained in the VCAP file in Bluemix that I referred to, correct?
Finally, are there complete sample cURL scripts that access the GET V1/ping and the other three end-points of the Q&A Service?
Upvotes: 0
Views: 719
Reputation: 303
The Watson Q and A Service has been discontinued:
https://developer.ibm.com/watson/blog/2015/11/11/watson-question-and-answer-service-to-be-withdrawn/
with all service ending December 16, 2015.
Upvotes: 0
Reputation: 1190
You are correct in all your assumptions:
question_and_answer.credentials
object is the API endpoint for the Q&A REST API.question_and_answer.credentials.username
and question_and_answer.credentials.password
contained in VCAP_SERVICES are meant to be used for Basic AuthI do not know of a place where you can find comprehensive cURL scripts for all the API operations, but here is an example for the Q&A service question operation:
curl -X POST \
-u username:password \
-d "{\"question\": {\"evidenceRequest\": {\"items\": 1}, \"questionText\": \"How often should I wash my hands?\"}}"
https://gateway.watsonplatform.net/question-and-answer-beta/api/v1/question/healthcare/
This cURL requests asks Watson "How often should I wash my hands?" and only requests the answer with the most confidence.
Upvotes: 1