0

I'm having some difficulty with the Google Calendar API (I'm using ASP.NET with C# via WebRequests). It inserts and updates events well enough, but in the event description, I cannot make it seem to put text on new lines. I've tried using "\n" to make it happen, and also a StringBuilder with the AppendLine Method. Did not work either, they just make it return a "Bad Request (400)" error. Anybody know how to make this happen?

Thanks.

Vandel212
  • 1,074
  • 1
  • 13
  • 28

1 Answers1

2

Try to use APIs Explorer for Google APIs. Events:insert contains at the bottom of the page simple form which allow developers to test how it works. Try with it. You should be able to insert new line by sending \n character. But I found this question: Newline for Google Calendar Api?. Bad Request (400) means that your request it is not valid.

Community
  • 1
  • 1
Michał Ziober
  • 37,175
  • 18
  • 99
  • 146
  • Hi Thank you for your response. I've been using the API Explorer for a while now, it's quite handy. Unfortunately it was not very helpful in this situation. It turns out that the string I'm inputting into google calendar needs to be formatted for JSON so that it can work properly. I actually found the answer I needed on a different thread, and posted a comment on the thread you linked in your answer. Here is the function I used to get it done. It formats the string and outputs it in the correct format: http://stackoverflow.com/questions/1242118/how-to-escape-json-string/21455488#21455488 – Vandel212 Mar 24 '14 at 18:39