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

前端 未结 1 1485
庸人自扰
庸人自扰 2020-12-21 11:18

For Active Collab team watching this tag.

I am working on a project that uses new Active Collab 5 API, I am having performance issue trying to run reports.

E

相关标签:
1条回答
  • 2020-12-21 11:53

    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).

    0 讨论(0)
提交回复
热议问题