in this case are you use curl to call the API? According your example...
Call the Personality Insights by providing the username
and password
that are provided in the service credentials for the service instance that you want to use. The API uses HTTP
basic authentication.
For authentication:
curl -u "{username}":"{password}"
"https://gateway.watsonplatform.net/personality-insights/api/v3/{method}"
Bluemix collects data from all requests and uses the data to improve the Watson services.
Request logging:
curl -u "{username}":"{password}"
--header "X-Watson-Learning-Opt-Out: true"
"https://gateway.watsonplatform.net/personality-insights/api/v3/{method}"
Methods to call and get the response:
curl -X POST -u "{username}:{password}"
--header "Content-Type: application/json"
--data-binary @profile.json
"https://gateway.watsonplatform.net/personality-insights/api/v3/profile?version=2016-10-20&consumption_preferences=true&raw_scores=true"
IBM Watson API's uses standard HTTP response codes to indicate whether a method completed successfully.
200-level response always indicates success.
400-level response indicates some sort of failure.
500-level response typically indicates an internal system error.
Check this documentation from IBM to develop, has all examples how to call and if have errors the reason for that. And this for verify how to work and how to use.
Demo here, you can fork from github if you want.