{"_id":"55b40c415e6f140d0088fd71","parentDoc":null,"project":"5436a1e1d0ffee0e00f18f8c","version":{"_id":"54cc2148380ecd0d00ca18aa","__v":2,"forked_from":"5436a1e1d0ffee0e00f18f8f","project":"5436a1e1d0ffee0e00f18f8c","createdAt":"2015-01-31T00:26:48.753Z","releaseDate":"2015-01-31T00:26:48.753Z","categories":["54cc2149380ecd0d00ca18ab","54cc2149380ecd0d00ca18ac","54cc2149380ecd0d00ca18ad","54cc2149380ecd0d00ca18ae","54cc2149380ecd0d00ca18af","54cc2149380ecd0d00ca18b0","54cc2149380ecd0d00ca18b1","54cc2149380ecd0d00ca18b2","54cc2149380ecd0d00ca18b3","552f29ca633a5b0d00e99d09"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.1.0","version":"1.1"},"user":"5436a1afb7cf0e1c0020d9ca","__v":5,"category":{"_id":"54cc2149380ecd0d00ca18b3","project":"5436a1e1d0ffee0e00f18f8c","version":"54cc2148380ecd0d00ca18aa","__v":4,"pages":["54cc2149380ecd0d00ca18b8","54cfa9ebbba1a0230087417e","54cfb63b3995cf0d0006f6de","55b40c415e6f140d0088fd71"],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-31T17:07:44.342Z","from_sync":false,"order":8,"slug":"net-client","title":".Net Client"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-07-25T22:22:57.662Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"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.\n\nFor example, to create an [EasyShip session](http://shippingeasy.readme.io/docs/partners-api-sessions):\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"using System;\\nusing ShippingEasy;\\n\\nnamespace EasyShipSession\\n{\\n    public static class Program\\n    {\\n        public static void Main(string[] args)\\n        {\\n            // ordinarily the API key and API secret would be loaded\\n            // from a secure env variable or config file, etc.\\n            // the base URL is only necessary when using the staging \\n            // server for testing - omit it to use the default of \\n            // https://app.shippingeasy.com\\n            Connection conx = new Connection(\\\"b7a21191f41d23b5adbb76b3304d92\\\",\\n                                             \\\"63a66a3e060f70a66f7dd08eb2f108a35fef6d9c2795452453880632f636\\\",\\n                                             \\\"https://staging.shippingeasy.com\\\");\\n\\n            // session specific values - for a specific \\n            // merchant and a specific order\\n            String requestBody = \\\"{\\\\\\\"session\\\\\\\":  { \\\\\\\"email\\\\\\\":\\\\\\\"merchant:::at:::myemail.com\\\\\\\", \\\\\\\"name\\\\\\\":\\\\\\\"Merchant Company Name\\\\\\\", \\\\\\\"first_name\\\\\\\":\\\\\\\"Bill\\\\\\\", \\\\\\\"last_name\\\\\\\":\\\\\\\"Merchant\\\\\\\", \\\\\\\"external_identifier\\\\\\\":\\\\\\\"43295\\\\\\\" } }\\\";\\n\\n            // see http://shippingeasy.readme.io/docs/partners-api-sessions \\n            // for more info\\n            HttpResponse resp = conx.MakeRequest(\\\"POST\\\",\\n                                                 \\\"/partners/api/sessions\\\",\\n                                                 requestBody);\\n        }\\n    }\\n\\n}\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"accessing-other-apis","type":"basic","title":"Accessing Other APIs"}

Accessing Other APIs


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 create an [EasyShip session](http://shippingeasy.readme.io/docs/partners-api-sessions): [block:code] { "codes": [ { "code": "using System;\nusing ShippingEasy;\n\nnamespace EasyShipSession\n{\n public static class Program\n {\n public static void Main(string[] args)\n {\n // ordinarily the API key and API secret would be loaded\n // from a secure env variable or config file, etc.\n // the base URL is only necessary when using the staging \n // server for testing - omit it to use the default of \n // https://app.shippingeasy.com\n Connection conx = new Connection(\"b7a21191f41d23b5adbb76b3304d92\",\n \"63a66a3e060f70a66f7dd08eb2f108a35fef6d9c2795452453880632f636\",\n \"https://staging.shippingeasy.com\");\n\n // session specific values - for a specific \n // merchant and a specific order\n String requestBody = \"{\\\"session\\\": { \\\"email\\\":\\\"merchant@myemail.com\\\", \\\"name\\\":\\\"Merchant Company Name\\\", \\\"first_name\\\":\\\"Bill\\\", \\\"last_name\\\":\\\"Merchant\\\", \\\"external_identifier\\\":\\\"43295\\\" } }\";\n\n // see http://shippingeasy.readme.io/docs/partners-api-sessions \n // for more info\n HttpResponse resp = conx.MakeRequest(\"POST\",\n \"/partners/api/sessions\",\n requestBody);\n }\n }\n\n}", "language": "csharp" } ] } [/block]