ios - Google Calendar API 事件插入总是返回 404 “not found” 错误 iOS

标签 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"
         }
      }

最佳答案

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

内容类型:application/json

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

关于ios - Google Calendar API 事件插入总是返回 404 “not found” 错误 iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30346893/

相关文章:

iphone - 如何在 iOS 中以编程方式重启或重新加载 iPhone 应用程序

javascript - Chrome 扩展 - 修改 Google 日历事件 UI 以通过输入字段接受扩展属性

javascript - 谷歌javascript登录api : no offline access

java - 如何在 Spring Boot 应用程序中设置 GOOGLE_APPLICATION_CREDENTIALS

iphone - 开发像 webapp.to 这样的移动应用程序

ios - NSURLRequest Null(没有编码问题)

ios - VStack 的帧大小没有填满整个屏幕

json - 如何在 swift 中创建特定的数据结构。 Swifty Json 没有用 :(

php - Google Calendar API v3 无法添加事件 php

c# - 尝试使用 GoogleApis 库连接到 Google 时获取 "Unexpected character ' <' at line 1, column 0."