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. api3: create user error 500

api3: create user error 500

Added by Thomas Waas over 5 years ago

Hi all,
I'm new to OpenProject, doing first steps with the api.
Would like to create users through api calls, but fail and can't find examples / solutions anywhere in the web...

Got an API key, authentication works, I can get a list of existing users by GET'ing /api/v3/users, nice json list, all good.
Now I'm trying to create a user.
I'm POST'ing to /api/v3/users, but get a result code 500 and a content saying

'_content' => '{"_type":"Error","errorIdentifier":"urn:openproject-org:api:v3:errors:InternalServerError","message":"An internal error has occured. 405 Not Allowed"}'

My request is:

  DB<4> x $request
0  HTTP::Request=HASH(0x7fbba0c6b680)
   '_content' => '{ "login": "h.wurst", "email": "h.wurst@openproject.com", "firstName": "Hans", "lastName": "Wurst", "admin": true, "language": "en"}'
   '_headers' => HTTP::Headers=HASH(0x7fbba0c6b6f8)
      '::std_case' => HASH(0x7fbba0c6bfe0)
         'if-ssl-cert-subject' => 'If-SSL-Cert-Subject'
      'authorization' => 'Basic xxxxx'
      'content-length' => 132
      'content-type' => 'application/json'
      'user-agent' => 'libwww-perl/6.05'
   '_method' => 'PUT'
   '_uri' => URI::https=SCALAR(0x7fbb9ffc1f30)
      -> 'https://openproject.wawawis.com:447/api/v3/users'
   '_uri_canonical' => URI::https=SCALAR(0x7fbb9ffc1f30)
      -> REUSED_ADDRESS

, a copy & paste from the API documentation (after stripping \n\c characters).
No matter what I try, same result. I'm stuck.

If somebody please could enlighten me, I'm running out of ideas....

Thanks,
Thomas.


Replies (1)

RE: api3: create user error 500 - Added by Thomas Waas over 5 years ago

Stupid me.
PUT != POST
That's all what was wrong.
Just use the right request. Oh my.

Sorry for the noise,
Thomas.

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