プロジェクト

全般

プロフィール

操作

redmine.org の Rest_api_with_csharp の日本語訳です。

.NET での REST API の使用法

Redmine REST API でのアクセスに使える .NET のライブラリには Redmine .NET API library があります。これはサードパーティ製のフリー(Apache 2 オープンソースライセンス)なライブラリです。

使用例(C#):

using System;
using System.Collections.Specialized;
using Redmine.Net.Api;
using Redmine.Net.Api.Types;

namespace RedmineTest
{
    class Program
    {
        static void Main(string[] args)
        {
            string host = "";
            string apiKey = "";

            var manager = new RedmineManager(host, apiKey);

            var parameters = new NameValueCollection {{"status_id", "*"}};
            foreach (var issue in manager.GetObjectList<Issue>(parameters))
            {
                Console.WriteLine("#{0}: {1}", issue.Id, issue.Subject);
            }

            // チケットの作成
            var newIssue = new Issue { Subject = "test", Project = new IdentifiableName{Id =  1}};
            manager.CreateObject(newIssue);

        }
    }
}


Updated by Mitsuyoshi Yoshida , 12年以上前に更新
Access count: 11843 :since 2009-10-30

Mitsuyoshi Yoshida さんが12年以上前に更新 · 1件の履歴