Documentation.
Connections.
If you are using .NET to connect to
our API service there is a helper library available with sample projects in both
C#.NET and VB.NET. An API key is required in order
to connect to the GovDeals API service. Also, below are custom examples in both C# .NET and ColdFusion
.NET C#
Samples |
Example
GET |
JSON
var request =
WebRequest.Create(https://sam.lqdt1.com/getaccounts.cfm?token=(APIKEY)&accntID=(ACCTID)&format=json");
((HttpWebRequest)request).UserAgent =
"apiNet";
request.Method = "GET";
// Get response.
var response = request.GetResponse();
// Display status.
Console.WriteLine(((HttpWebResponse)response).StatusDescription);
// Get stream containing content returned.
var stream =
response.GetResponseStream();
// Open
stream using StreamReader for access.
var reader = new StreamReader(stream);
// Read content.
var responseFromServer
= reader.ReadToEnd();
// Display
content.
Console.WriteLine(responseFromServer);
Console.WriteLine(((HttpWebResponse)response).StatusDescription);
Console.WriteLine(((HttpWebResponse)response).Method);
Console.WriteLine(((HttpWebResponse)response).ResponseUri.ToString());
Console.WriteLine(((HttpWebResponse)response).Headers.ToString());
// Clean up.
reader.Close();
response.Close();
- OR -
XML
var request
=
WebRequest.Create("https://sam.lqdt1.com/getaccounts.cfm?token=(APIKEY)&accntID=(ACCTID)&format=xml");
((HttpWebRequest)request).UserAgent =
"apiNet";
request.Method = "GET";
// Get response.
var response = request.GetResponse();
// Display
status.
Console.WriteLine(((HttpWebResponse)response).StatusDescription);
// Get stream containing content
returned.
var stream =
response.GetResponseStream();
// Open
stream using StreamReader for access.
var reader = new StreamReader(stream);
// Read content.
var responseFromServer
= reader.ReadToEnd();
// Display
content.
Console.WriteLine(responseFromServer);
Console.WriteLine(((HttpWebResponse)response).StatusDescription);
Console.WriteLine(((HttpWebResponse)response).Method);
Console.WriteLine(((HttpWebResponse)response).ResponseUri.ToString());
Console.WriteLine(((HttpWebResponse)response).Headers.ToString());
// Clean up.
reader.Close();
response.Close();
|
ColdFusion
Samples |
Example GET |
JSON
<cfhttp
url="https://sam.lqdt1.com/getaccounts.cfm?token=(APIKEY)&accntID=(ACCTID)&format=json"
method="GET" timeout="300" resolveurl="yes">
<cfhttpparam type="header"
name="accept" value="application/json">
</cfhttp>
<cfdump
var="#cfhttp.FileContent#">
- OR -
XML
<cfhttp
url="https://sam.lqdt1.com/getaccounts.cfm?token=(APIKEY)&accntID=(ACCTID)&format=xml"
method="GET" timeout="300" resolveurl="yes">
<cfhttpparam type="header"
name="accept" value="text/xml">
</cfhttp>
<cfdump
var="#cfhttp.FileContent#">
|