void GetEbayTime() { //create new service string szServerURL = ""; string callname = "GeteBayOfficialTime"; string devID, appID, certID, userToken; int siteID; string version = "551"; eBayAPIInterfaceService service = new eBayAPIInterfaceService(); szServerURL = ConfigurationManager.AppSettings["ServerUrl"]; devID = ConfigurationManager.AppSettings["DevID"]; appID = ConfigurationManager.AppSettings["AppID"]; certID = ConfigurationManager.AppSettings["CertID"]; //Get the User Token to Use userToken = ConfigurationManager.AppSettings["UserToken"]; //SiteID = 0 (US) - UK = 3, Canada = 2, Australia = 15, .... //SiteID Indicates the eBay site to associate the call with siteID = 0; service.RequesterCredentials = new CustomSecurityHeaderType(); service.RequesterCredentials.eBayAuthToken = ConfigurationManager.AppSettings["UserToken"]; // use your token service.RequesterCredentials.Credentials = new UserIdPasswordType(); service.RequesterCredentials.Credentials.AppId = ConfigurationManager.AppSettings["AppID"]; service.RequesterCredentials.Credentials.DevId = ConfigurationManager.AppSettings["DevID"]; service.RequesterCredentials.Credentials.AuthCert = ConfigurationManager.AppSettings["CertID"]; string requestURL = szServerURL + "?callname=" + callname + "&siteid=" + siteID + "&appid=" + appID + "&version=" + version + "&routing=default"; service.Url = requestURL; GeteBayOfficialTimeRequestType request = new GeteBayOfficialTimeRequestType(); request.Version = "459"; GeteBayOfficialTimeResponseType response = service.GeteBayOfficialTime(request); datepick_ebay.Value = response.Timestamp; datepick_ebay.Value = datepick_ebay.Value.AddHours(-7); label2.Text = datepick_ebay.Value.ToString(); //label2.Text = response.Timestamp.ToString(); }
public static string ebaytime() { string endpoint = "https://api.sandbox.ebay.com/wsapi"; string callName = "GeteBayOfficialTime"; string siteId = "0"; string appId = "Private92-3d36-4442-8881-1b52d163268"; // use your app ID string devId = "301c8b78-4318-48ae-a825-84a6bde6f137"; // use your dev ID string certId = "3d0c5934-c325-4a5b-a9f5-dc28cf84f13d"; // use your cert ID string version = "405"; // Build the request URL string requestURL = endpoint + "?callname=" + callName + "&siteid=" + siteId + "&appid=" + appId + "&version=" + version + "&routing=default"; // Create the service eBayAPIInterfaceService service = new eBayAPIInterfaceService(); // Assign the request URL to the service locator. service.Url = requestURL; // Set credentials service.RequesterCredentials = new CustomSecurityHeaderType(); service.RequesterCredentials.eBayAuthToken = "AgAAAA**AQAAAA**aAAAAA**UWN5VQ**nY+sHZ2PrBmdj6wVnY+sEZ2PrA2dj6wFk4GhDZeKpQudj6x9nY+seQ**3HoDAA**AAMAAA**2babZNpL6Q8PvLhxSkE42UeJUsJ943AV42duhbHvUj54sg2Rl59cr29Pca56Zs0NouehEBz3GbDLdn8PJbqPK6kYi1COtPiN1qUyZBOWjxvU9G977ntsLh4MijbKycskL5GV0VZj504vuZsU9swT9lrVevT3I5amBbPa5jLOwHymgFZm6UUztduvEN/7krvNebmrQbze7FYHraMkDO9lTuw02MnaAGSMutJqnhdo+aIKiguOV+oEF7BJpCJumwan3zAEFoE9yQo2/uNTGsDKdXdXTj5vlGVVD2mFKG73MO2J6CRBilSAlDHSNSWbValjlvetvGfDQBRi0cV1bqJCWmsFGLAS/sQec6fmbroyk6Cs0gS5CRnYzm9BXBiYr8TRmWl9qx3gIPA5Kgqo/AiZu3AkUOYJlwcVeAGcGTGZgRFT0gO9wTzmHfSJka76tXfSHzxO6/nKWoa71BoxhjL6qbcjD1HAiBrJoj3y1+b3JFd17L02A17kvUOfQyoS0u/VyH8cgHwL3IkP6S1KQtOLeUDD3QimMPBiTnuXEqqzqT38LreMCirrNHvNf5HzDv6ijJZmHco5y6havfiFgp+oDl/pbMeDSOi3KC47Uft2sI6+/SNyS6GpMwTdAzAEmqI0Jhau0ZkWf1egx1mNzS4AFervg+P/oi4zk6vYDUN6EK0OZu/QBJRQM+TSj6/cWsiutzd+Wtu43WfkIBGh5uTXCEXTgmAPsFoCk26tgUFEt9chwYiSiFXx5l+amTbbajff"; // use your token service.RequesterCredentials.Credentials = new UserIdPasswordType(); service.RequesterCredentials.Credentials.AppId = appId; service.RequesterCredentials.Credentials.DevId = devId; service.RequesterCredentials.Credentials.AuthCert = certId; // Make the call to GeteBayOfficialTime GeteBayOfficialTimeRequestType request = new GeteBayOfficialTimeRequestType(); request.Version = "405"; GeteBayOfficialTimeResponseType response = service.GeteBayOfficialTime(request); Console.WriteLine("The time at eBay headquarters in San Jose, California, USA, is:"); Console.WriteLine(response.Timestamp); return("ebay time : " + response.Timestamp.ToString()); }
public static void TestProduction() { string endpoint = "https://api.ebay.com/wsapi"; string callName = "GeteBayOfficialTime"; string siteId = "0"; string appId = "c81af250-3212-4e28-8d7b-bee0826266e1"; // use your app ID string devId = "KoboInccf-4223-4880-9d21-c0b48323836"; // use your dev ID string certId = "c6a81e6d-d0ee-45e4-a7e8-3a1a9df2dcfd"; // use your cert ID string version = "405"; // Build the request URL string requestURL = endpoint + "?callname=" + callName + "&siteid=" + siteId + "&appid=" + appId + "&version=" + version + "&routing=default"; // Create the service eBayAPIInterfaceService service = new eBayAPIInterfaceService(); // Assign the request URL to the service locator. service.Url = requestURL; // Set credentials service.RequesterCredentials = new CustomSecurityHeaderType(); service.RequesterCredentials.eBayAuthToken = "AgAAAA**AQAAAA**aAAAAA**c8WOVg**nY+sHZ2PrBmdj6wVnY+sEZ2PrA2dj6AAlIeiCpiLoAydj6x9nY+seQ**JiADAA**AAMAAA**sPiqCG+IiAwqtalGeoTnnESc7Br2D+btBopa9arMMDNaOfglryGRHk3tn/aXAj3p2/KmDiKSmYrg51QGFNokYSGUskmH/jjsOtKgoLyTTJZ+3CtWqeAOz/cbrYadAD8l+s6xUfnTk9mWm4BjyAfYqJ1zkNHUC5YaFTk+oaDZPZ9bE7uGjfw1cvQeX6M7TalgTSygqdVV6hOVJZ3I9UPuO66HchFTPvd4n02aZ2UfsXrcYdOpstNdjLuETQIB5tmUWo6uiCwh/r+eiWt8jIycZegb/9uRHzwEy7rW9Tk7fIpIohoBtryYRLUnMJvy9Dg4l++AhFY0yakWJsWu7VHy7eCuz+OI0Pk+E+uOQhgQRzIji96K6/AnBNV9lLiOa6CiI5MdkcrF2Z4Kr4WoxAgy+4WjoUq+PRG8eDHseFWANwOVhmY9qZJq0ulR9SNcXd8FoRiinxzx3f+lO+MgfrRcea2QKKQVoYDI69jKOQ568FVQ6Zp0ClJy9ru/L9IqB87COBLFP6Ie+Zx+2nhgj+GuARYOu2z0Z7kqx+R6H19hIYoxNncQtGi2ruzqWXG+hbFWXTlqrne8IiJr1udgK1ZxJk9FTCCKQCx0s57SXuBkyaM15y2pqC+ze43ZiLGC3wk94pWEACDNRWu4rH27RZTN+ALBoGWkVdSzGxuVfMD164ak4cAJrIiT2OX77FqnLN+MGcVbfJCAu+BREtguSzW6JmM9qHXHBI+4H/jfGruvYoIt2zg7DzMFv50i+hpnLe5F"; // use your token service.RequesterCredentials.Credentials = new UserIdPasswordType(); service.RequesterCredentials.Credentials.AppId = appId; service.RequesterCredentials.Credentials.DevId = devId; service.RequesterCredentials.Credentials.AuthCert = certId; // Make the call to GeteBayOfficialTime GeteBayOfficialTimeRequestType request = new GeteBayOfficialTimeRequestType(); request.Version = "405"; GeteBayOfficialTimeResponseType response = service.GeteBayOfficialTime(request); Console.WriteLine("The time at eBay headquarters in San Jose, California, USA, is:"); Console.WriteLine(response.Timestamp); }
public static void TestSandbox() { string endpoint = "https://api.sandbox.ebay.com/wsapi"; string callName = "GeteBayOfficialTime"; string siteId = "0"; string appId = "KoboIncab-650b-4637-abcd-a6792d80993"; // use your app ID string devId = "c81af250-3212-4e28-8d7b-bee0826266e1"; // use your dev ID string certId = "d82f3fcb-303c-409b-9446-235e799f8589"; // use your cert ID string version = "405"; // Build the request URL string requestURL = endpoint + "?callname=" + callName + "&siteid=" + siteId + "&appid=" + appId + "&version=" + version + "&routing=default"; // Create the service eBayAPIInterfaceService service = new eBayAPIInterfaceService(); // Assign the request URL to the service locator. service.Url = requestURL; // Set credentials service.RequesterCredentials = new CustomSecurityHeaderType(); service.RequesterCredentials.eBayAuthToken = "AgAAAA**AQAAAA**aAAAAA**Tz2NVg**nY+sHZ2PrBmdj6wVnY+sEZ2PrA2dj6wFk4GhDpWLqA+dj6x9nY+seQ**kKoDAA**AAMAAA**1FzOBx5mSGbycTN2Pa7AffEQ8jbDk77g27juD4aFZeTrgQs94kRZY5Bjq1ifH088RviVP/9RZ0AVnK+qEfDi2M5uiDYT5fb1b8tJ+AaQjRfYG5I30M/rkUGolkTvwL4X9glOE147yCW5GGA8PG8SRZVjJ4myeO25v86TcJmmBmpHLbbN3V/7v6w4Gcovel1jB0QC6Ae5vDRTHt0N7SxSTTFFUQ4yQiLM5CpaVxa8Rp3mTxMS4DR5OEd0MTWyA7BlWsnN2TrLVFrYarrhKOE+6BS3lPdAdHMfB9uTl5JDR1d133zU+++P+VBLguWPO0EaGxs2sJ1NAwVHlEUslApdDIXH95XQIf0d8S+QOnmQ94lJ6eyjJfTqCyPjlFxCIA+9GzCbnOJjn1+LyrzD9zQrVPejuChy9qxYxikCoRUA0GrLLMsf77TBkNnKh5cgcyHvRG1NYeM596KEhvkvVEpKKr+ajC13SNkncl4wdvjV7AIpX+6UaGxbDjbuvGtLZU72qL1SmbZgOlp/UNFC/4bBG7aViG8+OK5UiI2dKI7wX2OuKEWy1fCOXSlUi8FwiaJCtIH4Lvj8cXYb0fhZ3ODPO+zenrK8XHXbau/4mA3YRwdPiLIuZjJUzUkaHEOQu4U5dBFz3YdK+S1K72nnBRmjuvS8LmNGSnUpf9fInLKP7o4CY9arWWTJqSmitlrYBXqfy70JsIaZNvpg6TamFAv3/TAaoFbgCsE1Um/PSY3C86ZEgy9QWrCwN7pvJs4SpW3I"; // use your token service.RequesterCredentials.Credentials = new UserIdPasswordType(); service.RequesterCredentials.Credentials.AppId = appId; service.RequesterCredentials.Credentials.DevId = devId; service.RequesterCredentials.Credentials.AuthCert = certId; // Make the call to GeteBayOfficialTime GeteBayOfficialTimeRequestType request = new GeteBayOfficialTimeRequestType(); request.Version = "405"; GeteBayOfficialTimeResponseType response = service.GeteBayOfficialTime(request); Console.WriteLine("The time at eBay headquarters in San Jose, California, USA, is:"); Console.WriteLine(response.Timestamp); }
public ResultInfoCheckAuthenticationToken(GeteBayOfficialTimeResponseType response) : base(response) { _Response = response; }