The error response I get from Graph API is below.
{ "error": { "code": "ErrorItemNotFound", "message": "The specified object was not found in the store.", "innerError": { "request-id": "c2b32b83-5ccf-4385-bee1-33afcc31deb0", "date": "2016-07-25T00:25:16" } } }
When I try to deserialize the response into my own error object i get an error
Unexpected character encountered while parsing value: . Path '', line 0, position 0.
Copy the above JSON and try validate using this tool https://jsonformatter.curiousconcept.com/
Anyone else having the same issue?
UPDATE
Sorry for late response guys. Below is the exact code i am using. I've just tested this again and i am getting the same error.
Enpoint URL: https://graph.microsoft.com/v1.0/users/MY_USER@EMAIL/events/
// New rest client with the destination URL.
var client = new RestClient(url);
// Type of request
var request = new RestRequest(requestType);
// Headers
request.AddHeader("Authorization", "Bearer " + accessToken);
request.AddHeader("Content-Type", "application/json");
// Content serialized in a json format
if (requestType == Method.POST || requestType == Method.PATCH || requestType == Method.PUT)
{
var jsonBody = JsonConvert.SerializeObject(requestContent);
request.AddParameter("application/json", jsonBody, ParameterType.RequestBody);
}
var response = await client.ExecuteTaskAsync(request);
Body of the request
{"Id":null,"Subject":"Maths","UserEmailAddress":"[email protected]","Start":{"DateTime":"2016-09-1T10:11:56","TimeZone":"Pacific/Auckland"},"End":{"DateTime":"2016-09-1T11:11:56","TimeZone":"Pacific/Auckland"},"Location":null,"Body":null,"ReminderMinutesBeforeStart":60,"IsReminderOn":true}