Feature #296

REST API

Added by Alessio Spadaro over 7 years ago. Updated over 3 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

60%

Category:REST API
Target version:-
Resolution:

Description

The subject has been touched in a few other request (importing from trac, svn hooks). Having such an API will enable
any kind of integration/import/export, i wrote a few examples of possible uses, just for reference:
- scm integration (such as svn hooks)
- ide integration (e.g. Mylar www.eclipse.org/mylar, TortoiseSVN, etc..)
- office integration
- tools for import/export
- build system integration (maven, ant, cruisecontrol, continuum, ...)

Maybe is it too early (i.e. the model is too "volatile" for now)?

rest.diff Magnifier (6.09 KB) Markus Knittig, 2008-07-05 21:49

projects_json_format.diff Magnifier (2.4 KB) Eddie Ringle, 2010-02-20 05:03


Related issues

Related to Feature #568: Let end user customer report Issue Closed
Related to Feature #1214: REST API for Issues Closed 2008-05-08
Related to Patch #1901: RESTful URLs for everything Closed 2008-09-15
Related to Feature #2925: Url to fetch changesets for a repository Closed 2009-03-07
Related to Patch #4596: REST api fto get account info ? Closed 2010-01-16
Duplicated by Feature #725: Feature Request - Web Service Gateway Closed 2008-02-22
Duplicated by Feature #3317: API and iPhone app Closed 2009-05-07
Duplicated by Feature #4968: REST API new features Closed 2010-03-02
Duplicated by Feature #5213: Request for the REST API Closed 2010-03-30
Blocked by Feature #3920: REST API for authentication Closed 2009-09-25

Associated revisions

Revision 3313
Added by Jean-Philippe Lang almost 5 years ago

XML REST API for Projects (#296).

History

#1 Updated by Tim Parkinson about 7 years ago

Can I also vote for an API please. I think it would open up a whole world of possibility for an already cool product.
I'm certainly thinking query, create and update issues. For instance I have in mind something that would allow feature items to be created from an RSpec file.

#2 Updated by Alessio Spadaro over 7 years ago

I think that a minimum requirement should be to have an API that give full access at the issue level. This means access issues (CRUD), all the related models at least in read only mode (issues categories, etc..) and query support. This should be fine for attaching a single project from an external entity and a good starting point to build other features once the API starts being used.

In other post (the one on the svn hooks) we briefly talk about security concerns, but thinking again it could be delayed (i.e. handled by the sysadmin). The only thing to consider is the user/s the service/s will be bound to

I hope to have some time to think about the issue and give a more detailed answer.

Regards

#3 Updated by Jean-Philippe Lang over 7 years ago

No, i don't think it would be too early. Main model objects (projects, issues, ...) are stable enough. Even if they may be extended in the future.
Could you briefly specify what you expect from this API in terms of entry points ? (eg. fecth issues, create an issue, ...)

#4 Updated by Maximilian Karasz over 6 years ago

It's only one of the minor points of the original request so i'm afraid i might be slightly off topic, but i have successfully connected Eclipse Mylyn with redmine via the Generic Web Repository Connector.
Even though it provides just a very basic integration with eclipse/mylyn i thought maybe the configuration would interest a couple of people since there is, to my knowledge, no dedicated connector for redmine yet. please contact me if you're interested in the configuration, maybe a wiki howto would be a good idea...

#5 Updated by Mads Vestergaard over 6 years ago

Maximilian, this sounds interesting could you send me wome further details at mnv (at) coolsms.dk

Thanks in advance.

#6 Updated by Mark Gallop over 6 years ago

+! for me. A REST API would be a very useful feature.

#7 Updated by Martin Herr over 6 years ago

+1 Would like to build an Redmine-AIR-Client based on the REST API :)

#8 Updated by Doug Raney over 6 years ago

+1 for REST API. Would like to see a SOAP 1.2 compliant interface. See issue #725

#9 Updated by Christopher Hlubek over 6 years ago

+1 for REST API

What about JSON format for usage in AJAX / RIA applications? I think it wouldn't take much more effort to add a JSON output as an supplement to XML and it would integrate nicer and more efficient in JavaScript driven applications.

#10 Updated by John Z over 6 years ago

