The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I've reinstalled Python 3.96/windows and can't seem to have any luck running this script. I just get the "Please wait while we establish a connection to python" spinning window that never changes. Any ideas?
P.S. Yes, I did put in the correct authorization info in the headers 🙂
import requests
import json
def get_all_time_entries():
url_address = "https://api.harvestapp.com/v2/time_entries"
headers = {
"Authorization": "Bearer " + "xxxxxxxxxx",
"Harvest-Account-ID": "xxxxxx"
}
# find out total number of pages
r = requests.get(url=url_address, headers=headers).json()
total_pages = int(r['total_pages'])
# results will be appended to this list
all_time_entries = []
# loop through all pages and return JSON object
for page in range(1, total_pages):
url = "https://api.harvestapp.com/v2/time_entries?page="+str(page)
response = requests.get(url=url, headers=headers).json()
all_time_entries.append(response)
page += 1
# prettify JSON
data = json.dumps(all_time_entries, sort_keys=True, indent=4)
return data
print(get_all_time_entries())
No resolution... ultimately I ran on another machine to test and still had query issues even after making sure all additional packages were in.
Hi @fooddata15
Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your problem.
Best Regards,
Rico Zhou
Hi @fooddata15
Currently you have installed Python 3.96/windows , when you connect to data source by python, it alway show loading.
1. Please check your network setting, the fire wall and check .Net in your PC.
2. Please download the latest version of Power BI Desktop and try again.
Link: Download Microsoft Power BI Desktop from Official Microsoft Download Center
3. According to your code, I think you may want to get data by Rest API. You can try to connect to Rest API by Web connector.
For Reference: Using a REST API as a data source
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
100 | |
94 | |
80 | |
63 | |
56 |
User | Count |
---|---|
248 | |
122 | |
110 | |
77 | |
70 |