none
Outlook Calendar event creation - code:ErrorNotAcceptable RRS feed

  • Question

  • Hi,

    Below is the json string I am using to create a calendar Event:

    {"Body":{"ContentType":"HTML","Content":"RPh  9A-3P Store-150 6 Hrs "},"BodyPreview":"RPh  9A-3P Store-150 6 Hrs ","Start":{"DateTime":"2017-02-02T09:00","TimeZone":"Eastern Standard Time"},"End":{"DateTime":"2017-02-02T15:00","TimeZone":"Eastern Standard Time"}}

    Details of the request details as below:

    WebResource webResource = client.resource(UriBuilder.fromUri("https://outlook.office.com/api/v2.0/me/events").build());        
    ClientResponse response = webResource.header("Authorization", "Bearer " + this.accessToken).type(MediaType.APPLICATION_JSON).post(ClientResponse.class, json.toString());

    The event has been created in user calendar properly; but it is throwing the below error as a response:(POST https://outlook.office.com/api/v2.0/me/events returned a response status of 406 Not Acceptable)

    {"error":{"code":"ErrorNotAcceptable","message":"The MIME type 'text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2' requires a '/' character between type and subtype, such as 'text/plain'."}}

    I am expecting a response with Event Id from Outlook API.

    could someone please help me on this?

    Thanks

    RajaRamesh

    Monday, February 6, 2017 6:22 AM

All replies

  • As shown in the below messgae, the Event description should be displayed as Header.  (instead of just 9a (start time), the event header should be  RPh  9A-3P Store-150 6 Hrs) 

    Monday, February 6, 2017 6:38 AM
  • Hello,

    Looks like you need to customize the form, see Create an Outlook Form for more information.


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Monday, February 6, 2017 1:13 PM
  • Hi RajaRamesh,

    Thanks for your post.

    Based on your description, it seems you are developing with Outlook Rest API, I will help to more this thread to the more related forum.

    Reference:https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=Office365forDevelopers

    Thanks for your understanding.

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, February 7, 2017 5:34 AM
  • Hi Outlook,

    Based on your other threads, it seems you are developing with Outlook Rest API. Is this issue also related with Outlook Rest API, if so, I will help to move this thread to the more related forum.

    If not, please feel free to share us more information about your issue.

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, February 7, 2017 5:36 AM
  • Hi RajaRamesh,

    an Error 406 NotAcceptable means that the service can't respond with the accept-header specified in the request. In your case it means that HTML as the response is not acceptable for the server.


    Regards, Sjoukje

    Please remember to click 'Mark as Answer' on the post that helps you.

    Thursday, February 16, 2017 8:05 AM
    Moderator