jsoのフィールドにNULLの値があってはいけないようです。必ず fieldName = String.Emptyで初期化しましょう。 { 'error': { 'errors': [ { 'domain': 'global', 'reason': 'invalid', 'message': 'Invalid value for: null is not a valid value' } ], 'code': 400, 'message': 'Invalid value for: null is not a valid value' } }
2.更新日時のフォーマット間違い
Googleカレンダーの更新日時のフォーマットは "yyyy-MM-ddTHH:mm:ss.fffZ" です。それ以外のフォーマットにして設定すると以下のように表示されます。 { 'error': { 'errors': [ { 'domain': 'global', 'reason': 'invalid', 'message': 'Invalid value for: Invalid format: \\'2017-06-21T15:46:56Z\\' is malformed at \\'Z\\'' } ], 'code': 400, 'message': 'Invalid value for: Invalid format: \\'2017-06-21T15:46:56Z\\' is malformed at \\'Z\\'' } }
3.イベント日時のフォーマット間違い
Googleカレンダーのイベント日時のフォーマットは通常のフォーマットどおり "yyyy-MM-dd" です。更新日時のフォーマットとは異なるのですね。。。 { 'error': { 'errors': [ { 'domain': 'global', 'reason': 'invalid', 'message': 'Invalid value for: \\'T\\' found, can only parse bare date string: 2017-06-21T00:00:00+09:00 Have you accidentally used DateTime instead of a Date?' } ], 'code': 400, 'message': 'Invalid value for: \\'T\\' found, can only parse bare date string: 2017-06-21T00:00:00+09:00 Have you accidentally used DateTime instead of a Date?' } }
4.含まれる色が違う場合
Googleカレンダーの色(背景色)はintで指定します。 System.Colorで設定した場合、以下のようなエラーとなります。 { 'error': { 'errors': [ { 'domain': 'global', 'reason': 'invalid', 'message': 'Invalid value for: [Color: A=1, R=1, G=0.647058844566345, B=0, Hue=0.107843138277531, Saturation=1, Luminosity=0.5] is not a valid value' } ], 'code': 400, 'message': 'Invalid value for: [Color: A=1, R=1, G=0.647058844566345, B=0, Hue=0.107843138277531, Saturation=1, Luminosity=0.5] is not a valid value' } }
5.含まれる色が違う場合 その2
Googleカレンダーの色(背景色)はintで指定します。 Stringで設定した場合、以下のようなエラーとなります。 { 'error': { 'errors': [ { 'domain': 'global', 'reason': 'invalid', 'message': 'Invalid value for: Orange is not a valid value' } ], 'code': 400, 'message': 'Invalid value for: Orange is not a valid value' } }
6.イベント日時の型に不備がある
Googleカレンダーのベント開始日時とイベント終了日時にtimezoneなどの余計なフィールドが含まれている場合、以下のようなエラーとなります。 { 'error': { 'errors': [ { 'domain': 'global', 'reason': 'invalid', 'message': 'Start and end times must either both be date or both be dateTime.' } ], 'code': 400, 'message': 'Start and end times must either both be date or both be dateTime.' } }