Import project rest api <errors type="array"><error>
Added by loso fly about 9 years ago
Hi J Y,
I'm facing a problem using the redmine rest api.
My goal is to add a lot of projects into redmine with multiple xml files.
I run this command to add a test project : curl -v -H "X-Redmine-Api-Key: [myapikey]" -X POST -d 'projects.xml' http://localhost/projects.xml
My xml file :
<project>
<name>TESTPROJECT</name>
<identifier>TESTCREATIONPROJECT</identifier>
<description>thisisatest</description>
</project>
And logs :
Started POST "/projects.xml" for 127.0.0.1 at 2015-10-01 16:17:10 +0200
Processing by ProjectsController#create as XML
Parameters: {"projects.xml"=>nil}
Current user: admin (id=1)
Rendered common/error_messages.api.rsb (0.8ms)
Expire fragment views/localhost:3000/robots.txt (0.2ms)
Completed 422 Unprocessable Entity in 288ms (Views: 6.3ms | ActiveRecord: 43.5ms)
Error message return :
<errors type="array"><error>Nom doit être renseigné(e)</error><error>Identifiant doit être renseigné(e)</error><error>Identifiant est trop court (au moins 1 caractères)</error></errors> Closing connection #0*
I don't understand the error message because all required fields are filled.
This is my environment:
Redmine version 3.0.0.devel
Ruby version 2.2.0-p0 (2014-12-25) [x86_64-linux]
Rails version 4.2.0
Environment production
Database adapter PostgreSQL
I hope someone can help me to solve my problem.
Thanks, kind regards.