Google提供各种API,主要是针对Web开发人员的Web API。 API基于流行的Google消费者产品,包括Google地图,Google地球,AdSense,Adwords,Google Apps和YouTube。
Android 手机的无线电类型的值是否始终为 GSM、LTE、CDMA 或 WCDMA?
我正在创建一个使用 Google 地理定位 API 的应用程序,如文档所示 这里。 作为我需要发送到他们的 API 的 POST 请求的一部分,我需要包含移动无线电类型 radioType。这个问题...
如何发出 Google Translate API V3 简单的 HTTP POST 请求?
我知道文档是存在的……它实在是太神秘、太复杂了,典型的过度设计。它必须更简单。 我不想使用第 3 方库...我想要一个漂亮的 vanill...
我需要在日历上创建谷歌日历活动并将其他用户添加为该活动的参与者。目标是将日历事件发送给应用程序用户而不需要
“1 个缓冲区在出列时被释放”Google Depth API 中的错误
我想获取从相机的位置 x 和 y 到所有深度像素的距离。现在。在文档中, getMillimetersDepth() 返回以毫米为单位的深度。我想,这是一样的...
我最近在我的一个系统上将 PHP 更新到了 8.1 版本。我还使用“composer update”命令更新了 Composer 版本 2.6.5 2023-10-06 10:11:52(参见输出:) > 作曲家更新 加载...
如何在flutter中使用Google API而无需身份验证,仅使用api密钥?
如何在flutter中使用Google API而无需身份验证,即仅使用api密钥。 例如: const _myApiKey = '...'; 最终客户端 = Client(); 最终 youTubeApi = YouTubeApi(客户端); 最终搜索...
无法链接“Google Cloud Project”以在 Google Play 商店中访问 API
我遇到一个问题,当我尝试将我的 PlayStore 链接到 Google Cloud 项目时,会显示错误。有 2 个选项: 链接现有项目 - 下拉列表实际上显示了我的云专业...
使用 games_services 插件时出错:未处理的异常:PlatformException(error, 4: 4: , null)
我想在我的 flutter 应用程序中使用 google play 服务,我使用 games_services 插件。我遵循了这篇中等帖子中的所有步骤。但它仍然给了我这个错误。 E/颤振 (276...
如何在 Java 中使用 https 方案设置 Google OAuth2 客户端?
我正在编写一个使用电子表格 API 的应用程序。因为我使用的是敏感的写入范围,所以 OAuth2 重定向 URI 必须使用 https 而不是 http(除非使用 localho...
我可以在不激活免费试用的情况下使用 Google Cloud Vision API 吗?
有没有办法在应用程序中测试 Google Vision API,而无需激活我的免费试用版? 我正在尝试在示例测试应用程序中使用该 API,但如果没有
我正在尝试创建一个简单的网页,从我拥有的谷歌文档加载文本。该页面只会从文档中读取并运行客户端,没有服务器,因为该页面托管在 github 上。没有...
根据google文档,他们提供了以下污染物指数:https://developers.google.com/maps/documentation/air-quality/pollutants 我正在执行以下查询: 发布...
使用 Google Drive Python API 时可以列出文件,但无法从共享云端硬盘下载
我正在尝试编写一些代码来使用服务帐户从共享Google驱动器下载文件;我的代码的当前版本在下面共享。当您...时,代码和服务帐户对我有用
使用google api复制表单并更改linkedSheetId
创建谷歌表单的副本后,是否可以使用谷歌API更改谷歌表单的linkedSheetId,以使表单将结果存储在任意工作表中?
当我复制包含 Web 应用程序的工作表时,Web 应用程序可以自动更新吗
我有一个电子邮件营销活动表,我可以在其中跟踪电子邮件状态(无论其是否打开)。但是当我复制此表时,我将不得不再次部署 web 应用程序并更新 img src 链接。我正在使用
我尝试发布几个范围值以允许我申请一些谷歌服务...... 我尝试使用两个输入字段 我尝试发布几个范围值以允许我申请某些谷歌服务... 我尝试使用两个输入字段 <input type="hidden" name="scope" value="https://www.googleapis.com/auth/calendar" /> <input type="hidden" name="scope" value="https://www.googleapis.com/auth/userinfo.email" /> 并且有一个带有 + 分隔符的输入字段 <input type="hidden" name="scope" value="https://www.googleapis.com/auth/calendar+https://www.googleapis.com/auth/userinfo.email" /> 当我发送只有一个范围的表格时它就起作用了。 否则,使用 sereval 范围值,谷歌会使用此错误描述重定向我: http://localhost:49972/redirect.aspx#error=invalid_request&error_description=OAuth+2+parameters+can+only+have+a+single+value:+scope&error_uri=http://code.google.com/apis/accounts/docs/OAuth2.html 在 google 入门 中,使用 oAuth2 它可以使用两个范围值。 这是我的代码: <form id="form1" method="post" action="https://accounts.google.com/o/oauth2/auth?" > <div> <input type="hidden" name="response_type" value="code" /> <input type="hidden" name="client_id" value="my client id" /> <input type="hidden" name="redirect_uri" value="http://localhost:49972/redirect.aspx" /> <input type="hidden" name="scope" value="https://www.googleapis.com/auth/calendar" /> <input type="hidden" name="scope" value="https://www.googleapis.com/auth/userinfo.email" /> <input type="hidden" name="state" value="/profile" /> <input type="submit" value="go" /> </div> </form> 当您将它们组合到一个字段时,您就走在正确的轨道上 。请求中应该只有一个范围参数,各个值之间用空格分隔。如果您将其放入这样的形式,浏览器将为您负责对空间进行编码。 <input type="hidden" name="scope" value="https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/userinfo.email" /> 除了 Steve Bazyl 的回答。当为同一个 Google 服务应用多个作用域时,作用域的顺序似乎很重要。 F.e 该字符串按预期工作: "https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/drive.metadata.readonly" 虽然这个对我不起作用: "https://www.googleapis.com/auth/drive.metadata.readonly https://www.googleapis.com/auth/drive" 但我在文档中没有找到任何相关信息。 为了清晰起见,您可以将所有范围放入 1 个数组中: const scopes = [ 'openid', 'https://www.googleapis.com/auth/userinfo.profile', 'https://www.googleapis.com/auth/userinfo.email', 'https://www.googleapis.com/auth/gmail.readonly', ] const scope = scopes.join(' ') console.log(scope) // openid https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/gmail.readonly const redirectUri = 'http://localhost:3000' const link = `https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&scope=${scope}&response_type=code&client_id=${GOOGLE.clientId}&redirect_uri=${redirectUri}&state=authGoogle` 对于在omniauth文件中设置正确范围属性有困难的任何人,请尝试在nunosilva的该线程建议的omniauth路径/url中设置范围字符串 https://github.com/zquestz/omniauth-google-oauth2/issues/143
来自 Google Workspace 的用户邮箱使用情况报告
我正在尝试获取基本的电子邮件使用情况报告。我们需要获取用户名及其电子邮箱的大小。下面提供的代码抛出异常 ” 我正在尝试获取基本的电子邮件使用情况报告。我们需要获取用户名及其电子邮箱的大小。下面提供的代码抛出异常 ”https://admin.googleapis.com/admin/directory/v1/users?alt=json 返回“错误请求”。详细信息:“[{'message': '错误请求', 'domain': ' global', 'reason': 'badRequest'}]">**" 就行了 users = service.users().list().execute() 完整代码如下: from __future__ import print_function import os.path import csv import io from google.auth.transport.requests import Request from google.oauth2.credentials import Credentials from google_auth_oauthlib.flow import InstalledAppFlow from googleapiclient.discovery import build # If modifying these scopes, delete the file token.json. #SCOPES = ['https://www.googleapis.com/auth/admin.directory.user.readonly'] SCOPES = ['https://admin.googleapis.com/admin/directory/v1/users'] creds = None # The file token.json stores the user's access and refresh tokens, and is # created automatically when the authorization flow completes for the first # time. if os.path.exists('token.json'): creds = Credentials.from_authorized_user_file('token.json', SCOPES) # If there are no (valid) credentials available, let the user log in. if not creds or not creds.valid: if creds and creds.expired and creds.refresh_token: creds.refresh(Request()) else: flow = InstalledAppFlow.from_client_secrets_file( 'credentials.json', SCOPES) creds = flow.run_local_server(port=0) # Save the credentials for the next run with open('token.json', 'w') as token: token.write(creds.to_json()) service = build('admin', 'directory_v1', credentials=creds) print('Getting users in the domain') users = service.users().list().execute() # Create a dictionary to store the user data. user_data = {} # Iterate over the list of users and get their first name, last name, and mailbox size. for user in users["users"]: user_data[user["primaryEmail"]] = { "firstName": user["name"]["givenName"], "lastName": user["name"]["familyName"], "mailboxSize": user["storage"]["quotaUsage"], } # Open the CSV file for writing. with open("user_data.csv", "w", newline="") as f: writer = csv.writer(f) # Write the header row. writer.writerow(["email", "firstName", "lastName", "mailboxSize"]) # Iterate over the user data and write each user's data to a new row in the CSV file. for email, data in user_data.items(): writer.writerow([email, data["firstName"], data["lastName"], data["mailboxSize"]]) # Close the CSV file. f.close() 凭证正确。测试多次。正如您从示例中看到的,我尝试使用不同的范围。 我在这里做错了什么? 你错过了你的customer='my_customer': from __future__ import print_function import os.path from google.auth.transport.requests import Request from google.oauth2.credentials import Credentials from google_auth_oauthlib.flow import InstalledAppFlow from googleapiclient.discovery import build # If modifying these scopes, delete the file token.json. SCOPES = ['https://www.googleapis.com/auth/admin.directory.user'] USER_TOKEN = "token_create_user.json" CREDENTIALS = 'C:\Development\FreeLance\GoogleSamples\Credentials\Workspace-Installed-TestEverything.json' def main(): """Shows basic usage of the Admin SDK Directory API. Prints the emails and names of the first 10 users in the domain. """ creds = None # The file token.json stores the user's access and refresh tokens, and is # created automatically when the authorization flow completes for the first # time. if os.path.exists(USER_TOKEN): creds = Credentials.from_authorized_user_file(USER_TOKEN, SCOPES) # If there are no (valid) credentials available, let the user log in. if not creds or not creds.valid: if creds and creds.expired and creds.refresh_token: creds.refresh(Request()) else: flow = InstalledAppFlow.from_client_secrets_file( CREDENTIALS, SCOPES) creds = flow.run_local_server(port=0) # Save the credentials for the next run with open(USER_TOKEN, 'w') as token: token.write(creds.to_json()) service = build('admin', 'directory_v1', credentials=creds) # Call the Admin SDK Directory API print('Getting the first 10 users in the domain') results = service.users().list(customer='my_customer', maxResults=10, orderBy='email').execute() users = results.get('users', []) if not users: print('No users in the domain.') else: print('Users:') for user in users: print(u'{0} ({1})'.format(user['primaryEmail'], user['name']['fullName'])) if __name__ == '__main__': main()
为什么只有 5 条最新评论来自 Google 我的商家评论?
我想在网站上显示我的企业的所有评论(谷歌我的企业评论)。但我只能得到最新的 5 条评论。 我也想为此使用下一页令牌,但这里 Nex...
我使用代码获取凭据 静态字符串[]范围= {“https://www.googleapis.com/auth/userinfo.email”}; 私有静态 UserCredentialGenerateCredential() { 用户信用...
如何使用google customsearch API查询高级搜索?
我如何以编程方式使用 Google Python 客户端库使用 Google 自定义搜索 API 搜索引擎进行高级搜索,以便返回基于某些术语的前 n 个链接的列表,并且