小编Ale*_*xey的帖子

Google日历活动说明中的HTML格式文字

嗨谷歌日历团队.

我们使用Google Calendar API为客户同步日历.Event.description一直是纯文本.并且应该是纯文本,对吧?但是最近我们开始遇到我们的代码不准备处理的html格式文本的情况.

实际上有一个很长的关于新Google应用程序的主题是:https: //productforums.google.com/forum/#!topic/calendar/r3OC4cL53NQ

来自Google API团队的人可以就此问题发表评论吗?

这实际上非常有趣.Google Cloud团队今天向我发送了邀请,我的Mac iCal中的事件描述是html垃圾.这都是因为谷歌日历应用程序开始将html写入使用Google Calendar API的任何人视为纯文本的字段.

即使是最初的iCalendar标准也只允许纯文本作为事件描述的一部分.文本描述字段中不允许使用HTML标记,例如字体属性(粗体,下划线)和布局(div,表格).

google-calendar-api google-api

6
推荐指数
2
解决办法
2396
查看次数

Google通讯录API - 无法刷新访问令牌

我们在OAuth2中使用Google Contacts API:

credential = new GoogleCredential.Builder().setTransport(new NetHttpTransport())
        .setJsonFactory(new JacksonFactory())
        .setClientSecrets(OAuth2ClientId(), OAuth2ClientSecret())
        .addRefreshListener(new CredentialRefreshListener() {...});

myService = new ContactsService("My-App");
myService.setOAuth2Credentials(credential);
Run Code Online (Sandbox Code Playgroud)

并且我们经常收到GData库无法处理的"401 Unauthorized"响应.AuthenticationException在WWW-Authenticate标头丢失时抛出NPE .

Caused by: java.lang.NullPointerException: No authentication header information
        at com.google.gdata.util.AuthenticationException.initFromAuthHeader(AuthenticationException.java:96) ~[gdata-core-1.0-1.47.1.jar:na]
        at com.google.gdata.util.AuthenticationException.<init>(AuthenticationException.java:67) ~[gdata-core-1.0-1.47.1.jar:na]
        at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:608) ~[gdata-core-1.0-1.47.1.jar:na]
        at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:564) ~[gdata-core-1.0-1.47.1.jar:na]
        at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:560) ~[gdata-core-1.0-1.47.1.jar:na]
        at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:538) ~[gdata-core-1.0-1.47.1.jar:na]
        at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:536) ~[gdata-core-1.0-1.47.1.jar:na]
        at com.google.gdata.client.Service.getFeed(Service.java:1135) ~[gdata-core-1.0-1.47.1.jar:1.47.1]
        at com.google.gdata.client.Service.getFeed(Service.java:1077) ~[gdata-core-1.0-1.47.1.jar:1.47.1]
        at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:676) ~[gdata-core-1.0-1.47.1.jar:1.47.1]
        at com.google.gdata.client.Service.query(Service.java:1237) ~[gdata-core-1.0-1.47.1.jar:1.47.1]
        at com.google.gdata.client.Service.query(Service.java:1178) ~[gdata-core-1.0-1.47.1.jar:1.47.1]
Run Code Online (Sandbox Code Playgroud)

我们设法添加了一个在这个NPE上尝试令牌刷新的包装器.它有所帮助,但是当刷新失败时仍有很多情况:

credential.refreshToken() == false
Run Code Online (Sandbox Code Playgroud)

当我们refreshToken()在调试器中运行时,我们看到它executeRefreshToken()在没有异常的情况下执行但是tokenResponse==null被返回.结果refreshToken() …

google-api google-contacts-api google-data-api google-oauth

5
推荐指数
1
解决办法
2106
查看次数