Skip to content

Instantly share code, notes, and snippets.

@tany3
Created December 18, 2014 03:25
Show Gist options
  • Save tany3/1413ac06b4a5c6b57a45 to your computer and use it in GitHub Desktop.
Save tany3/1413ac06b4a5c6b57a45 to your computer and use it in GitHub Desktop.
CSChatworkAPISample
using System;
using CSChatworkAPI;
namespace Example
{
class Program
{
static void Main(string[] args)
{
var client = new ChatworkClient(@"APIToken"); // TODO:APIToken
// rooms
Console.WriteLine("=== Rooms ===");
foreach (var room in client.GetRooms())
{
Console.WriteLine(room);
}
// send message
const int roomId = int.MinValue; // TODO:yourRoomId
const string body = "Hello Chatwork!";
var resp = client.SendMessage(roomId, body);
Console.WriteLine(resp);
Console.WriteLine("Message: id={0} body={1}", resp.message_id, body);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment