using RingCentralSDK
I am not able to get token.
when ever i try to authorize it gives error "Unauthorized for this grant type"
here is my code
Unauthorized for this grant type
using RingCentral;
using RingCentral.Http;
using System.Net.Http;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
/// <summary>
/// Summary description for Bulk_sms
/// </summary>
public class Bulk_sms
{
public string authid = "PZurrww4RtyPR1it0KyI9w", authtoken = "sJoF2hukSg637r-f3p2JwAbYUFC1ohQuO13obpG4MBYg", account = "+13133956838", password = "sagar@123";
public ApiResponse send_bulk(string src, string dest, string text)
{
try
{
src = "+" + src;
dest = "+" + dest;
var sdk2 = new SDK(authid, authtoken, SDK.Server.Sandbox, "SMS", "1");
sdk2.Platform.Login(account, "101", password, true);
//var body = text;
//var from = src;
//var to = dest;
//var jsonData = "{"to": [{"phoneNumber": "" + to + ""}]," +
// ""from": {"phoneNumber": "" + from + ""}," +
// ""text": "" + text + "" }";
//string SmsEndPoint = "/restapi/v1.0/account/~/extension/~/sms";
//Request request = new Request(SmsEndPoint, jsonData);
//ApiResponse response = sdk2.Platform.Post(request);
//return response;
var requestBody = new
{
text = text,
from = new { phoneNumber = src },
to = new object[] { new { phoneNumber = dest } }
};
var jsonString = JsonConvert.SerializeObject(requestBody);
var request = new Request("/restapi/v1.0/account/~/extension/~/sms", jsonString);
ApiResponse response = sdk2.Platform.Post(request);
return response;
}
catch (Exception)
{
throw;
}
}
Please Help Me...????????