Double check your .env file.
IBM Cloud is migrating to token-based Identity and Access Management (IAM) authentication.
With some service instances, you authenticate to the API by using IAM. You can pass either a bearer token in an Authorization header or an API key. Tokens support authenticated requests without embedding service credentials in every call. API keys use basic authentication. Learn more about IAM.
If you pass in an API key, use apikey for the username and the value of the API key as the password.
In other instances, you authenticate by providing the username and password for the service instance. For more information, see Service credentials for Watson services.
To find out which authentication to use, view the service credentials by clicking the service instance on the Dashboard.
Source : apidocs/personality-insights
So in your .env
file the service credentials could either be
# service credentials
PERSONALITY_INSIGHTS_USERNAME= <YOUR USERNAME>
PERSONALITY_INSIGHTS_PASSWORD= <YOUR PASSWORD>
PERSONALITY_INSIGHTS_URL=<SERVICE URL>
Or
# service credentials
PERSONALITY_INSIGHTS_IAM_APIKEY= <YOUR API KEY>
PERSONALITY_INSIGHTS_URL= <SERVICE URL>