using System;
using RestSharp;
using System.Threading;
using RestSharp.Authenticators.OAuth2;
// .....
var access_token = "yourtoken123456";
var client = new RestClient("https://api.pushsms.ru/api/v1/");
client.Authenticator = new OAuth2AuthorizationRequestHeaderAuthenticator(access_token, "Bearer");
var request_params = new
{
text = "hello world",
phone = "71237654321"
};
var request = new RestRequest("delivery").AddJsonBody(request_params);
try
{
var response = await client.PostAsync(request);
Console.WriteLine(response.Content);
}
catch(Exception e) {
Console.WriteLine("{0} Exception caught.", e);
}