public PostData ( |
||
url | ||
requestBody | string>.List | |
token | string | |
signingSecret | string | |
Résultat | string |
/// <summary> /// Exchange the authorisation code for an access token. /// </summary> /// <param name="code">The code supplied by Sage One's authorization page following the callback.</param> public void GetAccessToken(string code) { SageOneWebRequest request = new SageOneWebRequest(); _code = code; List <KeyValuePair <string, string> > postData = AccessTokenPostData; Uri accesstokenURI = new Uri(AccessTokenURL); string response = request.PostData(accesstokenURI, postData, "", ""); if (response.Length > 0) { JObject jObject = JObject.Parse(response); string access_token = (string)jObject["access_token"]; if (access_token != null) { this.Token = access_token; } } }
/// <summary> /// Exchange the authorisation code for an access token. /// </summary> /// <param name="code">The code supplied by Sage One's authorization page following the callback.</param> public void GetAccessToken( string code ) { SageOneWebRequest request = new SageOneWebRequest(); _code = code; List<KeyValuePair<string, string>> postData = AccessTokenPostData; Uri accesstokenURI = new Uri(AccessTokenURL); string response = request.PostData(accesstokenURI, postData, "", ""); if (response.Length > 0) { JObject jObject = JObject.Parse(response); string access_token = (string) jObject["access_token"]; if (access_token != null) { this.Token = access_token; } } }