标签: google-api

YouTube API V3:我在哪里可以找到每个'videoCategoryId'的列表?

我正在使用Youtube API V3,但无法找到有关如何按类别过滤的文档:

这是我的代码:

$results = $youtube->search->listSearch('id,snippet', array(
    'q' =>                  $_GET['q'],
    'maxResults' =>         20,
    'type' =>               'video'
    'videoCategoryId' =>    'what-do-i-put-here?',
));
Run Code Online (Sandbox Code Playgroud)

我一直在阅读他们的文档一个小时,似乎找不到任何关于如何找出各类别ID的参考.在我的情况下,我正在寻找音乐的videoCategoryId ....

php youtube google-api youtube-api

17
推荐指数
3
解决办法
2万
查看次数

嵌入式Google日历:如何设置显示的小时数范围?

给出以下嵌入代码:

<iframe src="https://www.google.com/calendar/embed?
title=2014 PLIDAM International Symposium (Paris)&
dates=20140611/20140615&
mode=WEEK&amp;
showNav=1&amp;
showDate=1&amp;
showPrint=1&amp;
showTabs=1&amp;
showCalendars=0&amp;
showTz=1;
height=600&amp;
wkst=2&amp;
bgcolor=%23666666&amp;
src=vdfmfbp0msroletduigs2qtkoc%40group.calendar.google.com&amp;
color=%232952A3&amp;
ctz=Europe%2FParis" 
style=" border:solid 1px #777 " width="800" height="600" frameborder="0" scrolling="no"></iframe>
Run Code Online (Sandbox Code Playgroud)

是否有一个参数来设置从09:00到18:00(下午6点)显示/ focus_on的小时数,即工作时间?几天相同,是否只有4天才能显示/聚焦权利.

在这里小提琴

iframe google-calendar-api google-api

17
推荐指数
1
解决办法
2934
查看次数

使用Google Spreadsheet API在Google中的Google驱动器中创建电子表格

我创建了一些填充谷歌电子表格的工具.它工作正常1年,因为今天我错了

Exception in thread "main" com.google.gdata.util.AuthenticationException: Error authenticating (check service name)
at com.google.gdata.client.GoogleAuthTokenFactory.getAuthException(GoogleAuthTokenFactory.java:688)
at com.google.gdata.client.GoogleAuthTokenFactory.getAuthToken(GoogleAuthTokenFactory.java:560)
at com.google.gdata.client.GoogleAuthTokenFactory.setUserCredentials(GoogleAuthTokenFactory.java:397)
at com.google.gdata.client.GoogleService.setUserCredentials(GoogleService.java:364)
at com.google.gdata.client.GoogleService.setUserCredentials(GoogleService.java:319)
at com.google.gdata.client.GoogleService.setUserCredentials(GoogleService.java:303)
Run Code Online (Sandbox Code Playgroud)

这是与gmail连接的代码部分:

String USERNAME = "usename@........com"; ->of course I'm using proper username and password
    String PASSWORD = "*******";
    SpreadsheetService service
            = new SpreadsheetService("SandboxCheck");
    service.setUserCredentials(USERNAME, PASSWORD);
Run Code Online (Sandbox Code Playgroud)

我不知道如何连接gmail,我试图通过oAuth这样做,但我不知道如何做到这一点.在https://developers.google.com/google-apps/spreadsheets/authorize上的示例中,只有.net的代码.

java google-api google-sheets gmail-api

17
推荐指数
1
解决办法
1万
查看次数

如何使用Google Translate v2 API客户端库为java提出翻译请求?

没有关于如何将Java Translate API Cliente库用于java的示例.

在此页面中,Google建议搜索其API的示例,但Google Translate API没有一个示例:https://github.com/google/google-api-java-client-samples

由于我没有找到任何谷歌翻译API的例子,我没有任何关于如何使用他们的官方Java库的线索.

我想提出一个简单的请求,将文本(例如Hello World从英语翻译成西班牙语)与Google制作的官方图书馆:https://developers.google.com/api-client-library/java/apis/translate/v2但没有可供公众使用的文档或示例.

有没有人知道如何在java中使用谷歌翻译API客户端库,我已经google了,我根本没有运气.

我已经将所有jar包含在我的项目中,但是我不知道我必须使用哪些类或者哪些对象实例化以便从一种语言转换为另一种语言.我根本不知道.我只需要像其他Google API的示例存储库中那样简单地剪切代码.

java api google-api google-translate

17
推荐指数
2
解决办法
2万
查看次数

使用Youtube Analytics API时出现错误:"消息":"需要登录"

我正在使用youtube api.当我点击此网址时" https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3DMINE&start-date=2015-01-01&end-date=2016-01-31&metrics=likes% 2Cdislikes&key = {API Key} "

它给了401

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "required",
    "message": "Login Required",
    "locationType": "header",
    "location": "Authorization"
   }
  ],
  "code": 401,
  "message": "Login Required"
 }
}
Run Code Online (Sandbox Code Playgroud)

但是我在浏览器中点击了" https://developers.google.com/apis-explorer/?" 它工作正常.
如何使第一个请求起作用?

google-api google-oauth youtube-data-api youtube-analytics-api

17
推荐指数
2
解决办法
2万
查看次数

如何在 Android 中将 GoogleAPIClient(已弃用)与 SMSRetriver API 一起使用

