Report API | Community
Skip to main content
February 13, 2019
Question

Report API

  • February 13, 2019
  • 21 replies
  • 3959 views
Does anyone use the Report API with success? We are trying to get get hours per time card grouped by a custom field on the company object. It seems like the Report API doesnt allow for "Group By" or "Filtering" beyond 1 level. EX /attask/api/v10.0/proj/report?apiKey=YOURKEY&hours:hours_AggFunc=sum&hours:timesheet:endDate=2019-02-09&company:name_2_GroupBy=true&owner:name_1_GroupBy=true Error: { "error": { "class": "com.attask.common.InvalidParameterException", "message": "Invalid Parameter: Search Parameter value \"hours:timesheet:endDate\"", "title": null, "msgKey": "exception.invalidparameter", "attributes": [ "Search Parameter", "hours:timesheet:endDate" ], "code": 1000 } } /attask/api/v10.0/proj/report?apiKey=YOURKEY&hours:hours_AggFunc=sum&hours:project:company:DE:Account Code_2_GroupBy=C&owner:name_1_GroupBy=true The Group By doesnt error, it just returns back an empty node. "Person 1": { "": { "dcount_ID": 32, "sum_hours_hours": 206.75, "owner_name": "Person 1" } }, "Person 2": { "": { "dcount_ID": 7, "sum_hours_hours": 23.68, "owner_name": "Person 2" } } Brad Baker
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

21 replies

BradBaAuthor
February 19, 2019
No one uses the Report API I take it? Brad Baker MMC - General
February 19, 2019
Hi, yes I do use the GET API to pull a JSON response. You wont be able to use groups or filters as easily as drawing down the data and manipulating it yourself. you should be using: " https://mrc.my.workfront.com/attask/api/v10.0/issue/search?" then your filters, custom fields, projectID's etc. Then any of the items in the API Basics/ Explorer: API Basics: View this on Workfront > API Explorer: View this on Workfront > Nick Patel MRC Global
BradBaAuthor
February 19, 2019
Doesnt that mean you dont use the ReportAPI? You told me to use the search api to filter, and then do everything myself via more code. My understanding is the ReportAPI is suppose to handle this all for you so you dont need to issue 1000 API calls to get hours for 1000 users just to sum them. Brad Baker MMC - General
February 19, 2019
Brad, There is not an API string for only reporting. there is just the REST API that Workfront has available. You can use excel or Power Bi to draw te data down into a table after you get the string in the correct format. You can use filters and groups, but they are a bit different than the regular camel case syntax in the system itself. Try using an Application called Postman. It will give you more detail on why certain items are not working in your API string. Nick Patel MRC Global
BradBaAuthor
February 19, 2019
Please review the API documentation. I know I can do all that extra work to get the data I want. But the API says I can call a REPORT API TO GET AGGREGATE DATA which is what I want to do. But if you see my example above there is an error. Yet no one seems to be able to explain why, or point me to true documentation other than this 1 blurb. Requesting a Report You can perform a report request, where only the aggregate of some field is desired with one or more groupings. As shown in the following example, the report syntax is the same as the syntax for the SOAP API: GET /attask/api/v9.0/hour/report?project:name_1_GroupBy=true&hours_AggFunc=sum Brad Baker MMC - General
February 19, 2019
I get a response with aggregated data and no errors with that string that you provided. https://mrc.my.workfront.com/attask/api/v9.0/hour/report?project:name_1_GroupBy=true&hours_AggFunc=sum&apiKey=KEY Nick Patel MRC Global
February 19, 2019
what is the entire string you are wanting to use? Nick Patel MRC Global
BradBaAuthor
February 19, 2019
It all in my first post if you took the time to read it. Brad Baker MMC - General
February 19, 2019
Also is "company" a custom field? Nick Patel MRC Global
BradBaAuthor
February 19, 2019
You can call with just this and see the exact error: /attask/api/v10.0/proj/report?apiKey=YOURKEY&hours:hours_AggFunc=sum&hours:timesheet:endDate=2019-02-09 Brad Baker MMC - General