I am trying to pull users presence data in C#
I was able to get the AccountId and the ExtensionId from here:
Here is my code:
using System;
using System.Threading.Tasks;
using RingCentral;
namespace Send_SMS
{
class Program
{
const string RINGCENTRAL_CLIENTID = "<>";
const string RINGCENTRAL_CLIENTSECRET = "<>";
const string RINGCENTRAL_USERNAME = "<>";
const string RINGCENTRAL_PASSWORD = "<>";
const string RINGCENTRAL_EXTENSION = "<>";
const string RINGCENTRAL_PRESENCE_USER = "<>";
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()
{
// OPTIONAL QUERY PARAMETERS
ReadUserPresenceStatusParameters readUserPresenceStatusParameters = new ReadUserPresenceStatusParameters
{
//detailedTelephonyState = true,
//sipData = true
};
var response = await restClient.Restapi().Account(RINGCENTRAL_PRESENCE_USER).Extension(RINGCENTRAL_PRESENCE_EXT).Presence().Get(readUserPresenceStatusParameters);
Console.WriteLine("Presence for Test Account: " + response.presenceStatus);
}
}
}
Everything in <> is filled out of course, and tested with the SMS_Send tutorial.
My error:
Content: {"errorCode":"CMN-102","message":"Resource for parameter [extensionId] is not found","errors":[{"errorCode":"CMN-102","message":"Resource for parameter [extensionId] is not found","parameterName":"extensionId"}],"parameterName":"extensionId"}
Thanks in advance. I'm really struggling to understand the account/extension side of this API.