-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTestExample.cs
More file actions
25 lines (20 loc) · 976 Bytes
/
TestExample.cs
File metadata and controls
25 lines (20 loc) · 976 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using System;
using voiceit3API;
/// Test script for voiceit3 C# SDK
class TestExample {
static void Main(string[] args) {
string apiKey = Environment.GetEnvironmentVariable("VOICEIT_API_KEY") ?? "";
string apiToken = Environment.GetEnvironmentVariable("VOICEIT_API_TOKEN") ?? "";
if (string.IsNullOrEmpty(apiKey) || string.IsNullOrEmpty(apiToken)) {
Console.WriteLine("Set VOICEIT_API_KEY and VOICEIT_API_TOKEN environment variables");
return;
}
voiceit3 vi = new voiceit3(apiKey, apiToken);
Console.WriteLine("CreateUser: " + vi.CreateUser());
Console.WriteLine("GetAllUsers: " + vi.GetAllUsers());
Console.WriteLine("CreateGroup: " + vi.CreateGroup("Test Group"));
Console.WriteLine("GetAllGroups: " + vi.GetAllGroups());
Console.WriteLine("GetPhrases: " + vi.GetPhrases("en-US"));
Console.WriteLine("\nAll API calls completed successfully!");
}
}