Please, I am trying to the BM Watson conversation API using WSO2 ESB, but the problem is that I didn't find how to add the credentials in my configuration. I tried with a header and a property by nothing works I still have a Not Authorized message.
Here's the request I am trying to implement and don't know where to put the username and password:
curl -X POST -u "{username}":"{password}" —-header "Content-Type:application/json" --data "{\"input\": {\"text\": \"Turn on the lights\"}, \"context\": {\"conversation_id\": \"1b7b67c0-90ed-45dc-8508-9488bc483d5b\", \"system\": {"dialog_stack":[{"dialog_node":"root"}], \"dialog_turn_counter\": 1, \"dialog_request_counter\": 1}}}" "https://gateway.watsonplatform.net/conversation/api/v1/workspaces/25dfa8a0-0263-471b-8980-317e68c30488/message?version=2017-02-03"
Thank you
I had to add to my synapse-config :
<property expression="fn:concat('Basic ', base64Encode('username:password'))" name="Authorization" scope="transport" type="STRING" xmlns:ns="http://org.apache.synapse/xsd"/>
<log level="custom">
and it worked perfectly