Watson Discovery

 View Only
Expand all | Collapse all

CP4D Discovery instance API authentication with Bearer token - alternatives?

  • 1.  CP4D Discovery instance API authentication with Bearer token - alternatives?

    Posted Tue April 25, 2023 05:04 PM

    I am having trouble when using the Bearer token when authenticating for a CP4D Watson Discovery API. I used the latest Bearer token from the instance access information and supplied the authentication header, but I get this result back:

    {
        "errors": [
            {
                "code": "unauthenticated",
                "message": "You are no longer authenticated. Please log in again."
            }
        ],
        "status_code": 401
    }


    I used to use API keys to access the APIs of the Watson Discovery deployed on IBM Cloud, and did not have a problem like that.

    I was wondering if there were alternatives to using the Bearer token - especially since they refresh every few hours - and use some similar methods as the API key for the IBM Cloud instance.

    Thank you in advance.



    ------------------------------
    Yun Ho Jung
    ------------------------------


  • 2.  RE: CP4D Discovery instance API authentication with Bearer token - alternatives?

    Posted Wed April 26, 2023 06:00 PM

    I was able to resolve the issue - I was able to use the bearer token, and I generated the token beforehand in the application.



    ------------------------------
    Yun Ho Jung
    ------------------------------