public static string GetSessionID() { ApiContext context = AppSettingHelper.GetGenericApiContext("US"); GetSessionIDCall calla = new GetSessionIDCall(context); return(calla.GetSessionID(context.RuName)); }
private void BtnGenerateSID_Click(object sender, System.EventArgs e) { try { if (!validateApiAccount(Context)) { MessageBox.Show("Pleasse fill in Api Account first."); return; } GetSessionIDCall gsc = new GetSessionIDCall(Context); if (txtRulName.Text == string.Empty) { MessageBox.Show("Please input a RuName"); return; } //the rule name can be retrived from the app.config file, otherwise the user must input it himself. Context.RuName = txtRulName.Text; String sessionID = gsc.GetSessionID(Context.RuName); TxtSessionID.Text = sessionID; } catch (ApiException ex) { MessageBox.Show(ex.Message); } }
public string GetRequestTokenUrl() { GetSessionIDCall gsc = new GetSessionIDCall(api); string sessionid = gsc.GetSessionID(Runname); SessionID = sessionid; return(string.Format(Redirecturl, Runname, sessionid)); }
/// <summary> /// Gets the session identifier. /// </summary> /// <returns></returns> public Task <string> GetSessionId() { GetSessionIDCall getSessionIdCall = new GetSessionIDCall(GetContext()); getSessionIdCall.EnableCompression = true; getSessionIdCall.Site = SiteCodeType.UK; return(Task.Run(() => getSessionIdCall.GetSessionID(Config.RuName))); }
public EbayServiceResponse <string> GetSignInUrl() { var apiContext = CreateApiContext(apiServerUrl, ruName, appId, devId, certId); var result = new EbayServiceResponse <string>(); try { GetSessionIDCall sidCall = new GetSessionIDCall(apiContext); string sessionId = sidCall.GetSessionID(apiContext.RuName); result.Result = signinUrl + "&RuName=" + apiContext.RuName + "&SessID=" + HttpUtility.UrlEncode(sessionId); } catch (Exception ex) { result.Error = ex.Message; } return(result); }
public static EbayAuthRequest CreateNewAuthRequest() { var client = EbayClientHelper.GetSdkClient(); var call = new GetSessionIDCall(client); var service = new WebServices.eBayService.eBayAPIInterfaceService(); var sessionId = call.GetSessionID(EbaySettings.RuName); var urlEncodedSessionID = sessionId; //System.Net.WebUtility.UrlEncode(sessionId); var loginUrl = string.Format("https://signin.ebay.com/ws/eBayISAPI.dll?SignIn&runame={0}&SessID={1}", EbaySettings.RuName, urlEncodedSessionID); var data = new EbayAuthRequest { SessionId = sessionId, LoginUrl = loginUrl }; log.Debug($"Created New Auth Request: {data}"); return(data); }