Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google api 人员API-超过配额/超过FBS配额限制_Google Api_Google Contacts Api_Google People_Google People Api - Fatal编程技术网

Google api 人员API-超过配额/超过FBS配额限制

Google api 人员API-超过配额/超过FBS配额限制,google-api,google-contacts-api,google-people,google-people-api,Google Api,Google Contacts Api,Google People,Google People Api,google people api页面正确地说明了如何验证和列出10个示例联系人,并且一切工作都非常完美: 我可以完美地进行身份验证并列出10个联系人,但我在尝试创建新联系人时出错 api向我返回以下错误: HttpError: <HttpError 429 when requesting https://people.googleapis.com/v1/people:createContact?alt=json returned "Resource has been exhausted

google people api页面正确地说明了如何验证和列出10个示例联系人,并且一切工作都非常完美:

我可以完美地进行身份验证并列出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.'}]}]">
我完美地改变了范围,甚至在几个月前创建了联系人。 突然一切都停止了,我遇到了麻烦配额超过了并且FBS配额限制超过了

我重播了整个身份验证过程,甚至尝试列出联系人,没有问题,一切都可以完美地工作,而不是创建联系人

一些意见:

  • 我使用的是via jupyter笔记本,我还登录了电子邮件 我想创建联系人
  • 我曾尝试在IDE中运行,但遇到了相同的问题
  • 我用这种方式创建了26888个联系人
  • 这个项目不会出现在Google控制台上,因为我认为 整个项目都通过了文档页面,我相信配额还没有用完,只是因为我可以看到值​​正确地我平均每3秒创建一个联系人,每天创建200个联系人(最多)
  • 我想知道为什么我不能创建更多的联系人,我有很多工作要做,谢谢

    创建联系人的我的代码:

    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()
    

    由于这个问题只发生在创建联系人时,我决定调查联系人数量的限制,我在文档中遇到了25000个限制

    我被迫创建另一封电子邮件来解决这个问题,并将我的容量增加到50000个联系人(同步两封电子邮件)


    他们的错误消息表示问题在配额限制(请求)内,而事实上是电子邮件联系人限制。

    错误429表示您可能违反了配额限制。当你打了太多电话时,你可能会被列入黑名单,过一段时间就会过期。也许你需要增加你的配额限制。如果您有一个G套件帐户,您应该与联系以获得进一步的帮助。我没有G套件帐户标准的关键写入配额应为90/分钟(1.5/秒),可能您的配额降低了?还请注意,读配额与写配额是分开的,因此您可以看到这些值并不意味着写配额没有用完。您应该尝试在console.developers.google.com上查找您的项目,并检查您的配额。如果你找不到你的项目,也许是你用另一个谷歌帐户创建的?我设法在一段时间后解决了它
    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()