Market data feed authorize - Receiving error response without any details

import requests
from dashboard.settings import UPSTOX

url = "https://api.upstox.com/v2/feed/market-data-feed/authorize"

payload = {}
headers = {
    "Accept": "application/json",
    "Api-Version": "2.0",
    "Authorization": UPSTOX["ACCESS_TOKEN"],
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

Response

{"status":"error","errors":[]}

Any idea why I am receiving empty response without any details, am I missing something?

@smt smt,

Thank you for reaching out to us.

Have you had a chance to run this API through Postman? If you haven’t, I would recommend giving it a try as it could help us identify the specific problem more effectively.

Could you please share the outcome with us? If you encounter any failures while making the call in Postman, it would be helpful if you could also provide the cURL command so that we can further investigate the issue.

Thank you!

Hi @shanmu , thanks for you reply, here is the CURL request, I checked in postman, I see its giving 401 unauthorized response, however the access token works for other API. I also tested by generating new access token still gives 401 unauthorized response.

curl  -X GET \
  'https://api.upstox.com/v2/feed/market-data-feed/authorize' \
  --header 'Accept: application/json' \
  --header 'Authorization: xxx' \
  --header 'Api-Version: 2.0'

It seems like the Bearer might be missing in the Authorization field value of your request. Try including it and see if it works:

curl --location 'https://api.upstox.com/v2/feed/market-data-feed/authorize' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token_here}' \
--header 'Api-Version: 2.0'

Thank you for the help, its working after adding Bearer.