Exigo Developer Resources

This database contains the documentation for Exigo's OData API's, as well as C# sample code and fully-realized demo applications ready to be customized for your needs. Start building downline viewers, reporting tools and shopping carts on the Exigo platform today!

Create an account Sign In

Photo Management via OData


A photo uploader that uses the ASP.Net FileUpload object to resize and upload photos using OData. Also demonstrates how to display uploaded photos.


This sample requires the following namespaces:

using ExigoOData;
using System.Text;
using System.Data.Services.Client;
using System.Net;
using System.IO;
using System.Drawing;
using System.Drawing.Imaging;

Exigo API Authentication

This sample accesses the Exigo OData using the ExigoContext object:

     public ExigoContext Exigo
               var context = new ExigoOData.ExigoContext(new Uri("http://api.exigo.com/4.0/" + exigoAPICompany + "/model"));
               context.IgnoreMissingProperties = true;
               var credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes(exigoAPILoginName + ":" + exigoAPIPassword));
               context.SendingRequest +=
                   (object s, SendingRequestEventArgs e) =>
                       e.RequestHeaders.Add("Authorization", "Basic " + credentials);
               return context;

Saving the Uploaded Image

This sample stores the image selected into the Exigo API using OData.

         var request = (HttpWebRequest)WebRequest.Create("http://api.exigo.com/4.0/" + exigoAPICompany + "/images" + (path.StartsWith("/") ? "" : "/") + path + "/" + filename);
          request.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes(exigoAPILoginName + ":" + exigoAPIPassword)));
          request.Method = "POST";
          request.ContentLength = contents.Length;
          var writer = request.GetRequestStream();
          writer.Write(contents, 0, contents.Length);
          var response = (HttpWebResponse)request.GetResponse();