public void SetUp() { var appKey = ""; var appSecret = ""; var password = ""; if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("APP_KEY"))) { appKey = Environment.GetEnvironmentVariable("APP_KEY"); } if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("APP_SECRET"))) { appSecret = Environment.GetEnvironmentVariable("APP_SECRET"); } if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("USER_NAME"))) { UserName = Environment.GetEnvironmentVariable("USER_NAME"); ToPhone = UserName; } if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("PASSWORD"))) { password = Environment.GetEnvironmentVariable("PASSWORD"); } RingCentralClient = new RingCentral.SDK.SDK(appKey, appSecret, ApiEndPoint, "C Sharp Test Suite", "1.0.0"); Platform = RingCentralClient.GetPlatform(); Platform._client = new HttpClient(MockResponseHandler) { BaseAddress = new Uri(ApiEndPoint) }; AuthResult = Platform.Authorize(UserName, Extension, password, true); }
public void SetUp() { var appKey = ""; var appSecret = ""; var password = ""; if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("APP_KEY"))) { appKey = Environment.GetEnvironmentVariable("APP_KEY"); } if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("APP_SECRET"))) { appSecret = Environment.GetEnvironmentVariable("APP_SECRET"); } if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("USER_NAME"))) { UserName = Environment.GetEnvironmentVariable("USER_NAME"); ToPhone = UserName; } if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("PASSWORD"))) { password = Environment.GetEnvironmentVariable("PASSWORD"); } RingCentralClient = new RingCentral.SDK.SDK(appKey, appSecret, ApiEndPoint,"C Sharp Test Suite", "1.0.0"); Platform = RingCentralClient.GetPlatform(); Platform._client = new HttpClient(MockResponseHandler) { BaseAddress = new Uri(ApiEndPoint) }; AuthResult = Platform.Authorize(UserName, Extension, password, true); }
public ApiClient(SDK.SDK rcsdk) { this.RCSDK = rcsdk; }
static void Main(string[] args) { //add appkey, app secret, Username=Sandbox phone number, Extension and Sandbpx password var sdk = new SDK("<APP KEY>", "<APP SECRET>", "https://platform.devtest.ringcentral.com/", "1", "1"); var platform = sdk.GetPlatform(); Response response = platform.Authorize("<USERNAME>", "<EXT>", "<PASSWORD>", true); //fetch access token string accesstoken = (string)response.GetJson().SelectToken("access_token"); Program p = new Program(); //subscription p.run(platform,response); //access call-log //download call-recording p.downloadOneRecording(platform); }