API giving 403

phraniiac
This API is giving error 403 - https://api.kite.trade/mf/instruments

With same headers (access_token and app_id), I am getting a proper response with https://api.kite.trade/mf/orders.
  • Yashbh
    I am also getting an error during api calls. PLs check request id A37AED6A2B64BEB1,8E483CFFED224CAA

    The message returned is : Unsupported Authorization Type

    My api accounts are active. Please check and revert as my programs are not running. Thanks.
  • sujith
    Is this still happening?
  • sujith
    Can you paste the complete stack trace here?
  • phraniiac
    I am directly using postman for hitting the API.

    This is the response I am getting. (I am intentionally changing the html tags as the editor renders it to a html page.

    """
    html/>

    head>
    title 403 Forbidden /title
    /head

    body
    center
    h1>403 Forbidden
    center>cloudflare</center
    /body

    /html
    """
  • sujith
    You need to run pykiteconnect in debug mode and paste the logs. We can't help you with the partial data.
  • phraniiac
    phraniiac edited April 9
    DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.kite.trade:443
    DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "GET /mf/instruments HTTP/1.1" 403 None
    DEBUG:kiteconnect.connect:Response: 403 b'\r\n403 Forbidden\r\n\r\n

    403 Forbidden

    \r\n
    cloudflare
    \r\n\r\n\r\n'
    Traceback (most recent call last):
    File "api/app/test/test_kite.py", line 19, in
    kite.mf_instruments()
    File "/Users/p/venvs/s-3.7/lib/python3.7/site-packages/kiteconnect/connect.py", line 536, in mf_instruments
    return self._parse_mf_instruments(self._get("mf.instruments"))
    File "/Users/p/venvs/s-3.7/lib/python3.7/site-packages/kiteconnect/connect.py", line 817, in _get
    return self._request(route, "GET", params)
    File "/Users/p/venvs/s-3.7/lib/python3.7/site-packages/kiteconnect/connect.py", line 894, in _request
    content=r.content))
    kiteconnect.exceptions.DataException: Unknown Content-Type (text/html) with response: (b'\r\n403 Forbidden\r\n\r\n

    403 Forbidden

    \r\n
    cloudflare
    \r\n\r\n\r\n')
  • phraniiac
    @sujith Can you please look into this?
  • sujith
    We will check with the concerned team and get back to you.
  • phraniiac
    @sujith Any updates?
  • sujith
    This should be fixed now.
Sign In or Register to comment.