Content
Create a project with API
Added by Adrien BALTARDIVE almost 2 years ago
Hi everyone,
This is my first post on your forum.
I have been testing OpenProject API v3. I can create a new workpackage, all good.
However, I wish to create a new project using API, I can’t see it in the documentation so far.
Is it possible? If not, an alternative would be to use command line via ssh ?
Thanks.
Adrien.
Replies (7)
RE: Create a project with API
-
Added by Oliver Günther almost 2 years ago
Hi Adrien,
it is not yet possible to create projects through the API.
You should easily be able to create one through the commandline, though. Use the following command as a starter point (packaged installation)
openproject run bundle exec rails runner “Project.create(identifier: ‘my-new-myproject’, name: ‘My new project’);”
Best,
Oliver
RE: Create a project with API
-
Added by Adrien BALTARDIVE almost 2 years ago
Thanks Oliver, I’ll try that.
RE: Create a project with API
-
Added by Niels Lindenthal almost 2 years ago
There is also a feature request for this in the wish list:
Epic #18809 new: CRUD operations for projects in API v3
RE: RE: Create a project with API
-
Added by sifudam . 8 months ago
if any progress was made regarding the creation of project through api ? or is there any other way to “trigger” project creation except by web browser ?
RE: Create a project with API
-
Added by Harald Holzmann 5 months ago
Is it also possible to assign a user to a project via command line?
RE: Create a project with API
-
Added by Harald Holzmann 5 months ago
I found out, it's working with:
openproject run bundle exec rails runner "Member.create(project_id: 111, role_ids: [9], user_id: 46);"
RE: Create a project with API
-
Added by Ehsan Aleem Avee 2 months ago
Hi Everyone,
I would really appreciate, if you could also let me know whether I can generate api access token for users except by web browser? Is there any way to do that via api call or bash script? Basically I would like to create an user by api call using admin user and then generate the access token for newly created user.