我正在尝试实现 SMS Retriever API 以进行 SMS 验证。文档中提到的官方方式说GoogleApiClientHintRequest从设备检索手机号码一起使用

HintRequest hintRequest = new HintRequest.Builder()
            .setPhoneNumberIdentifierSupported(true)
            .build();

PendingIntent intent = Auth.CredentialsApi.getHintPickerIntent(
            googleApiClient, hintRequest);
try {
    startIntentSenderForResult(intent.getIntentSender(),
                RESOLVE_HINT, null, 0, 0, 0);
} catch (IntentSender.SendIntentException e) {
    e.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)

但是GoogleAPIClient已弃用并由GoogleApi接口代替,例如GoogleSignInClient. 我尝试使用GoogleSignInClientgetHintPickerIntent不接受。即使在被弃用后使用旧 API 是否安全,或者有没有办法将后者与 SMSRetriver API 一起使用?

android google-api google-api-client googlesigninapi sms-retriever-api

17
推荐指数
1
解决办法
2744
查看次数

Google API Oauth php永久访问

我正在使用谷歌日历API.这就是我想要的,一旦你给予应用程序许可,我总是可以使用该应用程序,而无需每天访问.我一直听说我需要保存访问令牌或使用刷新令牌来做我想做的事情.这就是问题,你是怎么做到的?代码如何?我已经尝试将令牌保存在cookie中,但一小时后,访问令牌已过期.如何让用户保持登录状态?

PS:请给我解释代码示例.

这是我的代码(使用CakePHP):

$client = new Google_Client();

    $client->setApplicationName("Wanda3.0 Agenda");

    $cal = new Google_CalendarService($client);

    if (isset($_GET['code'])) {

        $client->authenticate($_GET['code']);


        $_SESSION['token'] = $client->getAccessToken();


        header('Location: http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']);

    }

    if (isset($_SESSION['token'])) { $client->setAccessToken($_SESSION['token']); }

if ($client->getAccessToken()) {
        /************* Code entry *************/


    }else{
        /************* Not connected to google calendar code *************/
        $authUrl = $client->createAuthUrl();

        $returnArr = array('status' => 'false', 'message' => "<a class='login' href='$authUrl'>Connect Me!</a>");

        return $returnArr;

    }
Run Code Online (Sandbox Code Playgroud)

php google-api access-token oauth-2.0

16
推荐指数
1
解决办法
2万
查看次数

如何使用Google Access Token获取用户个人资料

我正在测试通过谷歌访问令牌获取用户信息

http://www.mawk3y.net/glogin

点击登录按钮后,我被重定向到

https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=access_token_here

并获得这样的一些JSON数据

{
"issued_to": "my client id.apps.googleusercontent.com",
"audience": "my client id.apps.googleusercontent.com",
"user_id": "user id here",
"scope": "https://www.googleapis.com/auth/plus.login",
"expires_in": 3596,
"access_type": "online"
}
Run Code Online (Sandbox Code Playgroud)

现在我需要知道如何提取用户名,地址和电子邮件任何帮助吗?

提前致谢

signing google-api google-oauth

16
推荐指数
5
解决办法
4万
查看次数

更换新的JacksonFactory以获取Java中的Google凭证

我正在尝试使用以下"旧"代码从服务器上使用google-api进行身份验证:

GoogleTokenResponse tokenResponse =
                new GoogleAuthorizationCodeTokenRequest(TRANSPORT, JSON_FACTORY,
                        CLIENT_ID, CLIENT_SECRET, code, "postmessage").execute();
        // Create a credential representation of the token data.
        GoogleCredential
                credential = new GoogleCredential.Builder()
                .setJsonFactory(JSON_FACTORY)
                .setTransport(TRANSPORT)
                .setClientSecrets(CLIENT_ID, CLIENT_SECRET).build()
                .setFromTokenResponse(tokenResponse);
Run Code Online (Sandbox Code Playgroud)

从用于java的旧版google-api开始,JSON_FACTORY的构建方式如下:

JsonFactory JSON_FACTORY = new JacksonFactory();
Run Code Online (Sandbox Code Playgroud)

但是因为我已经更新到版本1.15.0-rc,所以找不到JacksonFactory.看起来它已经被重构或删除,但我找不到任何替换这行代码的例子.

我该怎么用?肯定会实现JsonFactory,但是某些标准实现可能已经存在?

java json google-api jackson

16
推荐指数
1
解决办法
5350
查看次数

当我或其他用户尝试使用OAuth2进行授权时,我不断收到我的应用需要验证的错误.那是什么意思?

尝试使用我自己的帐户授权我的应用时收到此错误:

Your project is trying to access scopes that need to go through the verification process.

{invalid=https://www.googleapis.com/auth/contacts}

If you need to use one of these scopes, submit a verification request. Learn More
Run Code Online (Sandbox Code Playgroud)

当我使用其他帐户时,错误消息是不同的:

This app hasn’t been verified to access:
{invalid=https://www.googleapis.com/auth/contacts}


Are you the developer? If this project needs these scopes, sign in to an account with access to edit your project and try again.

If not, contact the developer for help.
Run Code Online (Sandbox Code Playgroud)

google-api google-contacts-api google-oauth gmail-api

16
推荐指数
1
解决办法
6872
查看次数