Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

General discussion
  1. OpenProject
  2. Forums
  3. General discussion
  4. How to get cost reports (API)

How to get cost reports (API)

Added by masayuki ogawa over 1 year ago

I want to get a breakdown of the work hours registered in work_packages.

For example, for work_package with id 24235, I received the following json from endpoint /api/v3/work_packages/24235

curl -X 'GET' \
  'https://{MY_HOST_URL}/api/v3/work_packages/24235' \
  -H 'accept: application/hal+json' \
  -H 'X-Requested-With: XMLHttpRequest'
{
  ... snip ...
  "spentTime": "PT7H45M",
  ... snip ...
  "_links": {
    ... snip ...
    "showCosts": {
      "href": "/projects/13/cost_reports?fields%5B%5D=WorkPackageId&operators%5BWorkPackageId%5D=%3D&set_filter=1&values%5BWorkPackageId%5D=24235",
      "type": "text/html",
      "title": "Show cost entries"
    },
    ... snip ...
}

Is the showCosts href valid in this case? When I try to access it, I get a 404 not found. Why is this? Can I get a breakdown of the work hours ?


Replies (1)

RE: How to get cost reports (API) - Added by masayuki ogawa over 1 year ago

Supplement: I would like to use the API to do the following

https://www.openproject.org/docs/user-guide/time-and-costs/reporting/#time-and-costs-reports

  • (1 - 1/1)
Loading...