You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using System;
using open_sdk.api;
using open_sdk.auth;
using open_sdk.core;
using open_sdk.token;
using open_sdk.token.type;
namespace open_sdk
Silent silent = new Silent("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET", YOUR_KDT_ID);
OauthToken.TokenData silenToken =silent.GetToken();
string token = silenToken.Token;
Console.WriteLine("request result *******************" + token);
刷新TOKEN
using System;
using open_sdk.api;
using open_sdk.auth;
using open_sdk.core;
using open_sdk.token;
using open_sdk.token.type;
namespace open_sdk
RefreshToken refreshToken = new RefreshToken("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET");
refreshToken.FreshToken = "YOUR_REFRESH_TOKEN";
OauthToken.TokenData newRefreshToken = refreshToken.GetToken();
string newToken = newRefreshToken.Token;
2.正常调用
using System;
using open_sdk.api;
using open_sdk.auth;
using open_sdk.core;
using open_sdk.token;
using open_sdk.token.type;
namespace open_sdk
GeneralApi generalApi = new GeneralApi();
GeneralApiParams apiParams = new GeneralApiParams();
generalApi.SetName("youzan.ump.promocard.detail.get");
generalApi.SetVersion("3.0.0");
generalApi.SetHttpMethod("POST");
generalApi.SetOAuthType(common.constant.OAuthEnum.TOKEN);
apiParams.AddParam("id", "2003777768");
generalApi.SetAPIParams(apiParams);
IYouZanClient defaultYZClient = new DefaultYZClient();
string result = defaultYZClient.Invoke(generalApi,new Token(token), null, null);