Seems like this issue has had a lot of feedback and there are a lot of votes for a REST API. Though I would normally also vote for REST, we've been relying on Mantis (http://www.mantisbt.org/) as our gateway issue management solution for years. Though Redmine wants to replace Mantis, we like it too much to use anything else for awhile. We have about 100 projects in Mantis now.

Our business process would be to receive issues into Mantis, evaluate them, then pass the ones to be worked into Redmine. Mantis has a SOAP API. So I guess we'd really like to see a SOAP API, or some other mechanism to pass selected issues to Redmine from Mantis.

Of course this might involve a REST service from Mantis..

#11 Updated by Wes Billman over 6 years ago

+1 for REST API

would really like to see a mylyn connector for eclipse!!

#12 Updated by dop in over 6 years ago

+1 for REST API
a mylyn connector for eclipse should be so nice!

#13 Updated by Karl DeBisschop over 6 years ago

To the user who was able to set up the generic mylyn connector, Any chance of posting details?

I'd love to see a native connector - that seems to be the big thing that trac still has over redmine.

#14 Updated by Jean-Philippe Lang over 6 years ago

I've just added an Howto on using the Mylyn generic connector: HowTo Mylyn

#15 Updated by Karl DeBisschop over 6 years ago

Thanks for the HowTo. Unfortunately, it doesn't seem to work for me. I haven't found a way to diagnose the problem. I have a bit of a suspicion that the login isn't working because when I try to open the query in a browser it fails. But I don't have enough understanding of the mylyn connector to be sure that I'm interpreting that fact correctly.

#16 Updated by Benjamin Eberlei over 6 years ago

Thank you very much for that HowTo, I guess the request for a fully featured Mylyn connector would have to go to the Mylyn development team.

I raise my hand for the REST/SOAP API though, because it would be very useful to integrate redmine into other applications in an consistent way. Propably now you would just access the Redmine Database structure and retrieve the information you need in another application. A consitently defined gateway would be much more useful.

#17 Updated by Akira Matsuda over 6 years ago

+1 for REST API

I strongly long for this feature in order to replace my ugly sh script like this...

ruby ${REDMINE_HOME}/script/runner "Issue.create :tracker_id => 3, :project => Project.find_by_identifier('${PROJECT_NAME}'), :sub
ject => '${SUBJECT}', :description => '${DESCRIPTION}', :author => User.find_by_login('${USER_NAME}'), :start_date => Time.now" 

#18 Updated by Eric Davis over 6 years ago

I would love this feature also but looking at this from a development point of view, it's a huge undertaking. What might be a better way to make progress is to break it into smaller parts. Since it sounds like an issue API is a common request, I created #1214 for the issues API.

#19 Updated by Karl DeBisschop over 6 years ago

I have posted a video on youtube to go along with the HowTo Mylyn

#20 Updated by Roger Hunwicks over 6 years ago

+1 for Mylyn integration here too.

We are using the Generic Web Connector, as per the wiki page (thanks for that) but proper integration would be better.

We evaluated Eventum before deciding on Redmine, and our approach to Mylyn integration was going to be to produce a XML-RPC interface that matched the Trac one (because it is open source) and then try to use the native Trac connector to talk to Eventum. We're not able to attempt this for Redmine because we are a PHP shop, but someone else might want to consider if this is feasible. We figured this approach was possible using our existing skills, whereas writing a native Mylyn connector wasn't.

We would also consider using a REST/SOAP/XML-RPC interface to write an integration between dotProject and Redmine (it currently has integrations for Eventum and Mantis) and between our existing in-house issue tracker and Redmine.

Thanks
Roger

#21 Updated by Roger Hunwicks over 6 years ago

Jean-Philippe Lang wrote:

I've just added an Howto on using the Mylyn generic connector: HowTo Mylyn

Please can you update this page:

If you are accessing Redmine via a subdirectory, e.g. http://server.company.com/redmine (instead of http://redmine.company.com) then the setup is slightly different:

Server:                 http://www.company.com/directory -- Replace it with the URL of your Redmine instance
Query pattern:          <td class="subject">.*?<a href="/directory/issues/show/(\d+)">(.+?)</a></td> -- replace /directory as required

Note the /directory in the query pattern, which must match the directory path you access Redmine at.

Thanks
Roger

