API with PHP not working?
Added by FLX _ almost 14 years ago
Hello,
I'm using Redmine 1.0.3.devel.4362 and I'm trying to get the REST API working with the PHP example from: http://www.redmine.org/wiki/1/Rest_api_with_php
I got REST enabled in the acp but when trying to create an issue it doesn't insert.
Code used:
require_once ('ActiveResource.php');
class Issue extends ActiveResource {
var $site = 'http://myuser:mypassword@myhost.com';
var $request_format = 'xml'; // REQUIRED!
}
$issue = new Issue (array ('subject' => 'Issue via XML and REST API', 'project_id' => '3'));
$issue->save ();
?>
Also, how can I make it use the REST API key instead of basic authentication?
Many thanks,
Dennis
Replies (2)
RE: API with PHP not working?
-
Added by Javier Hernandez almost 14 years ago
Hi Dennis!
I'm thinking you aren't passing the minimal and required fields for a succesfully issue creation.
When you're going to create an issue from Redmine's web interface, you need to fill some additional fields than subject and project, so, try to adding tracker_id, i think this will be enough!
Regards!
RE: API with PHP not working?
-
Added by FLX _ over 13 years ago
Hi Javier,
Sorry for the late reply; I've been on my holiday for a while. I tried the following but it still doesn't work.
$issue = new Issue (array ('subject' => 'Issue via XML and REST API1', 'project_id' => '3', 'tracker_id' => '1'));
Does it work for you?
Thanks,
Dennis