Developer Center

Approver.com Developer Center > Developer Documentation > C# Code Examples

GetReviewerList API - C# Example

This example retrieves the reviewers for a particular document, displaying a list of the full names of each.

// Compile from the command line:  csc GetReviewerListExample.cs
 
using System;
using System.IO;
using System.Net;
using System.Xml;
 
public class GetReviewerListExample
{
    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 int DOC_ID = 7456;
 
    public static void Main()
    {
        XmlDocument xd = new XmlDocument();
        xd.Load(API_ENDPOINT + "getReviewerList.aspx?token=" + TOKEN + "&doc_id=" + DOC_ID);
        XmlNodeList reviewers = xd.SelectNodes("/reviewers/reviewer");
 
        foreach (XmlNode reviewer in reviewers)
        {
            Console.WriteLine(reviewer.SelectSingleNode("fullname").InnerText);
        }
    }
}