Developer Center

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

GetFrob API - C# Example

This example retrieves a frob for a particular application key. It is used with Approver.com Web services authentication.

// Compile from the command line:  csc GetFrobExample.cs
 
using System;
using System.IO;
using System.Net;
using System.Xml;
 
public class GetFrobExample
{
    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";
 
    public static void Main()
    {
        XmlDocument xd = new XmlDocument();
        xd.Load(API_ENDPOINT + "getFrob.aspx?app_key=" + APP_KEY);
        Console.WriteLine(xd.SelectSingleNode("/frob").InnerText);
    }
}