401 Unauthorised Error using Java program - works fine in Postman

We
have tired the WorldCheck One API through Postman (Postman Intercepter
enabled), and it responses properly. However,
our development team found the APIs give 401 Unauthorised Error in the
Java program, GET & POST APIs are both fail. We have provided HTTP request
Headers according to the API spec and Postman collection, we still could not
request WorldCheck One APIs through Java program. Also would it need any cookies assigned in the HTTP request?

Best Answer

  • Shweta Lal
    Shweta Lal LSEG
    Answer ✓

    For
    authorization following three things are key:

    -An invalid or expired API key – Sometimes keys get malformed
    when being auto sent by few tools

    -An invalid HMAC signature – you are taking correct fields to
    generate the same

    -Timing with the Date header

    Cookies are not
    required to be assigned in the HTTP request

Answers