Not all of ShippingEasy's APIs are available via methods in the ShippingEasy.Client class. The ShippingEasy.Connection class, however, can be used to make requests and it handles the signing of the request with your API key and API secret.
For example, to retrieve all store API keys:
using System;
using ShippingEasy;
namespace SE1
{
class Program
{
static void Main(string[] args)
{
// ordinarily the API key and API secret would be loaded
// from a secure env variable or config file, etc.
Connection conx = new Connection("7e419816e705d1cd6d7dbf484ad7c",
"3ca2e94bca00112f3a89e2085e89d630bbd33a0dcf591847cc5944d21ea");
HttpResponse resp = conx.MakeRequest("GET",
"/api/stores",
null);
}
}
}
For example, to create an EasyShip session:
using System;
using ShippingEasy;
namespace EasyShipSession
{
public static class Program
{
public static void Main(string[] args)
{
// ordinarily the API key and API secret would be loaded
// from a secure env variable or config file, etc.
// the base URL is only necessary when using the staging
// server for testing - omit it to use the default of
// https://app.shippingeasy.com
Connection conx = new Connection("b7a21191f41d23b5adbb76b3304d92",
"63a66a3e060f70a66f7dd08eb2f108a35fef6d9c2795452453880632f636",
"https://staging.shippingeasy.com");
// session specific values - for a specific
// merchant and a specific order
String requestBody = "{\"session\": { \"email\":\"[email protected]\", \"name\":\"Merchant Company Name\", \"first_name\":\"Bill\", \"last_name\":\"Merchant\", \"external_identifier\":\"43295\" } }";
// see http://shippingeasy.readme.io/docs/partners-api-sessions
// for more info
HttpResponse resp = conx.MakeRequest("POST",
"/partners/api/sessions",
requestBody);
}
}
}