0

We've been using the Chilkat component with C# for ages to read and send emails. Works great, no problems. Now though we need to be able to extract Calendar data for meetings rooms, all of which have their own mail account setup so that they can all show in Outlook and teams can, in effect, book the room.

Although I've been through the samples online (https://www.example-code.com/dotnet-core/outlook_calendar_list_events.asp) and got it working for our development mail account in terms of permissions etc. it can only see it's 'own' calendars (e.g. Calendar, UK Holidays, Birthdays), and not the calendars for the the meeting rooms (e.g. Room1, Room2, Room3), all of which I've added to the development mail account's list of calendars.

enter image description here

Is this something that's even possible? Have I connected the other calendars up wrong?

I've generated the token using a working set of endpoints (and the scope 'openid profile offline_access user.readwrite calendars.readwrite files.readwrite') and that's validated properly and returned a token. I've then used that with some of the Chilkat sample code but, when run, it outputs 3 calendars rather than the expected/hoped for 7:

http.AuthToken = jsonToken.StringOf("access_token");

Chilkat.HttpResponse resp = http.QuickRequest("GET","https://graph.microsoft.com/v1.0/me/calendars");
if (http.LastMethodSuccess != true)
{
    Console.WriteLine(http.LastErrorText);
    return;
}

Console.WriteLine("Response status code = " + Convert.ToString(resp.StatusCode));

// The HTTP request succeeded if the response status code = 200.
if (resp.StatusCode != 200)
{
    Console.WriteLine(resp.BodyStr);
    Console.WriteLine("Failed");

    return;
}

Chilkat.JsonObject json = new Chilkat.JsonObject();
json.Load(resp.BodyStr);
json.EmitCompact = false;
Console.WriteLine(json.Emit());

string odata_context = json.StringOf("\"@odata.context\"");
Console.WriteLine(json.SizeOfArray("value"));

TheNeil
  • 11
  • 3

0 Answers0