Use dashboard API to get data in python dataframe
Summary: A participant opened a discussion about using the dashboard API to retrieve data into a Python dataframe. Several responses followed, but no detailed content or solutions were shared in the thread.
I have a widget which displays users with points and I want to fetch top 10 users from that widget.Also I need to select current month "01/2025" from the filter.Let me know how this can be done
But I'm getting weired error.Please help!
I'm an admin so I have a token from my profile section.
import requests
url = "server_url/api/v1/dashboards/4577fc4415dd7d003339bfdc/widgets/4577c7716dd7d554441bjae"
# authentication
headers = {
"Content-Type": "application/json",
"Authorization": "" }
# Send the request
response = requests.get(url, headers=headers)
response
# Check if the request was successful
data = response.json()
data
Error:
aditya
OP1 year agoHi DRay ,Yes it is resolved.
DRay
·1 year agoGood to hear! How did you get it done?
DRay
·1 year agoHi aditya. Were you able to get this resolved?
aditya
OP1 year agoAssafHanina ,
I also tried in the format which you shared but I'm getting same error "Unauthorised".
Thanks!
Assaf Hanina
·1 year agohey aditya ,
Thanks for letting me know.
DRay - Please arrange for internal technical resources to provide assistance in this case.
DRay
·1 year agoDone
Assaf Hanina
·1 year agoHey aditya ,
As mentioned by HamzaJ , it's seems that the Bearer is missing from the Authorization.
therefore, the error message is Unauthorized.
Please find an updated Sample script including the Bearer token
Best Regards
aditya
OP1 year agoDRay , I have intentionally not provided the token,it is usually Bearer 'token' format
Thanks!
DRay
·1 year agoHi aditya,
Thank you for reaching out. I edited your post to remove potentially sensitive information.
It looks like the authorization token is to short. Can you make sure that it is copied correctly and let us know how it goes?
Thank you.