添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Your browser is outdated and unsupported. You may run into errors and degraded experience on this page. Please update your browser.
  • 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

      Hello,

      Firstly apologies about the noob question but I am a little confused. I am just trying to build up some basic querying via the API (v3), just pulling out information for now, however i am not getting very far.

      If for example i visit the following url in my browser, i am presented with the JSON output as expected.

      http://my_url/api/v3/work_packages/120

      However, if i try to do a basic web request from powershell, python or curl I am presented with a ‘NotFound’ error.

      Powershell:
      Invoke-WebRequest -Uri "http://my_url/api/v3/work_packages/120"

      Python:
      import urllib2 content = urllib2.urlopen("http://my_url/api/v3/work_packages/120") print (content.read())

      Curl:
      curl http://my_url/api/v3/work_packages/120

      The error i get each time is..
      {"_type":"Error","errorIdentifier":"urn:openproject-org:api:v3:errors:NotFound","message":"The requested resource could not be found.","_embedded":{}}

      I have kept the requests as simple as possible to reduce any margin for error. One point to take into account which makes this even more frustrating is that executing the following URL with any of the methods above works fine.

      http://my_url/api/v3/users/4

      Any help would be much appreciated.

      Many thanks in advance

      Mesmeric

      As far as I know, you need to include the api key in the request.

      This one works for me:

      curl -X GET -u apikey:5b....85 http://host/api/v3/work_packages/1

      The api-key is in Administration -> System Settings -> Repositories

      I try this
      curl -X GET -u apikey:5b....85 http://host/api/v3/work_packages/1
      command in terminal and hand this answer
      <title>301 Moved Permanently</title>

      301 Moved Permanently


      nginx/1.9.6 Where i mistake?

      Dear all,

      I try to make a first API request but it does not work.

      I simply use the following command:

      curl -X GET -u apikey:XXX http://host/api/v3/work_packages/1

      What I don't understand is that openproject gives me a Client ID and a Client secret but only an apikey is used on the example above.

      Anyone can help me  ?

      I use openproject v10.4.1

      Thanks

      Xavier

      I found my problem.

      I was using Auth2 api keys whereas it works with the user account api key.

      Thanks

  •