Trying to fetch orderhistory from My Api Key/client Accesstoken So i need help What i am doing Wrong

  • rakeshr
    Have you got the required permission for making a console tradebook call? If yes, then what's the error stack trace?
  • dev33
    dev33 edited April 2023
    {
    "status": "error",
    "message": "unknown Authorization scheme",
    "data": null,
    "error_type": "InputException"
    }

    yes have the permission
  • rakeshr
    @dev33
    Can you DM the API key, being used for this product?
  • tahseen
    tahseen edited April 2023
    @dev33 this is Basic Auth
    Is it not supposed to be base64 encoded ?

    FYI @rakeshr
  • tahseen
    -H "Authorization: Basic BASE64_ENCODED_VALUE"

    You cannot use raw value like My_api_key:User_access_token
  • dev33
    @tahseen i did try with Base64 Encoded value same error
  • tahseen
    What the format as mentioned above ? @dev33

    -H "Authorization: Basic BASE64_ENCODED_VALUE"
  • tahseen
    I tried like this and it worked for me

    curl "https://api.kite.trade/portfolio/holdings" \
    -H "X-Kite-Version: 3" \
    -H "Authorization: Basic BASE64_OF(API_KEY:ACCESS_TOKEN)"

    Please don't forget to have exactly same format
    "Authorization: Basic " and then after that "BASE64 Encoded String"

    You can use https://www.base64encode.org/ website for for base 64 conversion of your
    API_KEY:ACCESS_TOKEN
    I have tested it and it is working
  • dev33
    @tahseen thanks it worked i was not adding Basic before Encoded String
This discussion has been closed.