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

Updated by Jay Kay about 11 years ago

Hi, I’m trying to add a Work Package via JSON using API v2.

Once the Work Package is created (successfully), the query is redirected (via HTTP 303) to the newly created Work Package.

However, the redirection is to the XML format, rather then the JSON format of the GET request. Below is the log output:

Started POST "/api/v2/projects/test-project/planning_elements.json?key=6a5031cb58e26847472af3021fe5ab5a2e71a216" for 192.168.1.1 at 2014-04-07 16:30:20 +0200
Processing by Api::V2::PlanningElementsController#create as JSON
Parameters: {"planning_element"=>{"description"=>"", "status_id"=>1, "priority_id"=>2, "child_ids"=>nil, "assigned_to_id"=>nil, "responsible_id"=>nil, "fixed_version_id"=>nil, "subject"=>"Test Dysfonctionnement 4", "type_id"=>2, "parent_id"=>nil, "estimated_hours"=>nil, "author_id"=>6, "project_id"=>70}, "key"=>"6a5031cb58e26847472af3021fe5ab5a2e71a216", "project_id"=>"test-project"}
WARNING: Can't verify CSRF token authenticity
OpenProject User: OpenProject Admin (admin ID: 1 <enviesudest@envie.org>)
Redirected to http://envielyon.org:8080/api/v2/projects/test-project/planning_elements/82.xml
Completed 303 See Other in 48.7ms (ActiveRecord: 11.7ms)
Started GET "/api/v2/projects/test-project/planning_elements/82.xml" for 192.168.1.1 at 2014-04-07 16:30:20 +0200
Processing by Api::V2::PlanningElementsController#show as XML
Parameters: {"project_id"=>"test-project", "id"=>"82", "planning_element"=>{}}
Filter chain halted as :check_if_login_required rendered or redirected
Completed 401 Unauthorized in 2.7ms (ActiveRecord: 0.6ms)

Back

Loading...