How to authenticate to call API from https://home.myopenhab.org?

Hello,

Want to read state from API: GET https://home.myopenhab.org/rest/items/item_id/state
Have tried:

Allowed basic authentication in API security.

  1. Added header: "Authorization: Basic Base64(username:password)
    Username and password are same which I use to log in to https://myopenhab.org
    Status: 401 Unauthorized

  2. Added header: "Authorization: Bearer token
    token was generated from user profile
    Status: 401 Unauthorized

After log in in browser to https://myopenhab.org this “Get” API request works fine in browser.

How Authentication should be done?

Thanks.

This item api no need to use bearer token. basic authorization is ok.
The following curl is working for me.

curl -v -s -o -X GET \
  'https://home.myopenhab.org/rest/items/item_name/state' \
  -H 'accept: application/json, text/plain' \
  -H "Authorization: Basic aaaaaaaaaaaaaaaaaaa==" 

If the output is 401 Unauthorized, you may check value of base64(username:password).
I have try to modify my basic value to wrong one, it will output 401.