News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
C#: Resource for parameter [extensionId] is not found
Tags: getting started
Aug 7, 2020 at 8:52am   •   1 replies  •  0 likes
Caleb Bluesummers

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.

1 Answer
answered on Aug 7, 2020 at 9:28am  

This is because you are not giving correct extension id number. You can get all the id numbers for all your extensions with this API

GET https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/~


It will return response with account id number and extension id number. example:

"uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/account/123456789/extension/987654321",


account id number will be 123456789 and extension id number will be 987654321


 0



A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us