Content
Create a project with API
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.
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
Thanks Oliver, I’ll try that.
There is also a feature request for this in the wish list:
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 ?
Is it also possible to assign a user to a project via command line?
I found out, it's working with:
openproject run bundle exec rails runner "Member.create(project_id: 111, role_ids: [9], user_id: 46);"
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.
Using this does creates a project with limited modules. Is there a way to add modules via API?
Im sorry for the question, im new to OPenProject APIs.
Oliver Günther wrote:
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