google页面正确地说明了如何对10个示例联系人进行身份验证和列出,并且所有操作都很完美:
https://developers.google.com/people/quickstart/python
我可以完全验证和列出10,但我在尝试创建新联系人时出错了。
api将返回以下错误:
HttpError: <HttpError 429 when requesting https://people.googleapis.com/v1/people:createContact?alt=json returned "Resource has been exhausted (e.g. check quota).". Details: "[{'@type': 'type.googleapis.com/google.rpc.QuotaFailure', 'violations': [{'subject': 'QUOTA_EXCEEDED', 'description': 'FBS quota limit exceeded.'}]}]">当我单击https://people.googleapis.com/v1/people:createContact?alt=json时,页面上有以下json:
{
"error": {
"code": 403,
"message": "The request is missing a valid API key.",
"status": "PERMISSION_DENIED"
}
}几个月前,我把望远镜做了很好的改动,甚至建立了联系。突然之间,一切都停止了工作,我遇到了麻烦,QUOTA_EXCEEDED和超过了
我重做了整个认证过程,甚至试图列出联系人,而且没有问题,所有的事情都不太适合创建联系人。
一些意见:
我很想知道为什么我不能创造更多的联系,我有很多工作等待,因为这,谢谢。
我创建联系人的代码:
def main():
creds = None
# The file token.pickle 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.pickle'):
with open('token.pickle', 'rb') as token:
creds = pickle.load(token)
# 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.pickle', 'wb') as token:
pickle.dump(creds, token)
service = build('people', 'v1', credentials=creds)
#----------------creatingc contacts----------------------
print('trying')
for i in df_banco_linhas[:2]:
if i[1] not in df_csv_linhas:
time.sleep(3)
service.people().createContact( body={
"names": [
{
"givenName": i[0]
}
],
"phoneNumbers": [
{
'value': i[1]
}
]
}).execute()
print('create: ' + i[0])
time.sleep(3)
else:
print('NO')
if __name__ == '__main__':
main()发布于 2020-05-28 00:47:23
由于问题只发生在创建联系人时,我决定调查联系人数量的限制,并且在文档中遇到了25000的限制。
我被迫创建另一封电子邮件来解决问题,并将我的容量增加到50000人(同步两封电子邮件)。
他们的错误信息表明问题在配额限制(请求)中,而实际上是通过电子邮件联系的限制。
发布于 2022-05-06 23:27:59
我得到了相同的限额超出错误(“超过FBS配额限制”)。因为不同的原因。我为Organization.jobDescription字段提供的值太长了。
也许这个特定的配额限制会在一些非费率限制被违反时触发,比如电子邮件总数或字段的最大长度。
这可能不是故意的,因为这种违规不符合429状态代码,并且控制台中的人员API中没有列出这个限制。
https://stackoverflow.com/questions/61895430
复制相似问题