I'm working on a sandbox account, trying to use the Get Extensions API. My code is as follows:
using System; using System.Threading.Tasks; using RingCentral; namespace Send_SMS { class Program { const string RINGCENTRAL_CLIENTID = "<sandbox-id>"; const string RINGCENTRAL_CLIENTSECRET = "<sandbox-secret>"; const string RINGCENTRAL_USERNAME = "<sandbox-username>"; const string RINGCENTRAL_PASSWORD = "<sandbox-password>"; const string RINGCENTRAL_EXTENSION = "101"; const string RINGCENTRAL_PRESENCE_USER = "<sandbox-username>"; const string RINGCENTRAL_PRESENCE_EXT = "101"; static RestClient restClient; static void Main(string[] args) { restClient = new RestClient(RINGCENTRAL_CLIENTID, RINGCENTRAL_CLIENTSECRET, false); restClient.Authorize(RINGCENTRAL_USERNAME, RINGCENTRAL_EXTENSION, RINGCENTRAL_PASSWORD).Wait(); get_presence().Wait(); } static private async Task get_presence() { var response = await restClient.Restapi().Account(RINGCENTRAL_PRESENCE_USER).Extension().List(listExtensionsParameters); Console.WriteLine("Extension for Test Account: " + response); } } }
Where anything in <> is taken from the https://developers.ringcentral.com/my-account.html#/application-credentials site.
I was able to do the Send_SMS tutorial successfully, but for this, I'm getting:
Content: {
"errorCode" : "InvalidParameter",
"message" : "Resource for parameter [accountId] is not found",
"errors" : [ {
"errorCode" : "CMN-102",
"message" : "Resource for parameter [accountId] is not found",
"parameterName" : "accountId"
} ],
"parameterName" : "accountId"
}
What am I missing here?