"Fetch only the data you need"

Post Title: On your website under Engineering/Getting Started/Overview/General principles it says “fetch only the data you need”.

Your Question/Topic: But for me that also means that I can select the fields that I want to see. I tried that, but it didn’t work (Header Accept). So my question is: does your REST service offer the option of influencing the number of fields returned?

Many Thanks!

@Thomas_Wagner sorry for the late reply!

You can use parameters in your API calls that “filter” and select the data you want to see in a way. Can you share the requests you made (omitting any sensitive data, of course)?

Hi Veljko,

Thanks for your answer.

https://api.track.toggl.com/api/v9/me/time_entries/current?filter=id,user_id,stop (GET /api/v9/me/time_entries/current?filter=id%2Cuser_id%2Cstop HTTP/1.1) does not seam to work.

I also tried “…?fields=id,user_id,stop” as Query Parameter.

Thanks in advance

Kind regards
Thomas

Hey @Thomas_Wagner! I understand your point. However, we put that in the docs just as a general guideline of good API usage, not meaning that you can select which fields can be returned in the API calls. It’s a good idea, though :wink: