Further to my last question,
How do I change user presence status in RingCentral programatically using c#? ,
which was answered by Phong Vu, I have been using the code given by Phong , but no matter what happens, I always get the following error:
Error Message: Cannot access a disposed object.
Object name: 'System.Net.Http.StringContent'.
Here is the code I am using:
RestClient rc = new RestClient(clientid, clientsecret, false);
await rc.Authorize("username", "extension", "password"); //Sandbox
var parameters = new PresenceInfoResource();
parameters.userStatus = "Offline";
parameters.dndStatus = "DoNotAcceptAnyCalls";
parameters.message = "Changed by Program";
parameters.allowSeeMyPresence = true;
parameters.ringOnMonitoredCall = false;
parameters.pickUpCallsOnHold = false;
var resp = await rc.Restapi().Account().Extension(12345678).Presence().Put(parameters);
I have tried with the extension number and also the id.
If I change line the last line to a Get without parameters instead of a Put it retrieves the information as expected:
var resp = await rc.Restapi().Account().Extension(12345678).Presence().Get();
Any help would be greatfully appreciated.