#22 Updated by Markus Knittig over 6 years ago

+1
I'm also very interested in an Mylyn connector. The Generic Web Connector doesn't have enough features for me and the Generic SQL Connector is not flexible enough. I would help to develop one, but before that a API is needed. Unfortunaly I'm a Ruby newbie, but maybe this can help: http://www.xml.com/pub/a/2006/04/19/rest-on-rails.html

#24 Updated by Markus Knittig over 6 years ago

So, I've played a bit with REST and Redmine. It was quite easy to set up even for me as a Ruby newbie. I successfully deleted projects and created a issue with curl. Problems:
  • REST doesn't like cookies. Some kind of token authentication would be good. Maybe extend the RSS key authentication?
  • Rendering single objects like projects are easy. But rendering e.g. issues with journals, timelogs and attachments as XML is tricky.
  • Haven't thought about querying custom fields, enumerations, etc.

#25 Updated by Markus Knittig over 6 years ago

  • % Done changed from 0 to 10

Someone has already created a basic XML-RPC service for Redmine: http://sourceforge.net/projects/redmin-mylyncon/
I'm looking into that, because I don't think it's possible to get Redmine RESTful without some serious rewrites...

#26 Updated by Eric Davis over 6 years ago

Markus Knittig wrote:

So, I've played a bit with REST and Redmine. It was quite easy to set up even for me as a Ruby newbie. I successfully deleted projects and created a issue with curl. Problems:
  • REST doesn't like cookies. Some kind of token authentication would be good. Maybe extend the RSS key authentication?
  • Rendering single objects like projects are easy. But rendering e.g. issues with journals, timelogs and attachments as XML is tricky.
  • Haven't thought about querying custom fields, enumerations, etc.

Looks like a good start. If I get some time I can try to lend a hand, I have a few years experience with REST and Ruby on Rails. The Redmine controllers are pretty fat though so I'd see a lot of refactoring needed to get a good API interface. I'd image the API would be a good 1.0 feature with maybe a preview release in 0.9.

#27 Updated by Markus Knittig about 6 years ago

Eric Davis wrote:

The Redmine controllers are pretty fat though so I'd see a lot of refactoring needed to get a good API interface.

ACK. What's your option on this: http://e-haitham.blogspot.com/2008/06/restful-rails-paramparsers-and-xml.html
About authentication: I think OAuth looks like a good solution...

#28 Updated by Markus Knittig about 6 years ago

  • % Done changed from 10 to 30

So, I've forked Redmine from Eric on GitHub and have begun to work on a RESTful branch: http://github.com/mknittig/redmine/tree/restful
It's still a bit buggy, but I'm making good progress...

#29 Updated by Gerrit Kaiser about 6 years ago

I did some work on Redmine’s URL scheme that would help this. I made the URLs adhere to Rails’ (new) conventions as closely as possible (e.g. /project/ecookbook/{wiki}issues|activity} etc.

See Issue #1901

(I can’t seem to add that issue as proper “related issue”. How come?)

#30 Updated by Markus Knittig about 6 years ago

Gerrit Kaiser wrote:

I did some work on Redmine’s URL scheme that would help this. I made the URLs adhere to Rails’ (new) conventions as closely as possible (e.g. /project/ecookbook/{wiki}issues|activity} etc.

See Issue #1901

Looks like a good start, but I think using resources instead of connect is a better solution. I might use some of your tests if you don't mind...

#31 Updated by Gerrit Kaiser about 6 years ago

You’re welcome to grab whatever you like from the patch! But let’s think about it:

Sure using map.resources would greatly clean up the routes.rb file, but there would be no other gain than that.

On the other hand, using map.resources requires a complete refactoring of all of the controllers. Redmine doesn’t use named routes internally, relying on url_for params hashes everywhere instead. So using map.resources right away would also require you to check and possibly change all links and forms on the site, a daunting task especially considering Redmine’s spotty view test coverage.

Using equivalent conventional routes where appropriate like in my patch would allow you to create an external interface that is exactly like it should be. Then introducing named routes and using them everywhere, then refactoring the controllers (one by one) to follow Rails’s action conventions and finally switching to map.resources calls to generate the routes seems to me like a more viable migration path, especially considering the significant size of Redmine’s codebase.

#32 Updated by Markus Knittig about 6 years ago

Gerrit Kaiser wrote:

You’re welcome to grab whatever you like from the patch! But let’s think about it:

Sure using map.resources would greatly clean up the routes.rb file, but there would be no other gain than that.

You can use the path and url helpers that resources generates...

On the other hand, using map.resources requires a complete refactoring of all of the controllers. Redmine doesn’t use named routes internally, relying on url_for params hashes everywhere instead. So using map.resources right away would also require you to check and possibly change all links and forms on the site, a daunting task especially considering Redmine’s spotty view test coverage.

Good point...

Using equivalent conventional routes where appropriate like in my patch would allow you to create an external interface that is exactly like it should be. Then introducing named routes and using them everywhere, then refactoring the controllers (one by one) to follow Rails’s action conventions and finally switching to map.resources calls to generate the routes seems to me like a more viable migration path, especially considering the significant size of Redmine’s codebase.

Sound's like a good plan to me...

#33 Updated by Eric Davis about 6 years ago

Markus Knittig wrote:

So, I've forked Redmine from Eric on GitHub and have begun to work on a RESTful branch: http://github.com/mknittig/redmine/tree/restful
It's still a bit buggy, but I'm making good progress...

Once you get it to good working state, send me a pull request and I'll see about merging it into core (or as a branch of core). With such a large change, I'd like to make sure there is a lot of test coverage.

#34 Updated by Brian Palmer about 6 years ago

Markus Knittig wrote:

  • REST doesn't like cookies. Some kind of token authentication would be good. Maybe extend the RSS key authentication?

Rather than token auth, why not just use HTTP BASIC auth? Rails 2.0 even has it baked in.

#35 Updated by Markus Knittig almost 6 years ago

Eric Davis wrote:

Once you get it to good working state, send me a pull request and I'll see about merging it into core (or as a branch of core). With such a large change, I'd like to make sure there is a lot of test coverage.

I'm nearly ready with the principle work. Only two functional test fail ("ArgumentError: tried to create Proc object without a block") and I've no idea why, because they seem to work manually. Also the refactored controller code might sometimes be a bit hackish...
A branch would be fine. It should be merged when 0.8 is done.

Brian Palmer wrote:

Rather than token auth, why not just use HTTP BASIC auth? Rails 2.0 even has it baked in.

Yeah, that might be the simplest solution.

#36 Updated by Eric Davis almost 6 years ago

Markus Knittig wrote:

I'm nearly ready with the principle work. Only two functional test fail ("ArgumentError: tried to create Proc object without a block") and I've no idea why, because they seem to work manually. Also the refactored controller code might sometimes be a bit hackish...
A branch would be fine. It should be merged when 0.8 is done.

Great, I'm following you on GitHub so let me know once it's ready for some more stressful testing.

Jean-Philippe, how close are we to 0.8? If we still have a lot of time, it might be good to pull in the REST code into trunk and let it stabilize there. If 0.8 is coming up soon, it might be best to keep the REST out until post-release.

#37 Updated by Markus Knittig almost 6 years ago

  • % Done changed from 30 to 60

So, finally all test pass, but there is still some refactoring to do. BTW: I've not refactored the wiki and the repository controllers and routes yet, because there routing is a bit complicated.
I'm playing around with Selenium for better test coverage (the current test methods don't really cover errors in views). Would it be OK to add the Selenium Rails Plugins to Redmine?
I've also started a new branch restful-ext where I add XML output to Redmine (plus HTTP Basic Authentication for REST Clients).

#38 Updated by Jan Ivar Beddari almost 6 years ago

The work you are doing here Markus is really interesting, thanks and keep it up! Your progress is just inspiring, funny how you at 2008-06-29 posted that you were a Ruby newbie, well now where are we? ;-)

#39 Updated by Patrick Naubert almost 6 years ago

+1

#40 Updated by Eric Davis over 5 years ago

I just commited support for REST urls in r2317. This is the first step towards an actual REST interface.

#41 Updated by Markus Knittig over 5 years ago

Just updated, looks great!

#42 Updated by Eric Davis over 5 years ago

  • Status changed from New to 7
  • Assignee set to Eric Davis

Seeing as this issue has been around for such a long time with very little progress, I'm going to take it and see what I can do about it. I'm not promising it will be complete, just that it will be worked on. If anyone wants to help or send me patches I'd love the help. I'll be checking the patches here and the commits on GitHub.

And if you don't see REST, you now have a target someone to ask about it.

#43 Updated by Markus Knittig over 5 years ago

Eric Davis wrote:

Seeing as this issue has been around for such a long time with very little progress, I'm going to take it and see what I can do about it. I'm not promising it will be complete, just that it will be worked on. If anyone wants to help or send me patches I'd love the help. I'll be checking the patches here and the commits on GitHub.

Cool, I'll revisit my Redmine RESTful branch this weekend. IMO the main problem is the ugly controller refactoring. A Ruby/Rails Pro like you can probably do a much better job...

#44 Updated by Yohann Monnier over 5 years ago

I would like to use this Rest API to use Redmine's Tickets methods through webservice to make a link between

How it works ?

Has this work been merged with the main Trunk ?

Thank you for your work.

Yohann

#45 Updated by Jens Goldhammer over 5 years ago

+1 for integrating it into the trunk

#46 Updated by Oleg Lozinskij over 5 years ago

+1

and another +1 for a good documentation (or at least wiki page with all mapped URLs)

#47 Updated by Davide Ferrari over 5 years ago

+1 to know about the status of Redmine APIs. lot of integration stuff could be done with this API in a cleaner way. Can you merge somehow in trunk, even if not 100% complete (but not giving errors, obviously).

TIA!

#48 Updated by Piero Sartini over 5 years ago

+1
right now it's hard to write connectors (thinking about IntelliJ and NetBeans).

#49 Updated by Yohann Monnier over 5 years ago

I published a webservice plugin, based on mylyn connector, in which i implement access to many parts of redmine.

http://github.com/YohannsMonnier/redmine_webservice/tree/master

#50 Updated by sebastián scarano about 5 years ago

+1, count me on this one...

it would be really great to have a connector for netbeans and other ides...

#52 Updated by Christian Ribe almost 5 years ago

+1

#53 Updated by Nikolay Kotlyarov almost 5 years ago

+1 for REST API

#55 Updated by Eric Davis almost 5 years ago

Sergio Rubio wrote:

Some self promotion...

http://rubiojr.netcorex.org/blog/?p=154

This might work as an intermediate solution but I have two concerns:

  1. it uses the Mail API key for authentication
  2. there are no tests included so it's difficult to see how it would behave under the different conditions

I think once 0.9 is out, you could switch to using the System API key instead (r3201).

#56 Updated by Sergio Rubio almost 5 years ago

Hi Eric,

Your concerns are also my concerns :D.

I'll try to address them for the next release. I should also clean the API and document it, so others can benefit from it till we have an official one.

#57 Updated by Jean-Philippe Lang almost 5 years ago

  • Assignee changed from Eric Davis to Jean-Philippe Lang

XML REST API added for Issues (r3310) and Projects (r3313).
See the documentation.

#58 Updated by Eddie Ringle over 4 years ago

This patch adds a JSON format for lists of projects, individual project information, as well as creating and deleting projects. Tested the list and individual pages (simple GET requests), but haven't been able to test the others.

#59 Updated by Eddie Ringle over 4 years ago

FYI, that patch and any subsequent patches I post here are coming directly from my fork of Redmine on GitHub (http://github.com/eddieringle/redmine).

#60 Updated by Javier Hernandez over 4 years ago

Hi, i'm developing a redmine's desktop client, but i need some features in REST API.

I enumerate features that i need, at this moment, for continue with the project:

Time tracking: Add spent-hours to issues
Projects-related features
Members in a project, for assign issues to a specific member
Issues-related features
Get Issues' possible types
Get Issues' possible categories
Add notes to journals at issue's update
Attachment files, at creation and at issue's update
Now, my application can get and create/update/delete issues/projects, but options are a little bit limited.

It is difficult to implement this?

Thanks in advance!

#61 Updated by Felix Schäfer over 4 years ago

  • Category set to REST API

#62 Updated by Lennard Hunfeld over 4 years ago

Hi,

we are having the same problem with the time tracking.
Is there actually a good way to add spent hours using rest?

#63 Updated by Yohann Monnier over 4 years ago

@Lennard Hunfeld , @Javier Hernandez : you can use issue api to add spent hours to project ;)

Timelog.new(:issue_id => params[:task], :time_entry=>{:comments => messageEntry, :activity_id => @redmine_dev_activity , :hours => params[:spent_time]})

#64 Updated by Lennard Hunfeld over 4 years ago

Thanks a lot.

#65 Updated by Lennard Hunfeld over 4 years ago

Hi,

is your code still working with version 0.9.4?
if so, could you tell me where the timelogs.xml (or whatever it may be called) is located?

#66 Updated by Perrine C. over 4 years ago

Hi,

@Lennard Hunfeld: I think we have the same problem

@Yohann Monnier: Can you explain how to use this API ?

I use the PHP ActiveResource class, and tried to create a Timelog inherited class, but it cannot find the page timelogs.xml.

Maybe it doesn't work like Issue and Project ?

You said "you can use issue api".
Does it mean that we have to instanciate an Issue class (inherited of ActiveResource), and
1) search the issue to which we want to add spent hours
2) add time ?
How can we do it ?

Thanks in advance.

#67 Updated by Yohann Monnier over 4 years ago

@Perrine C.

I work on enhancements of the api, but my changes have not been commited yet for timelogs.

In order to add spent time, you can follow your algorithm, i mean

1/ create an issue class inheriting from active ressource
2/ fetch the issue you want to update
3/ update the issue with the params i explain in my previous post

#68 Updated by Perrine C. over 4 years ago

Hi,
first, I want to thank you for your fast answer ! :)

Unfortunately, I didn't succeed :(

I installed the last release (0.9.4.devel.3764).
Then, I did like this :

1) Instanciate an Issue :
$issue = new Issue();

2) Fetch the one I want :
$issue->find($issue_id);

3) Tried to update the subject :
$issue->set('subject', 'test')->save();
=> it's okay...

4) Tried to add spent hours :
$issue->set('time_entry', array('comments' => $comment, 'activity_id' => $activity, 'hours' => $hours) )->save();
=> it doesn't work...

I think I didn't understand how to use your params, because I don't know how to "translate" ruby code into php code (I don't know anything about ruby..). Could you help me to give the correct params with php code ?

Thanks again =)

#69 Updated by Yohann Monnier over 4 years ago

Hello Perrine C.

I am really sorry but this way does not work anymore.

Here is the way i do it today :

newtimelog = Timelog.new(:issue_id => params[:task], :time_entry=>{:comments => messageEntry, :activity_id => @redmine_dev_activity , :hours => params[:spent_time]})

But this is not available for now in the core of Redmine.

I working on it to add it via the development team.

You can find the changes on my github repository, you need changes on these files :

Best regards

#70 Updated by Perrine C. over 4 years ago

Thanks again for the answer and the attention given to my request.

I will watch for news about your timelogs API. Maybe you can inform everybody when your changes will be commited ?

All the best.

#71 Updated by Guillaume P. over 4 years ago

Hello everybody.

I try to use this feature but I don't manage to do what I want.

Create project -> OK

Create issue for an existing project, created manually in Redmine -> OK

Create issue for a project which was created by this API -> NOT OK !

It doesn't work because trackers are not available for the project. But I don't manage to associate tracker with the project :
$project = new Project(array('name' => 'test', 'identifier' => 'test', 'parent_id' => '1', 'trackers' => '1'));
or
$project = new Project(array('name' => 'test', 'identifier' => 'test', 'parent_id' => '1', 'trackers' => array('1')));
give the same result :
ActiveRecord::AssociationTypeMismatch (Tracker(#-612369158) expected, got String(#-607940098)):
app/controllers/projects_controller.rb:70:in `new'
app/controllers/projects_controller.rb:70:in `add'

The creation of issues works fine after I associate manually the trackers in Redmine.

Is it possible to create project and after that create issue for this one ?

Thanks.

#72 Updated by Yohann Monnier over 4 years ago

Check this Redmine version here (testing only for the moment)

http://github.com/Yohannsmonnier/redmine

It allows :

  • List members of a projet
  • New Timelog API (in progress : for the moment: add spent time)
  • Enhanced Issue API
  • Enhanced Project API (get project in list view members for example)
  • Get current user info (for client connexion purpose)
  • Enumerations access :
    • Get all trackers
    • Get all priorities
  • it also Corrects generated REST XMLs (data types, better way to display REST XMLs in tags and not with too much attributes)
More to come in the next weeks :
  • New User API (add, edit an user)
  • ...

Tell me what you need, I'll try to implement it.

I am open to suggestion to correct my implementations

#73 Updated by Guillaume P. over 4 years ago

Thanks Yohann.

I downloaded your version, it works fine but it seems that it doesn't include what I need.
It's very simple : I have to create 1 project and X child, and Y issues to this child.
The creation of the project by the API is OK, but I can't create issues for the project.

In order to do that, I have to configure in Redmine the trackers and the enabled modules for each projects, even if I checked all modules in default enabled modules in the administration.

I would like to make it automatic.

If I tried to put trackers in the constructor of the class :
$project = new Project(array('name' => 'test', 'identifier' => 'test', 'parent_id' => '1', 'trackers' => '1'));
or
$project = new Project(array('name' => 'test', 'identifier' => 'test', 'parent_id' => '1', 'trackers' => array('1')));
it gives me this error :
ActiveRecord::AssociationTypeMismatch (Tracker(#-612369158) expected, got String(#-607940098)):
app/controllers/projects_controller.rb:70:in `new'
app/controllers/projects_controller.rb:70:in `add'

Does anybody manage to create issues to a project which has been created by the API ?

#74 Updated by Yohann Monnier over 4 years ago

Update you copy of my Repo.

I add all trackers on Project creation by the API.

Tell me if it works

#75 Updated by Guillaume P. over 4 years ago

Thank you Yohann for your modifications.

To resume :
- before the modifications : project's creation worked but it wasn't possible to create issues to a project created by the API. Because there were no trackers and no enabled modules associated to the project.
- after modifications : all trackers are available for a project which has been created with the API ; the defaults project modules are also available for the project.

I think these modifications are really importants and must be integrated in the future version of Redmine.

#76 Updated by Adam Ferguson over 4 years ago

Hi Yohann,

I noticed earlier Javier Hernandez requested the ability to add notes to an issue when it was updated. Your summary of your changes mentioned "Enhanced Issue API" but didn't mention notes specifically. Am I to understand that using the main distribution of Redmine that you cannot add notes to issues via the API? I may just be missing something.

Thanks,
Adam

#77 Updated by Kiall Mac Innes about 4 years ago

I don't believe this has been mentioned above, but access to a projects files via XML would be great.

#78 Updated by Alumni Freeware about 4 years ago

Could the improvements posted in this thread be merged into the main trunk? An extended REST API would be great, as the current one has a lot of limitations.

#79 Updated by Jean-Philippe Lang almost 4 years ago

  • Status changed from 7 to Closed

Closing this ticket in favor of specific tickets for each resource that can be accessed via the API.

#80 Updated by Abdullah Choudhury over 3 years ago

Hi There,
I am seeing this problem after I had update using the SVN update option.
The issues are not returning jounrals! We wrote a small mobile client and they dont show up anymore and we found out the reason is an issue.xml is returning something like this. No jounral object here
@
<issue><id>151</id><project name="TRF social network" id="14"/><tracker name="Support" id="3"/><status name="New" id="1"/><priority name="High" id="5"/><author name="XLNC redmine" id="1"/><assigned_to name="Mahay Khan" id="13"/><subject>Comparison of buddpress and drupal</subject><description>Please compare the buddpress version( the one that we are developing) and the Drupal version(the one they have)
and list the things that we need to do get it finished.
Please have this delivered to me no later than tomorrow. At least the home page. It has to be as detailed as possible

thanks,
Abdullah</description><start_date>2011-02-09</start_date><due_date>2011-02-10</due_date><done_ratio>0</done_ratio><estimated_hours>4.0</estimated_hours><created_on>2011-02-09T09:12:12-08:00</created_on><updated_on>2011-02-11T11:23:06-08:00</updated_on></issue>
@

has anyone seen this problem before. is there any remedy?

#81 Updated by Etienne Massip over 3 years ago

This is a recent change introduced with r4486 : you should now add "include=..." to your query url.

That is : /issues/296.xml?include=journals will output journal entries.

Also available in: Atom PDF