Google Calendar API事件插入始终返回404“未找到”错误iOS

时间:2015-05-20 10:23:28

标签: ios google-calendar-api google-oauth

我在这里尝试了日历插入示例:https://developers.google.com/google-apps/calendar/v3/reference/events/update

无论我使用哪个属性,我总是得到404“未找到”错误。任何人都可以对此有所了解吗?非常感谢!!!

PUT https://www.googleapis.com/calendar/v3/calendars/primary/events/q4amm7fsk9rq97r3dmhisjie84&key={YOUR_API_KEY}

Content-Type:  application/json

Request Body : 



{
    attendees =     (
                {
            email = "xxxxxx.xxxx@gmail.com";
        }
    );
    end =     {
        dateTime = "2015-05-20T16:50:00+05:30";
    };
    start =     {
        dateTime = "2015-05-20T15:50:00+05:30";
    };
}

性反应:

 {    
   "error": {
    "errors": [
   {
"domain": "global",
"reason": "required",
"message": "Login Required",
"locationType": "header",
"location": "Authorization"
    }
     ],
      "code": 401,
      "message": "Login Required"
         }
      }

1 个答案:

答案 0 :(得分:1)

尝试 PUT 而不是发布 https://www.googleapis.com/calendar/v3/calendars/primary/events/q4amm7fsk9rq97r3dmhisjie84&key= {YOUR_API_KEY}

Content-Type:application / json

{    
   "error": {
    "errors": [
   {
"domain": "global",
"reason": "required",
"message": "Login Required",
"locationType": "header",
"location": "Authorization"
    }
     ],
      "code": 401,
      "message": "Login Required"
         }
      }