using System.Threading.Tasks;
[JsonProperty(PropertyName = "public_key")]
public string PublicKey { get; set; }
[JsonProperty(PropertyName = "secret_key")]
public string SecretKey { get; set; }
public async static void Main()
var token=await GeToken();
Console.WriteLine("{0}", token);
Console.WriteLine("Hello World");
public async static Task<string> GeToken()
var options = new RestClientOptions("https://api.sandbox.protecht.com/api/v2/auth/token");
var client = new RestClient(options);
var request = new RestRequest("");
PublicKey = "pk_sandbox_d5e23350211ccb3c40771776bf2e17dadaa7aa3e",
SecretKey = "sk_sandbox_2608c999aef635f0fb3403344147b0b84746378a"
var body=JsonConvert.SerializeObject(auth);
request.AddHeader("Accept", "application/json");
request.AddJsonBody(body);
var response = await client.PostAsync(request);
return JsonConvert.DeserializeObject<string>(response.Content);