question

Travis Medley avatar image
Travis Medley asked Phong Vu answered

Tryin to send my first API SMS message, getting Status = Faulted {7}

I am new to RingCentral, building a AtoP SMS feature.

I am using .NET Core. Downloaded the sample.
It compiles all fine. Plugged in the credentials.

When I go to sent I get

Id = 31, Status = Faulted {7}, Method = "{null}", Result = "{Not yet computed}"


What is faulted {7}. Is that a credential issue?


Thanks

sms and text messaging
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Phong Vu avatar image
Phong Vu answered

That does not say anything. Share some code (remove sensitive info if any) how you call the API.

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Travis Medley avatar image
Travis Medley answered

Thanks for your help.

I was just trying to understand what "faulted {7} meant.


However, here is the code I am trying to get working (replaced passwords etc)


protected void Page_Load(object sender, System.EventArgs e)
{
string accountSid = "AAA";
string authToken = "BBB";
string extension = "101";
string username = "CCC";
string userpwd = "DDD";

RingCentral.RestClient RC = new RingCentral.RestClient(accountSid, authToken, false);
RC.Authorize(username, extension, userpwd);


var parameters = new CreateSMSMessage();

parameters.to = new MessageStoreCallerInfoRequest[] {
new MessageStoreCallerInfoRequest()
{
phoneNumber = "+1949381XXXX"
}
};


parameters.to = new MessageStoreCallerInfoRequest[] {
new MessageStoreCallerInfoRequest()
{
phoneNumber = "+1760802XXXX"
}
};

parameters.text = "test";

var message = RC.Restapi().Account(accountSid).Extension(extension).Sms().Post(parameters);
}



1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Phong Vu avatar image
Phong Vu answered

Where did you get the example code from? The code you posted looks very strange and I suspect that the account id and the extension id is completely wrong.

string accountSid = "AAA";
string extension = "101";

Where did you get the account Sid? Remember that the accountId and the extensionId are internal ids. They are NOT the username and the extension number (101 as you currently specified).

If you are not sure about the ids, leave them blank

var message = RC.Restapi().Account().Extension().Sms().Post(parameters);

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys