This code returns the list of comments for the specified document.
// Compile from the command line: csc GetCommentListExample.cs
using System;
using System.IO;
using System.Net;
using System.Xml;
public class GetCommentListExample
{
private const String API_ENDPOINT = "http://api.approver.com/v1/";
//// TODO: Change these constants to values that work for you.
private const String APP_KEY = "bwhjdwvzysulefguwmfqlditbfbkhe";
private const String TOKEN = "uhdikfyrmghwvsrxrwhe";
private const String DOC_ID = "8784";
public static void Main()
{
XmlDocument xd = new XmlDocument();
xd.Load(API_ENDPOINT + "getCommentList.aspx?app_key=" + APP_KEY + "&token=" + TOKEN + "&doc_id=" + DOC_ID);
XmlNodeList comments = xd.SelectNodes("/comments/comment");
if (comments.Count == 0)
{
Console.WriteLine("This document has no comments.");
}
foreach (XmlNode comment in comments)
{
Console.WriteLine(comment.SelectSingleNode("body").InnerText);
}
Console.ReadLine();
}
}