Question

C# Sending SMS thows System.UriFormatException: 'Invalid URI: The format of the URI could not be determined.'

  • 3 October 2018
  • 2 replies
  • 1162 views

Trying to send a simple SMS with this code it throws

public void SendText()

{


//This throws System.UriFormatException: 'Invalid URI: The format of the URI could not //be determined.' at this point

var sdk = new SDK(appkey, appSecret, "SDK.Server.Sandbox", " MyApp", "1.0.0");

var jsonString = "{ "text": "TryThis RC!", "from": { "phoneNumber": "+15558881212" }, "to": [{ "phoneNumber": "+18008675309" }] }";

var request = new Request("/restapi/v1.0/account/~/extension/~/sms", jsonString);

var response = sdk.Platform.Post(request);


}


What am I doing wrong?






2 replies

Hi Rick,

Not sure what SDK do you use. Please refer to our official SDK for C-Sharp and use it to access RingCentral Platform. Have a look at the sample code for sending SMS

Hope this helps,
+ Phong 
Hi Rick,

Last month I created a video for how to setup a new project. Please watch this: https://www.youtube.com/watch?v=lECKMrX_Dgw&t=10s

Reply