参数applicationName必须符合模式(Google Report API) [英] Parameter applicationName must conform to the pattern (Google Report API)

查看:82
本文介绍了参数applicationName必须符合模式(Google Report API)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很想通过Java代码让Google环聊满足数据,而我正在尝试使用Google报告api

I neet to get the google hangouts meet data by java code and I am trying the google report api

以下是我的代码

String userKey = "all";
String applicationName = "meet";
String eventName = "call_ended";
Activities result = service.activities().list(userKey, applicationName).setEventName(eventName).setMaxResults(10).execute();

,响应为

参数applicationName必须符合以下格式:(admin)|(calendar)|(drive)|(login)|(token)

Parameter applicationName must conform to the pattern (admin)|(calendar)|(drive)|(login)|(token)

我正在尝试的api是这样,我可以通过相同的参数获取此链接中的数据

the api I am trying is this, i can get the data in this link by the same parameters

https://developers.google.com/admin-sdk/reports/v1/reference/activities/list

我也可以通过以下Java代码获取数据

and I also can get the data by the following java code

public static String getGraph() {
        String PROTECTED_RESOURCE_URL = "https://www.googleapis.com/admin/reports/v1/activity/users/all/applications/meet?eventName=call_ended&maxResults=10&access_token=";
        String graph = "";
        try {
            URL urUserInfo = new URL(PROTECTED_RESOURCE_URL + "access_token");
            HttpURLConnection connObtainUserInfo = (HttpURLConnection) urUserInfo.openConnection();
            if (connObtainUserInfo.getResponseCode() == HttpURLConnection.HTTP_OK) {
                StringBuilder sbLines = new StringBuilder("");

                BufferedReader reader = new BufferedReader(
                        new InputStreamReader(connObtainUserInfo.getInputStream(), "utf-8"));
                String strLine = "";
                while ((strLine = reader.readLine()) != null) {
                    sbLines.append(strLine);
                }
                graph = sbLines.toString();
            }
        } catch (IOException ex) {
            ex.printStackTrace();
        }
        return graph;
    }

我认为这不是一个好的解决方案,我得到的是一个复杂的字符串

I think it's not a good solution and what i got is a complex string

请提供任何解决方案!?

Any solution please!?

推荐答案

这是一个已在 Google Issue Tracker ;您可以在此处进行检查.

This is a known bug already referenced on Google Issue Tracker; you can check it here.

这篇关于参数applicationName必须符合模式(Google Report API)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