Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
bob57
Helper IV
Helper IV

Getting Data From Toggle Time Tracker and Pagination

Hello,

I've been tasked with getting all time entries from Toggle into Power Bi. Problem: Only 50 records are returned. Does anyone have experience with this and know how to retrieve all records? Or is there another preferred method? Below is the query and a link to the API documentation.

Thank you,

Bob

 

API Doc: https://developers.track.toggl.com/docs/

 

let
baseUrl = "https://api.track.toggl.com/",
// the token part can vary depending on the requisites of the API
accessToken = "Basic Mzg2MzQ1NGFlZGU3Nzg3YWE5MzE0ZjU0ZGU4NmRkNjk6YXBpX3Rva2Vu",
postData = Json.FromValue([start_date = #date(2023,1,1)]),
options = [
Headers = [Authorization = accessToken, #"Content-Type" =
"application/json;"], RelativePath ="reports/api/v3/workspace/{workspace_id}/search/time_entries",
Content = postData
],
Source = Web.Contents(baseUrl, options),
// since Web.Contents() doesn't parse the binaries it fetches, you must use another
// function to see if the data was retreived, based on the datatype of the data
parsedData = Json.Document(Source)
in
parsedData

 

2 REPLIES 2
ppm1
Solution Sage
Solution Sage

Looking at the Project page of that site shows at least that API method supports pagination.

 

ppm1_0-1682166068553.png

 

Perhaps the Workspaces one does too. You can either try it with pagination and List.Generate, or create a list of ids to be used as a start id for the next 50 records, as described in this video.

Power BI - Tales From The Front - REST APIs - YouTube

 

Pat

 

Microsoft Employee

Thank you for taking the time to respond. What I learned:

1) /pagination is not supported with Workspaces.

2) The video was very informative and I learned from viewing it, but I haven't found a way for the total number of records to be returned, so I'm not sure that creating a list of ids in a multiple of 50 would offer benefit.

Again, thank you for your time. My search continues.

Bob

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors