Rest api » History » Version 1

Version 1/101 - Next » - Current version
Jean-Philippe Lang, 2010-01-13 20:34

Redmine API

Redmine exposes some of its data through a REST API. This API provides access and basic CRUD operations (create, update, delete) for the resources described below.

Most of the time, the API requires authentication. This is done via HTTP Basic authentication using the regular Redmine accounts. To enable this API-style authentication, check Enable REST API in Administration -> Settings -> Authentication.

API Description

API Usage


Redmine REST API follows the Rails's RESTful conventions, so using it with ActiveResource is pretty straightforward.

require 'rubygems'
require 'active_resource'

# Issue model on the client side
class Issue < ActiveResource::Base = 'http://redmine.server/'
  self.user = 'foo'
  self.password = 'bar'

# Retrieving issues
issues = Issue.find(:all)
puts issues.first.subject

# Retrieving an issue
issue = Issue.find(1)
puts issue.description

# Creating an issue
issue = => 'REST API', :assigned_to_id => 1, :project_id => 1)
  puts issue.errors.full_messages

# Updating an issue
issue = Issue.find(1)
issue.subject = 'REST API'

# Deleting an issue
issue = Issue.find(1)