Cross-project time-record filtering using Active Collab 5 API

两盒软妹~` 提交于 2019-11-29 16:02:28

What you need here is not a request that goes through all projects one by one, but a request that it tailored for cross-project reporting. Active Collab 5 has just the right API endpoint for that - /reports/run.

As an example, you can use this command to query time records and expenses from all active projects that were tracked today:

curl -H "X-Angie-AuthApiToken: YOUR-API-TOKEN" "http://your.activecollab.com/api/v1/reports/run?type=TrackingFilter&project_filter=active&tracked_on_filter=today"

Notice the route (/reports/run) and query arguments:

  1. type - specify type of the report, in this case time and expense tracking report,
  2. project_filter - specify project filter. Apart from active, other useful values of this filter are completed (for completed projects), selected_1,2,3,4 (selected projects with a list of project ID-s), client_1,2,3,4 (projects for clients with the given ID-s), category_1,2,3,4 (projects in categories with the given ID-s),
  3. tracked_on_filter - filter by the date when records were tracked. To target a particular date use selected_date_YYYY-MM-DD and to target a date range use selected_range_YYYY-MM-DD:YYYY-MM-DD.
  4. tracked_by_filter - filter by who tracked the time. It can have various values, like anybody, logged_user, selected_1,2,3.

To list only time records, set type_filter to time (or to expenses if you want only expenses to be listed).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!