url=f'https://api.box.com/2.0/files/{file.file_id}?fields=representations'
headers = {
"x-rep-hints" : "[extracted_text]",
"Authorization": f'Bearer {user.box_access_token}'
}
ext_text = requests.get(url,headers)
print(ext_text.status_code)
url_template = str(ext_text["representations"]["entries"][0]["content"]["url_template"])
url = url_template.replace("{+asset_path}", "")
resp = requests.get(url, headers={"Authorization": f"Bearer {user.box_access_token}"})
resp.raise_for_status()
print( resp.content)
The same call made through postman return success.