Created
December 18, 2014 03:25
-
-
Save tany3/1413ac06b4a5c6b57a45 to your computer and use it in GitHub Desktop.
CSChatworkAPISample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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