How to use Commission Junction REST API using .Net

This code sample shows how to use Commission Junction REST API using .Net. The code is very straight forward. Only thing that you need to pay attention to is that you will be passing your user credentials through request header named Authorization. The value for this header is the Developer Key that was assigned to you when you signed up for Commission Junction web services account. This is a mile long string that was sent to you in your mail box as well when you signed up for CJ Web Service access.

class Program
 static void Main(string[] args)
  var reqUrl = string.Format("{0}", ADVERTISERS_LOOKUP_JOINED);
  var webReq = WebRequest.Create(reqUrl) as HttpWebRequest;
  webReq.Headers.Add("Authorization", App.Default.DEVKEY);
  var resp = webReq.GetResponse() as HttpWebResponse;
  // Get the stream associated with the response.
  var receiveStream = resp.GetResponseStream();
  var readStream = new StreamReader(receiveStream, Encoding.UTF8);
  var respText = readStream.ReadToEnd();
  if (resp.StatusCode == HttpStatusCode.OK)
   // Parse response.
   // what is the error??

If you are looking for any help building any tools based on Commission Junction API, contact me. I can guide you through the development using .Net.

comments powered by Disqus

Blog Tags