|
3552
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp# Lukas/Stefka 121 • in 2h 4 m100% <478DEV (docker)DOCKERO &1DEV (docker)882APP (-zsh)Jiminny-worker-processing-4:jiminny-worker-processing-4_00:jiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedstoppedworker-crm-update:worker-crm-update_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker:worker_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00:stoppedworker-audio:worker-audio_00: stoppedworker-emails:worker-emails_00:stoppedartisan-schedule:artisan-schedule_00: stoppedworker-es-update:worker-es-update_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00: startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00: startedroot@docker_lamp_1:/home/jiminny# php artisan jiminny:debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# php artisan jiminny: debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# ]-zsh• $4screenpipe"•$5-zshThu 7 May 15:26:36T81₴6DEV...
|
iTerm2
|
NULL
|
NULL
|
3552
|
|
3553
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp# Lukas/Stefka 121 • in 2h 4m100% <478DEV (docker)DOCKERO &1DEV (docker)882APP (-zsh)Jiminny-worker-processing-4:jiminny-worker-processing-4_00:jiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedstoppedworker-crm-update:worker-crm-update_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker:worker_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00:stoppedworker-audio:worker-audio_00: stoppedworker-emails:worker-emails_00:stoppedartisan-schedule:artisan-schedule_00: stoppedworker-es-update:worker-es-update_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00: startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00: startedroot@docker_lamp_1:/home/jiminny# php artisan jiminny:debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# php artisan jiminny: debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# ]-zsh• $4screenpipe"•$5-zshThu 7 May 15:26:39T81₴6DEV...
|
iTerm2
|
NULL
|
NULL
|
3553
|
|
3554
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp# Lukas/Stefka 121 • in 2h 4 m100% <478DEV (docker)DOCKERO &1DEV (docker)882APP (-zsh)Jiminny-worker-processing-4:jiminny-worker-processing-4_00:jiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedstoppedworker-crm-update:worker-crm-update_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker:worker_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00:stoppedworker-audio:worker-audio_00: stoppedworker-emails:worker-emails_00:stoppedartisan-schedule:artisan-schedule_00: stoppedworker-es-update:worker-es-update_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00: startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00: startedroot@docker_lamp_1:/home/jiminny# php artisan jiminny:debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# php artisan jiminny: debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# ]-zsh• $4screenpipe"•$5-zshThu 7 May 15:26:47T81₴6DEV...
|
iTerm2
|
NULL
|
NULL
|
3554
|
|
3555
|
*PostmancaltVIewWindowHubSpot rate limit implement *PostmancaltVIewWindowHubSpot rate limit implementation strategymulaple Newman processes run concurrenty.Option 4: Postman Performance Testing (newer feature)Ir your rostman version has it, collection Kunner has a Pertormance tad nowalonesiee runcuonal. luruns une conecuon wu conncuradie vintuar usersinparallel — set 20 virtual users, 30-second duration, and you 'll saturate the burstwindow without any external tooling, Path is Run collection - Performance →cont oureYou probably don t actually need to hit itWorth pausing here: the goal or this exercise is to veriry your limiter handles 429Sconecuy, nent. rou can do unat wiun a mock witnout durie real quora// In your test, take a 429 responseSmockResnonse = new Guzz lehttn Psrz Resnonse429.'Retrv-Afterl => 'g'.json_encode(I'status' => 'error','message' => 'You have reached your secondly limit.'.'error voe => "RAIE LIMIT".'nolicvName =>"SECONDLY".'correlationid' => 'test-123',That gives you the exact shape HubSpot returns, and you can unit-test:• Parsing policvName correctlv• Routing to the right queue's backoff• Honoring Retrv-After• Not double-counting the failed call against the bucketPostman's valute is regllv one-ofl eynloration ("does this header exist? what does a429 body look like?"). For wiring up the limiter mocked tests are faster and don'tKeep going in Claude CodeSwitch to Claude Code and let Claude work directiv in vour.Write a message.Opus 4. AdaptiveXx Hubspot v• SearchYour team is now on the Free plan with 1 admin. You retain editing access and other members are read-only. View team permissions to see who can edit, or upgrade to restore collaborationV COLLECTIONS>post crealepost Filter. Sort. and Search CRM Obiectss9: successtul operationcg. An error occurredeRM owners› CRM Pioelines> DealsEngagements> O OLD ENGAGEMENTSGET list meetinasPOST search modified companiesPOST search tasksGET read call> POST search callscatlner nalliePOST meetinas scheduledGET get meetingPOST det link to task> Hubspotv Iteration run HSGET Read Copy5e. An error occurred.eg. successful oberationv Iteration run Search HSpost search contact by email Coov>Journal & webhoooks vAl©Authl› Properties> RESSARCH• CCADCHIPOST search contact by phonePOST search contact by emailPOST search meetinaseost cearch notes> POST Search calls v3POST Search related meetings v3Tickotsv UsefulCaMiDANMeNre) spfcs>FLOWS§ Connect Git E Console E TermGET Rea •GET Rea •GET readteration run Search HS (#))u Iteration run Search HS • 20 VUs • May 07, 2026 15:24:13 (1 min) • Fixed profileSummaryTotal requests sent ©Requests/second ©Avg. response time ©P90 ©P95 ©74143120.90156 ms187 ms210 ms% 1008015-24-18115-24•2015-24•26|15-24-42Dorformonso dotolle fortotol durotinnPOST search contact by email Copy7143120.900.000.00• IterationIterationlPOST seatP99 ©305 msError % ©0.00Failure % ©0,00"Lukas sterka 121• In zn 4mm lteration)D IteratNo environmentSharePeak CPU % ©Peak Memory % ©98.8 %1913 %Filter bv reauestsAva. response266 ms 140 req/s100% 2Inu / May 10.20.41UparadeVAIIAll variablesNo environment selected, seled enulotmeaGlobalstokenCKPur5PqMxIZ@IN@Mi8kOfbaseUrlhttps://api.hubapi.comdev-tokenCLLm5NnQMxIRQINQMI8kQ.• Local VaultStore your APl secrets locally in vault. Set up vault15•24•5415.25.0015-25-12- Requests/second - Ava. response - Error % - Virtualusers *• CPU% *** Memory ⅞Min (ms)Max (ms)305Giobals Vault Tooks •- m=m...
|
iTerm2
|
NULL
|
NULL
|
3555
|
|
3556
|
*PostmancaltVIewWindovHubSpot rate limit implement *PostmancaltVIewWindovHubSpot rate limit implementation strategymulaple Newman processes run concurrenty.Option 4: Postman Performance Testing newer feature)Ir your rostman version has it, collection Kunner has a Pertormance tad nowalonesiee runcuonal. luruns une conecuon wu conncuradie vintuar usersinparallel — set 20 virtual users, 30-second duration, and you'll saturate the burstwindow without any external tooling, Path is Run collection - Performance →cont oureYou probably don t actually need to hit itWorth pausing here: the goal or this exercise is to veriy your limiter handles 429Sconecuy, nent. rou can do unat wiun a mock witnout durie real quora// In your test, take a 429 responseSmockResnonse = new Guzz lehttn Psrz Resnonse429'Retrv-Afterl => 'g'.json_encode(I'status' => 'error','message' => 'You have reached your secondly limit.'.'error voe => "RAIE LIMII'.oolicvName' =>"SECONDLY",'correlationid' => 'test-123',*x Hubspot v• SearchYour team is now on the Free plan with 1 admin. You retain editing access and other members are read-only. View team permissions to see who can edit, or upgrade to restore collaborationGET readGET Get ErGET Read CoIteration run Search HSOverview [AUTH_TOKEN]+*..That gives you the exact shape HubSpot returns, and you can unit-test:• Parsing policvName correctlv• Routing to the right queue's backoff• Honoring Retrv-After• Not double-counting the failed call against the bucketPostman's valute is regllv one-ofl eynloration ("does this header exist? what does a429 body look like?"). For wiring up the limiter, mocked tests are faster and don'tKeep going in Claude CodeSwitch to Claude Code and let Claude work directiv in vour.Write a message.Opus 4. AdaptiveV COLLECTIONS>post crealepost Filter. Sort. and Search CRM Obiectss9: successtul operationcg. An error occurredeRM owners› CRM Pioelines› DealsEngagements> O OLD ENGAGEMENTSGET list meetinasPOST search tasksGET read call> POST search callscatlner nalliePOST meetinas scheduledGET get meetingPOST det link to task> Hubspot~ Iteratign run HSGET Read Copy5e. An error occurred.eg. successful oberationIteration run Search HSPOST search contact by email Copyloural 8 wohhaanke w/l©Authl› Properties> RESSARCH• CCADCHIPOST search contact by phonePOST search contact by emailPOST search meetinaspost search notes• PoST Search calls v3POST Search related meetings v3• Tickotev UsefulCaMiDANMeNre) spfcs>FLOWS§ Connect Git E Console E TermIteration run Search HSỞ You Z 1 all1 g 03:15 PM, May 07, 2026Help people understand your collection by adding a description. &* Write with Al40"Lukas sterka 121• In zn 4m100% L2Inu / May 10.20.00UparademlterationNo environmentvVAIlPublish docs RunAll variablesE EnvironmentNo environment selected. Select environmeatc Iteration run Search HSNo variables defined in this collection. AdeG GiobalstokenCкPuгорaмxiz@lnemiokoL.baseUrlhttps:/api.hubapi.comdev-tokencLLmoNnomxir@inemioko.• Local VaultStore vour APl secrets locally in vault. Set up vaulGlobals Vault Tools?00O...
|
iTerm2
|
NULL
|
NULL
|
3556
|
|
3557
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp# Lukas/Stefka 121 • in 2h 4 m100% <478DEV (docker)DOCKERO &1DEV (docker)882APP (-zsh)Jiminny-worker-processing-4:jiminny-worker-processing-4_00:jiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedstoppedworker-crm-update:worker-crm-update_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker:worker_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00:stoppedworker-audio:worker-audio_00: stoppedworker-emails:worker-emails_00:stoppedartisan-schedule:artisan-schedule_00: stoppedworker-es-update:worker-es-update_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00: startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00: startedroot@docker_lamp_1:/home/jiminny# php artisan jiminny:debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# php artisan jiminny: debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# ]-zsh• $4screenpipe"•$5-zshThu 7 May 15:26:50T81₴6DEV...
|
iTerm2
|
NULL
|
NULL
|
3557
|
|
3558
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp# Lukas/Stefka 121 • in 2h 4 m100% <478DEV (docker)DOCKERO &1DEV (docker)882APP (-zsh)Jiminny-worker-processing-4:jiminny-worker-processing-4_00:jiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedstoppedworker-crm-update:worker-crm-update_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker:worker_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00:stoppedworker-audio:worker-audio_00: stoppedworker-emails:worker-emails_00:stoppedartisan-schedule:artisan-schedule_00: stoppedworker-es-update:worker-es-update_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00: startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00: startedroot@docker_lamp_1:/home/jiminny# php artisan jiminny:debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# php artisan jiminny: debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# ]-zsh• $4screenpipe"•$5-zshThu 7 May 15:26:56T81₴6DEV...
|
iTerm2
|
NULL
|
NULL
|
3558
|
|
3559
|
*PostmancaltVIewWindowHubSpot rate limit implement *PostmancaltVIewWindowHubSpot rate limit implementation strategymulaple Newman processes run concurrenty.Option 4: Postman Performance Testing (newer feature)Ir your rostman version has it, collection Kunner has a Pertormance tad nowalonesiee runcuonal. luruns une conecuon wu conncuradie vintuar usersinparallel — set 20 virtual users, 30-second duration, and you 'll saturate the burstwindow without any external tooling, Path is Run collection - Performance →cont oureYou probably don t actually need to hit itWorth pausing here: the goal of this exercise is to veriy your limiter handles 429Sconecuy, nent. rou can do unat wiun a mock witnout durie real quora// In your test, take a 429 responseSmockResnonse = new Guzz lehttn Psrz Resnonse429'Retrv-Afterl => 'g'.json_encode(I'status' => 'error','message' => 'You have reached your secondly limit.'.'error voe => "RAIE LIMIT".nolicvName' =>"SECONDLY".'correlationid' => 'test-123',40"Lukas sterka 121• In zn 4m100% L2Inu / May 10.20.00Uparade*x Hubspot v• SearchYour team is now on the Free plan with 1 admin. You retain editing access and other members are read-only. View team permissions to see who can edit, or upgrade to restore collaborationGET Get Er•Iteration run HSOverview Authorization Scriots VariablesThis authorization method will be used for every reguest in this collection. You canovemoe tnis by soeclying one in the reauestAuth TypeBearer TokenLearn more about Bearer Token authorizationTokenIterationIterationIterationNo environmentvPublish docs RunThat gives you the exact shape HubSpot returns, and you can unit-test:• Parsing policvName correctlv• Routing to the right queue's backoff• Honoring Retrv-After• Not double-counting the failed call against the bucketPostman's valute is regllv one-ofl eynloration ("does this header exist? what does a429 body look like?"). For wiring up the limiter, mocked tests are faster and don'tKeep going in Claude CodeSwitch to Claude Code and let Claude work directiv in vour.Write a message.Opus 4. AdaptiveV COLLECTIONS>post crealepost Filter. Sort. and Search CRM Obiectss9: successtul operationcg. An error occurredeRM owners› CRM Pioelines> DealsEngagements> O OLD ENGAGEMENTSGET list meetinasPOST search modified companiesPOST search tasksGET read call> POST search callscatlner nalliePOST meetinas scheduledGET get meetingPOST det link to task> HubspotIteration run HSGET Read Copyn. An error occurred.eg. successtul oberationv Iteration run Search Hspost search contact by email Coov>Journal & webhoooks vAl©Authl› Properties> RESSARCH• CCADCHIPOST search contact by phonePOST search contact by emailPOST search meetinaseost cearch notes> POST Search calls v3POST Search related meetings v3Tickotsv UsefulCaMiDANMeNre) spfcs>FLOWS§ Connect Git E Console E TermTAllAll variablesE EnvironmentNo environment selected. Select envionmeatc Iteration run HSNo variables defined in this collection. AddG GiobalstokenCкPuгорaмxiz@lnemiokoL.baseUrlhttps:/api.hubapi.comdev-tokencLLmoNnomxir@inemioko.• Local VaultStore vour APl secrets locally in vault. Set up vaulGlobals Vault Tools?000...
|
iTerm2
|
NULL
|
NULL
|
3559
|
|
3560
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp# Lukas/Stefka 121 • in 2h 3 mA100% <478Thu 7 May 15:27:04DEV (docker)DOCKERDEV (docker)882APP (-zsh)Jiminny-worker-processing-4:jiminny-worker-processing-4_00:jiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedstoppedworker-crm-update:worker-crm-update_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker:worker_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00:stoppedworker-audio:worker-audio_00: stoppedworker-emails:worker-emails_00:stoppedartisan-schedule:artisan-schedule_00: stoppedworker-es-update:worker-es-update_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00: startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00: startedroot@docker_lamp_1:/home/jiminny# php artisan jiminny:debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# php artisan jiminny: debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# ]-zsh• $4screenpipe*•$5-zsh₴6DEV...
|
iTerm2
|
NULL
|
NULL
|
3560
|
|
3561
|
*PostmancaltVIewWindowHubSpot rate limit implement *PostmancaltVIewWindowHubSpot rate limit implementation strategymulaple Newman processes run concurrenty.Option 4: Postman Performance Testing (newer feature)Ir your rostman version has it, collection Kunner has a Pertormance tad nowalonesiee runcuonal. luruns une conecuon wu conncuradie vintuar usersinparallel — set 20 virtual users, 30-second duration, and you 'll saturate the burstwindow without any external tooling, Path is Run collection - Performance →cont oureYou probably don t actually need to hit itWorth pausing here: the goal or this exercise is to veriy your limiter handles 429Sconecuy, nent. rou can do unat wiun a mock witnout durie real quora// In your test, take a 429 responseSmockResnonse = new Guzz lehttn Psrz Resnonse429.'Retrv-Afterl => 'g'.json_encode(I'status' => 'error','message' => 'You have reached your secondly limit.'.'error voe => "RAIE LIMII'.'nolicvName =>"SECONDLY".'correlationid' => 'test-123',That gives you the exact shape HubSpot returns, and you can unit-test:• Parsing policvName correctlv• Routing to the right queue's backoff• Honoring Retrv-After• Not double-counting the failed call against the bucketPostman's valute is regllv one-ofl eynloration ("does this header exist? what does a429 body look like?"). For wiring up the limiter, mocked tests are faster and don'tKeep going in Claude CodeSwitch to Claude Code and let Claude work directiv in vour.Write a message.Xx Hubspot v• SearchYour team is now on the Free plan with 1 admin. You retain editing access and other members are read-only. View team permissions to see who can edit, or upgrade to restore collaborationGET ReauGET Get Er•Iteration run HSOverview [AUTH_TOKEN] triagered for this collection via Collection Runner and Postman CILI.Last 100 runs vRun by vRun status vSourcevSourcMav 07 2026 02.12.26RunnerỞ May 07, 2026 03:12:40kunnel• May 07, 2026 03:11:58Runne• May 07, 2026 03:11:15Runner• May 07, 2026 03:10:24RunnerGET Read Co22c 22mgZ1s 440ms1s 478ms2s 78ms20c 152mcIterationIterationn40IterationPublish docsOpus 4. AdaptiveV COLLECTIONS>post crealepOst Filter. Sort. and Search CRM Obiectss9: successtul operationcg. An error occurredeRM owners› CRM Pioelines> DealsEngagements> 0 OLD ENGAGEMENTSGET list meetinasPOST search modified companiesPOST search tasksGET read call> POST search callscatlner nalliePOST meetinas scheduledGET get meetingPOST det link to task> HubspotIteration run HSGET Read Copyn. An error occurred.eg. successtul oberationv Iteration run Search Hspost search contact by email Coov>Journal & webhoooks vAl©Authl› Properties> RESSARCH• CCADCHIPOST search contact by phonePOST search contact by emailPOST search meetinaseost cearch notes> POST Search calls v3POST Search related meetings v3Tickotsv UsefulCaMiDANMeNre) spfcs>FLOWS§ Connect Git E Console E TermAll tostPassedSkippecAvg. Kesp. lime105 mc193 ms197 ms149 ms151 ms"Lukas sterka 121• In 2n 3m100% L2Inu / May 10.2/:04UparadeNo environmentVAIlAll variablesE EnvironmentNo environment selected. Select environmemc Iteration run HSNo variables defined in this collection. AdeG GiobalstokenCкPuгорaмxiz@lnemiokoL.baseUrldev-tokencLLmoNnomxir@inemioko.• Local VaultStore vour APl secrets locally in vault. Set up vault...
|
iTerm2
|
NULL
|
NULL
|
3561
|
|
3562
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp# Lukas/Stefka 121 • in 2h 3 mA100% <478Thu 7 May 15:27:07DEV (docker)DOCKERDEV (docker)882APP (-zsh)Jiminny-worker-processing-4:jiminny-worker-processing-4_00:jiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedstoppedworker-crm-update:worker-crm-update_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker:worker_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00:stoppedworker-audio:worker-audio_00: stoppedworker-emails:worker-emails_00:stoppedartisan-schedule:artisan-schedule_00: stoppedworker-es-update:worker-es-update_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00: startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00: startedroot@docker_lamp_1:/home/jiminny# php artisan jiminny:debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# php artisan jiminny: debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# ]-zsh• $4screenpipe*•$5-zsh₴6DEV...
|
iTerm2
|
NULL
|
NULL
|
3562
|
|
3563
|
*PostmancaltVIewWindowHubSpot rate limit implement *PostmancaltVIewWindowHubSpot rate limit implementation strategymuluple Newman processes run concurrenty.Option 4: Postman Performance Testing (newer feature)Ir your rostman version has it, collection Kunner has a Pertormance tad nowalonesiee runcuonal. luruns une conecuon wu conncuradie vntuar usersinparallel — set 20 virtual users, 30-second duration, and you'll saturate the burstwindow without any external tooling, Path is Run collection - Performance →contoureYou probably don t actually need to hit itWorth pausing here: the goal or this exercise is to veriy your limiter handles 429Sconecuy, nent. rou can do unat wiun a mock witnout durie real quora// In your test, take a 429 responseSmockResnonse = new Guzz lehttn Psrz Resnonse!429'Retrv-After' => 'g'.json encodeL'status' => 'error','message' => 'You have reached your secondly limit.'.'error voe => "RAIE LIMIT".oolicvName' =>"SECONDLY,'correlationid => 'test-123',That gives you the exact shape HubSpot returns, and you can unit-test:• Parsing policvName correctlv• Routing to the right queue's backoff• Honoring Retrv-After• Not double-counting the failed call against the bucketPostman's valute is regllv one-ofl eynloration ("does this header exist? what does a429 body look like?"). For wiring up the limiter, mocked tests are faster and don'tKeep going in Claude CodeSwitch to Claude Code and let Claude work directiv in vour.Write a message.Xx Hubspot v• SearchYour team is now on the Free plan with 1 admin. You retain editing access and other members are read-only. View team permissions to see who can edit, or upgrade to restore collaborationGET next •POST seatRun orderRun SequenceGET readDeselect AllSelect All ResetGET Read copyOpus 4. AdaptiveV COLLECTIONS> COMPAREContacts• CKM ObIeCtSv crm/vslobiects/obiect Twoe,>U baich(object id)associations/to Obiect lypeãe. An error occurredea. successful oberation>bEL Archive> PATCH Update> POST Createy post Filter, sort, and search crM Obiectsse. successful operationge An error occurred• CRM Owners> CRM Pipelines> Deals> OLD ENGAGEMENTSGet list meetingsPOST search modified companieswrcosrehthehGET read call>POST search callsGet list callsPost meetings scheduledGET get meetingposT get link to task> Post Create Contact with Association>HubspotIteration run HScat Read Copy5 An error occurred.ag. successful operationv Iteration run Search HSPost search contact by emall CopyCaMiDANMeNre) spfcs>FLOWS§ Connect Git E Console E Term©Iteration | e l l RX st sear •FunctionalPerformancechoose how to run vour collection• Run manually ©• Schedule runs ©) Automate runs via CURun configurationIterations GDelay OTest data file ©Select FileAdvanced Settinas(v Persist responses for a session O• Turn off logs during run ©(v) Stop run if an error occursKeep variable values• Run collection without using stored cookiesSave cookies after collection run ©m lteration)40"Lukas sterka 121• In 2n 3mNo environment v100% L2Inu / May 10.2/.00UparadeVAIIAll variablesE EnvironmentNo environment celected Select environmentGlobalstokenCKPur5PqMxIZ@INOMi8kOfbaseUrlhttps://api.hubapi.comCeweToKenlCLLm5NnQMxIRQINQMI8kQ• Local VaultStore your APl secrets locally in vault. Set up vaultGlobals Vault Tools?000...
|
iTerm2
|
NULL
|
NULL
|
3563
|
|
3564
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp# Lukas/Stefka 121 • in 2h 3 mA100% <478Thu 7 May 15:27:10DEV (docker)DOCKERO &1DEV (docker)882APP (-zsh)Jiminny-worker-processing-4:jiminny-worker-processing-4_00:jiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedstoppedworker-crm-update:worker-crm-update_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker:worker_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00:stoppedworker-audio:worker-audio_00: stoppedworker-emails:worker-emails_00:stoppedartisan-schedule:artisan-schedule_00: stoppedworker-es-update:worker-es-update_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00: startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00: startedroot@docker_lamp_1:/home/jiminny# php artisan jiminny:debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# php artisan jiminny: debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# ]-zsh• $4screenpipe*•$5-zsh₴6DEV...
|
iTerm2
|
NULL
|
NULL
|
3564
|
|
3565
|
PostmancaltVIewWindowHubSpot rate limit implement PostmancaltVIewWindowHubSpot rate limit implementation strategymulaple Newman processes run concurrenty.Option 4: Postman Performance Testing (newer feature)Ir your rostman version has it, collection Kunner has a Pertormance tad nowalonesiee runcuonal. luruns une conecuon wu conncuradie vntuar usersinparallel — set 20 virtual users, 30-second duration, and you'll saturate the burstwindow without any external tooling, Path is Run collection - Performance →contoureYou probably don t actually need to hit itWorth pausing here: the goal or this exercise is to veriy your limiter handles 429Sconecuy, nent. rou can do unat wiun a mock witnout durie real quora// In your test, take a 429 responseSmockResnonse = new Guzz lehttn Psrz Resnonse!429.'Retrv-Afterl => 'g'.json encodeL'status' => 'error','message' => 'You have reached your secondly limit.'.'errorType' => 'RATE LIMIT'.oolicvName' =>"SECONDLY,'correlationid => 'test-123',That gives you the exact shape HubSpot returns, and you can unit-test:• Parsing policvName correctlv• Routing to the right queue's backoff• Honoring Retrv-After• Not double-counting the failed call against the bucketPostman's valute is regllv one-ofl eynloration ("does this header exist? what does al429 body look like?"). For wiring up the limiter, mocked tests are faster and don'tKeep going in Claude CodeSwitch to Claude Code and let Claude work directiv in vour.Write a message…Opus 4. AdaptiveXx Hubspot v• SearchYour team is now on the Free plan with 1 admin. You retain editing access and other members are read-only. View team permissions to see who can edit, or upgrade to restore collaborationGET next •POST seatRun orderRun SequenceGET readDeselect AllSelect All ResetGET Read copy40"Lukas sterka 121• In 2n 3mM IterationNo environmentvCOLLECTIONS> Associations V4• CMS - URL Redirects APl Collection• Companies• COMPARE› Contactsv CRM Obiectsv crm/v3/objects/{object Type}>u batchD (object ld)› associations<to Obiect TypeGET Read5g. An error occurredca. successful onerationPaTCH Uindate>GET ListPOST Createy Post Filter, Sort, and Search CRM Obiectsca. succeccful onerationeg- An error occurred› CRM Owners• CRM Pioelines• Dealsv EngagementsIM OID ENGAGEMENTSGet list meetingsPoST soarch modified comnaniecPosT search tasksGET road call>PoST search callsGeT list callsPOST meetings scheduledGET get meetingPOST aet link to task> POSt Create Contact with Association> Hubspotv Iteration run HSGET Read Copyca. An error occurred.CaMiDANMeNre) spfcs>FLOWS§ Connect Git E Console Terr0 IterationRunneIteraFunctionalPerformancechoose how to run vour collection• Run manually ©• Schedule runs ©) Automate runs via CURun configurationIterations GDelay OTest data file ©Select FileAdvanced Settinas(v Persist responses for a session O• Turn off logs during run ©(v) Stop run if an error occursKeep variable values• Run collection without using stored cookiesSave cookies after collection run ©100% L2Inu / May 10.2/:10UparadeVAIIAll variablesE EnvironmentNo environment celected Select environmentGlobalstokenCKPur5PqMxIZ@INOMi8kOfbaseUrlhttps://api.hubapi.comCeweToKenlCLLm5NnQMxIRQINQMI8kQ.• Local VaultStore your APl secrets locally in vault. Set up vaultGlobals Vault Tools?00O...
|
iTerm2
|
NULL
|
NULL
|
3565
|
|
3566
|
PostmancaltVIewWindowHubSpot rate limit implement PostmancaltVIewWindowHubSpot rate limit implementation strategymuluple Newman processes run concurrenty.Option 4: Postman Performance Testing (newer feature)Ir your rostman version has it, collection Kunner has a Pertormance tad nowalonesiee runcuonal. luruns une conecuon wu conncuradie vntuar usersinparallel — set 20 virtual users, 30-second duration, and you'll saturate the burstwindow without any external tooling, Path is Run collection - Performance →contoureYou probably don t actually need to hit itWorth pausing here: the goal or this exercise is to veriy your limiter handles 429Sconecuy, nent. rou can do unat wiun a mock witnout durie real quora// In your test, take a 429 responseSmockResnonse = new Guzz lehttn Psrz Resnonse!429'Retrv-After' => 'g'.json encodeL'status' => 'error','message' => 'You have reached your secondly limit.'.'errorType' => 'RATE LIMIT'.oolicvName' =>"SECONDLY,'correlationid => 'test-123',That gives you the exact shape HubSpot returns, and you can unit-test:• Parsing policvName correctlv• Routing to the right queue's backoff• Honoring Retrv-After• Not double-counting the failed call against the bucketPostman's valute is regllv one-ofl eynloration ("does this header exist? what does al429 body look like?"). For wiring up the limiter, mocked tests are faster and don'tKeep going in Claude CodeSwitch to Claude Code and let Claude work directiv in vour.Write a message…Opus 4. Adaptive*x Hubspot v• SearchYour team is now on the Free plan with 1 admin. You retain editing access and other members are read-only. View team permissions to see who can edit, or upgrade to restore collaborationGET nexto • POST searc • POST Read •GET ReauGET readGET Get ErGET Read CoRun orderRun SequenceDeselect AllSelect All ResetGET Read copyIteration40"Lukas sterka 121• In 2n 3mNo environmentvCOLLECTIONS> Associations V4• CMS - URL Redirects APl Collection• Companies• COMPARE› Contactsv CRM Obiectsv crm/v3/objects/{object Type}>u batchD (object ld)› associations<to Obiect TypeGET Read5g. An error occurredca. successful onerationPaTCH Uindate>GET ListPOST Createy Post Filter, Sort, and Search CRM Obiectsca. succeccful onerationeg. An error occurred› CRM Owners• CRM Pioelines• Dealsv EngagementsIM OID ENGAGEMENTSGet list meetingsPoST soarch modified comnaniecPosT search tasksGET road call>PoST search callsGeT list callsPOST meetings scheduledGET get meetingPOST aet link to task> pOSt Create Contact with Association> Hubspotv Iteration run HSGET Read Copyca. An error occurred.CaMiDANMeNre) spfcs>FLOWS§ Connect Git E Console TerrGET httos:IterationD RunnerFunctionalPerformancechoose how to run vour collection• Run manually ©• Schedule runs ©) Automate runs via CURun configurationIterations GDelay OTest data file ©Select FileAdvanced Settinas(v Persist responses for a session O• Turn off logs during run ©(v) Stop run if an error occursKeep variable values• Run collection without using stored cookiesSave cookies after collection run ©100% L2Inu / May 10.2/-14UparadeVAIIAll variablesE EnvironmentNo environment celected Select environmentGlobalstokenCKPur5PqMxIZ@INOMi8kOfbaseUrlhttps://api.hubapi.comCeweToKenlCLLm5NnQMxIRQINQMI8kQ.• Local VaultStore your APl secrets locally in vault. Set up vaultGlobals Vault Tools?00O...
|
iTerm2
|
NULL
|
NULL
|
3566
|
|
3567
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp# Lukas/Stefka 121 • in 2h 3 mA100% <478Thu 7 May 15:27:14DEV (docker)DOCKERDEV (docker)882APP (-zsh)Jiminny-worker-processing-4:jiminny-worker-processing-4_00:jiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedstoppedworker-crm-update:worker-crm-update_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker:worker_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00:stoppedworker-audio:worker-audio_00: stoppedworker-emails:worker-emails_00:stoppedartisan-schedule:artisan-schedule_00: stoppedworker-es-update:worker-es-update_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00: startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00: startedroot@docker_lamp_1:/home/jiminny# php artisan jiminny:debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# php artisan jiminny: debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# ]-zsh• $4screenpipe*•$5-zsh₴6DEV...
|
iTerm2
|
NULL
|
NULL
|
3567
|
|
3568
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp# Lukas/Stefka 121 • in 2h 3 mA100% <478Thu 7 May 15:27:16DEV (docker)DOCKERDEV (docker)882APP (-zsh)Jiminny-worker-processing-4:jiminny-worker-processing-4_00:jiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedstoppedworker-crm-update:worker-crm-update_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker:worker_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00:stoppedworker-audio:worker-audio_00: stoppedworker-emails:worker-emails_00:stoppedartisan-schedule:artisan-schedule_00: stoppedworker-es-update:worker-es-update_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00: startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00: startedroot@docker_lamp_1:/home/jiminny# php artisan jiminny:debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# php artisan jiminny: debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# ]-zsh• $4screenpipe*•$5-zsh₴6DEV...
|
iTerm2
|
NULL
|
NULL
|
3568
|
|
3569
|
PostmancaltVIewWindowHubSpot rate limit implement PostmancaltVIewWindowHubSpot rate limit implementation strategymuluple Newman processes run concurrenty.Option 4: Postman Performance Testing newer feature)Ir your rostman version has it, collection Kunner has a Pertormance tad nowalonesiee runcuonal. luruns une conecuon wu conncuradie vntuar usersinparallel — set 20 virtual users, 30-second duration, and you'll saturate the burstwindow without any external tooling, Path is Run collection - Performance →contoureYou probably don t actually need to hit itWorth pausing here: the goal or this exercise is to veriy your limiter handles 429Sconecuy, nent. rou can do unat wiun a mock witnout durie real quora// In your test, take a 429 responseSmockResnonse = new Guzz lehttn Psrz Resnonse!429'Retrv-After' => 'g'.json encodeL'status' => 'error','message' => 'You have reached your secondly limit.'.'errorType' => 'RATE LIMIT'.oolicvName' =>"SECONDLY,'correlationid' => 'test-123',That gives you the exact shape HubSpot returns, and you can unit-test:• Parsing policvName correctlv• Routing to the right queue's backoff• Honoring Retrv-After• Not double-counting the failed call against the bucketPostman's valute is regllv one-ofl eynloration ("does this header exist? what does al429 body look like?"). For wiring up the limiter, mocked tests are faster and don'tKeep going in Claude CodeSwitch to Claude Code and let Claude work directiv in vour.Write a message…Opus 4. AdaptiveXx Hubspot v• SearchYour team is now on the Free plan with 1 admin. You retain editing access and other members are read-only. View team permissions to see who can edit, or upgrade to restore collaborationGET nexto • POST searc • POST Read •Run orderRun Sequence• geT Read CopyGET readGET Get ErGET Read CoDeselect AllSelect All Reset40"Lukas sterka 121• In 2n 3mIterationNo environmentvCOLLECTIONS> Associations V4• CMS - URL Redirects APl Collection• Companies• COMPARE› Contactsv CRM Obiectsv crm/v3/objects/{object Type}>u batchD (object ld)› associations<to Obiect TypeGET Read5g. An error occurredca. successful onerationPaTCH Uindate>GET ListPOST Createy Post Filter, Sort, and Search CRM Obiectsca. succeccful onerationeg. An error occurred› CRM Owners• CRM Pioelines• Dealsv EngagementsIM OID ENGAGEMENTSGet list meetingsPoST soarch modified comnaniecPosT search tasksGET road call>PoST search callsGeT list callsPOST meetings scheduledGET get meetingPOST aet link to task> POSt Create Contact with Association> Hubspotv Iteration run HSGET Read Copyca. An error occurred.CaMiDANMeNre) spfcs>FLOWS§ Connect Git E Console TerrIterationD RunnerFunctionalPerformancechoose how to run vour pertormance test• In the app• Via the CLIContigure CLi command to run on your build pipelineSet up your performance testLoad profile ©Virtual users ©Fixed20 Mule20 virtual users run for 10 minutes, each executina all requests sequentiallv.Data tile GSelect file>Pass test if...©100% L2Inu / May 10.2/:10UparadeVAIIAll variablesE EnvironmentNo environment selected, seled enulommeaGlobalstokenCKPur5PqMxIZ@INOMi8kOfbaseUrlhttps://api.hubapi.comdev-tokenCLLm5NnQMxIRQINQMI8kQ.• Local VaultStore your APl secrets locally in vault. Set up vaultGlobals Vault Tools?00O...
|
iTerm2
|
NULL
|
NULL
|
3569
|
|
3570
|
PostmancaltVIewWindowHubSpot rate limit implement PostmancaltVIewWindowHubSpot rate limit implementation strategymuluple Newman processes run concurrenty.Option 4: Postman Performance Testing newer feature)Ir your rostman version has it, collection Kunner has a Pertormance tad nowalonesiee runcuonal. luruns une conecuon wu conncuradie vntuar usersinparallel — set 20 virtual users, 30-second duration, and you'll saturate the burstwindow without any external tooling, Path is Run collection - Performance →contoureYou probably don t actually need to hit itWorth pausing here: the goal or this exercise is to veriy your limiter handles 429Sconecuy, nent. rou can do unat wiun a mock witnout durie real quora// In your test, take a 429 responseSmockResnonse = new Guzz lehttn Psrz Resnonse!429'Retrv-Afterl => 'g'.json encodeL'status' => 'error','message' => 'You have reached your secondly limit.'.'errorType' => 'RATE LIMIT'.oolicvName' =>"SECONDLY,'correlationid' => 'test-123',That gives you the exact shape HubSpot returns, and you can unit-test:• Parsing policvName correctlv• Routing to the right queue's backoff• Honoring Retrv-After• Not double-counting the failed call against the bucketPostman's valute is regllv one-ofl eynloration ("does this header exist? what does al429 body look like?"). For wiring up the limiter, mocked tests are faster and don'tKeep going in Claude CodeSwitch to Claude Code and let Claude work directiv in vour.Write a message…Opus 4. Adaptive*x Hubspot v• SearchYour team is now on the Free plan with 1 admin. You retain editing access and other members are read-only. View team permissions to see who can edit, or upgrade to restore collaborationGET nexto • POST searc • POST Read •Run orderRun Sequence• geT Read CopyGET readGET Get Er•GET Read CoDeselect AllSelect All ResetIteration40"Lukas sterka 121• In 2n 3mNo environmentvCOLLECTIONS> Associations V4• CMS - URL Redirects APl Collection• Companies• COMPARE› Contactsv CRM Obiectsv crm/v3/objects/{object Type}>u batchD (object ld)› associations<to Obiect TypeGET Read5g. An error occurredca. successful onerationPaTCH Uindate>GET ListPOST Createy Post Filter, Sort, and Search CRM Obiectsca. succeccful onerationeg. An error occurred› CRM Owners• CRM Pioelines• Dealsv EngagementsIM OID ENGAGEMENTSGet list meetingsPoST soarch modified comnaniecPosT search tasksGET road call>PoST search callsGeT list callsPOST meetings scheduledGET get meetingPOST aet link to task> POSt Create Contact with Association> Hubspotv Iteration run HSGET Read Copyca. An error occurred.CaMiDANMeNre) spfcs>FLOWS§ Connect Git E Console TerrIterationD RunnerFunctionalPerformancechoose how to run vour pertormance testIn the app• Via the CLIContigure CLi command to run on your build pipelineSet up your performance testLoad profile ©Virtual users ©Fixed20 MuleTest duration20 virtual users run for 1 minute, each executina all requests sequentiallvData tile GSelect file>Pass test if...©100% L2Inu / May 10.2/.19UparadeVAIIAll variablesE EnvironmentNo environment selected, seled enulommeaGlobalstokenCKPur5PqMxIZ@INOMi8kOfbaseUrlhttps://api.hubapi.comCeweToKenlCLLm5NnQMxIRQINQMI8kQ.• Local VaultStore your APl secrets locally in vault. Set up vaultGlobals Vault Tools?00O...
|
iTerm2
|
NULL
|
NULL
|
3570
|
|
3571
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp# Lukas/Stefka 121 • in 2h 3 mA100% <478Thu 7 May 15:27:19DEV (docker)DOCKERDEV (docker)882APP (-zsh)Jiminny-worker-processing-4:jiminny-worker-processing-4_00:jiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedstoppedworker-crm-update:worker-crm-update_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker:worker_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00:stoppedworker-audio:worker-audio_00: stoppedworker-emails:worker-emails_00:stoppedartisan-schedule:artisan-schedule_00: stoppedworker-es-update:worker-es-update_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00: startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00: startedroot@docker_lamp_1:/home/jiminny# php artisan jiminny:debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# php artisan jiminny: debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# ]-zsh• $4screenpipe*•$5-zsh₴6DEV...
|
iTerm2
|
NULL
|
NULL
|
3571
|
|
3572
|
PostmancaltVIewWindowHubSpot rate limit implement PostmancaltVIewWindowHubSpot rate limit implementation strategymuluple Newman processes run concurrenty.Option 4: Postman Performance Testing newer feature)Ir your rostman version has it, collection Kunner has a Pertormance tad nowalonesiee runcuonal. luruns une conecuon wu conncuradie vntuar usersinparallel — set 20 virtual users, 30-second duration, and you'll saturate the burstwindow without any external tooling, Path is Run collection - Performance →contoureYou probably don t actually need to hit itWorth pausing here: the goal or this exercise is to veriy your limiter handles 429Sconecuy, nent. rou can do unat wiun a mock witnout durie real quora// In your test, take a 429 responseSmockResnonse = new Guzz lehttn Psrz Resnonse!429'Retrv-Afterl => 'g'.json encodeL'status' => 'error','message' => 'You have reached your secondly limit.'.'errorType' => 'RATE LIMIT'.oolicvName' =>"SECONDLY,'correlationid' => 'test-123',That gives you the exact shape HubSpot returns, and you can unit-test:• Parsing policvName correctlv• Routing to the right queue's backoff• Honoring Retrv-After• Not double-counting the failed call against the bucketPostman's valute is regllv one-ofl eynloration ("does this header exist? what does al429 body look like?"). For wiring up the limiter, mocked tests are faster and don'tKeep going in Claude CodeSwitch to Claude Code and let Claude work directiv in vour.Write a message…Opus 4. AdaptiveXx Hubspot v• SearchYour team is now on the Free plan with 1 admin. You retain editing access and other members are read-only. View team permissions to see who can edit, or upgrade to restore collaborationGET nexto • POST searc • POST Read •Run orderRun SequenceGET Read copyGET readGET Get Er•GET Read CoDeselect AllSelect All Reset40"Lukas sterka 121• In 2n 3mIterationNo environmentvCOLLECTIONS> Associations V4• CMS - URL Redirects APl Collection• Companies• COMPARE› Contactsv CRM Obiectsv crm/v3/objects/{object Type}>u batchD (object ld)› associations<to Obiect TypeGET Read5g. An error occurredca. successful onerationPaTCH Uindate>GET ListPOST Createy Post Filter, Sort, and Search CRM Obiectsca. succeccful onerationeg. An error occurred› CRM Owners• CRM Pioelines• Dealsv EngagementsIM OID ENGAGEMENTSGet list meetingsPoST soarch modified comnaniecPosT search tasksGET road call>PoST search callsGeT list callsPOST meetings scheduledGET get meetingPOST aet link to task> POSt Create Contact with Association> Hubspotv Iteration run HSGET Read Copyca. An error occurred.CaMiDANMeNre) spfcs>FLOWS§ Connect Git E Console TerrO IterationD RunnerFunctinnalPerformancechoose how to run vour pertormance testIn the app• Via the CLIContigure CLi command to run on your build pipelineSet up your performance testLoad profile ©Virtual users ©Test durationFixed20 Mule20 virtual users run for 1 minute, each executina all requests sequentiallvData tile GSelect file>Pass test if...©100% L2Inu / May 10.2/:30UparadeVAIIAll variablesE EnvironmentNo environment selected, seled enulommeaGlobalstokenCKPur5PqMxIZ@INOMi8kOfbaseUrlhttps://api.hubapi.comCeweToKenlCLLm5NnQMxIRQINQMI8kQ.• Local VaultStore your APl secrets locally in vault. Set up vaultGiobals Vault Tooks •- m=m...
|
iTerm2
|
NULL
|
NULL
|
3572
|
|
3573
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp# Lukas/Stefka 121 • in 2h 3 mA100% <478DEV (docker)DOCKERO &1DEV (docker)882APP (-zsh)Jiminny-worker-processing-4:jiminny-worker-processing-4_00:jiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedstoppedworker-crm-update:worker-crm-update_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker:worker_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00:stoppedworker-audio:worker-audio_00: stoppedworker-emails:worker-emails_00:stoppedartisan-schedule:artisan-schedule_00: stoppedworker-es-update:worker-es-update_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00: startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00: startedroot@docker_lamp_1:/home/jiminny# php artisan jiminny:debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# php artisan jiminny: debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# ]-zsh• $4screenpipe*•$5-zshThu 7 May 15:27:31T81₴6DEV...
|
iTerm2
|
NULL
|
NULL
|
3573
|
|
3574
|
PostmancaltVIewWindowHubSpot rate limit implement PostmancaltVIewWindowHubSpot rate limit implementation strategymuluple Newman processes run concurrenty.Option 4: Postman Performance Testing (newer feature)Ir your rostman version has it, collection Kunner has a Pertormance tad nowalonesiee runcuonal. luruns une conecuon wu conncuradie vntuar usersinparallel — set 20 virtual users, 30-second duration, and you'll saturate the burstwindow without any external tooling, Path is Run collection - Performance →contoureYou probably don t actually need to hit itWorth pausing here: the goal or this exercise is to veriy your limiter handles 429Sconecuy, nent. rou can do unat wiun a mock witnout durie real quora// In your test, take a 429 responseSmockResnonse = new Guzz lehttn Psrz Resnonse!429.'Retrv-After' => 'g'.json encodeL'status' => 'error','message' => 'You have reached your secondly limit.'.'errorType' => 'RATE LIMIT'.oolicvName' =>"SECONDLY,'correlationid => 'test-123',That gives you the exact shape HubSpot returns, and you can unit-test:• Parsing policvName correctlv• Routing to the right queue's backoff• Honoring Retrv-After• Not double-counting the failed call against the bucketPostman's valute is regllv one-ofl eynloration ("does this header exist? what does al429 body look like?"). For wiring up the limiter, mocked tests are faster and don'tKeep going in Claude CodeSwitch to Claude Code and let Claude work directiv in vour.Write a message…Opus 4. Adaptive*x Hubspot v• SearchYour team is now on the Free plan with 1 admin. You retain editing access and other members are read-only. View team permissions to see who can edit, or upgrade to restore collaborationGET nexto • POST searc • POST Read •GET Rea( •GET readGET Get ErGET Read CoRun orderRun SequenceDeselect AllSelect All ResetGET Read copyIteration40"Lukas sterka 121• In 2n 3mNo environmentvCOLLECTIONS> Associations V4• CMS - URL Redirects APl Collection• Companies• COMPARE› Contactsv CRM Obiectsv crm/v3/objects/{object Type}>u batchD (object ld)› associations<to Obiect TypeGET Read5g. An error occurredca. successful onerationPaTCH Uindate>GET ListPOST Createy Post Filter, Sort, and Search CRM Obiectsca. succeccful onerationeg. An error occurred› CRM Owners• CRM Pioelines• Dealsv EngagementsIM OID ENGAGEMENTSGet list meetingsPoST soarch modified comnaniecPosT search tasksGET road call>PoST search callsGeT list callsPOST meetings scheduledGET get meetingPOST aet link to task> pOSt Create Contact with Association> Hubspotv Iteration run HSGET Read Copyca. An error occurred.CaMiDANMeNre) spfcs>FLOWS§ Connect Git E Console TerrIterationD RunnerFunctionalPerformancechoose how to run vour collection• Run manually ©• Schedule runs ©) Automate runs via CURun configurationIterations GDelay OTest data file ©Select FileAdvanced Settinas(v Persist responses for a session O• Turn off logs during run ©(v) Stop run if an error occursKeep variable values• Run collection without using stored cookiesSave cookies after collection run ©100% L2Inu / May 10.2/:30UparadeVAIIAll variablesE EnvironmentNo environment celected Select environmentGlobalstokenCKPur5PqMxIZ@INOMi8kOfbaseUrlhttps://api.hubapi.comCeweToKenlCLLm5NnQMxIRQINQMI8kQ.• Local VaultStore your APl secrets locally in vault. Set up vaultGlobals Vault Tools?00O...
|
iTerm2
|
NULL
|
NULL
|
3574
|
|
3575
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp# Lukas/Stefka 121 • in 2h 3 m100% <478Thu 7 May 15:27:36DEV (docker)DOCKERO &1DEV (docker)882APP (-zsh)Jiminny-worker-processing-4:jiminny-worker-processing-4_00:jiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedstoppedworker-crm-update:worker-crm-update_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker:worker_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00:stoppedworker-audio:worker-audio_00: stoppedworker-emails:worker-emails_00:stoppedartisan-schedule:artisan-schedule_00: stoppedworker-es-update:worker-es-update_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00: startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00: startedroot@docker_lamp_1:/home/jiminny# php artisan jiminny:debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# php artisan jiminny: debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# ]-zsh• $4screenpipe*•$5-zsh₴6DEV...
|
iTerm2
|
NULL
|
NULL
|
3575
|
|
3576
|
PostmancaltVIewWindowHubSpot rate limit implement PostmancaltVIewWindowHubSpot rate limit implementation strategymuluple Newman processes run concurrenty.Option 4: Postman Performance Testing newer feature)Ir your rostman version has it, collection Kunner has a Pertormance tad nowalonesiee runcuonal. luruns une conecuon wu conncuradie vntuar usersinparallel — set 20 virtual users, 30-second duration, and you'll saturate the burstwindow without any external tooling, Path is Run collection - Performance →contoureYou probably don t actually need to hit itWorth pausing here: the goal or this exercise is to veriy your limiter handles 429Sconecuy, nent. rou can do unat wiun a mock witnout durie real quora// In your test, take a 429 responseSmockResnonse = new Guzz lehttn Psrz Resnonse!429'Retrv-Afterl => 'g'.json encodeL'status' => 'error','message' => 'You have reached your secondly limit.'.'errorType' => 'RATE LIMIT'.oolicvName' =>"SECONDLY,'correlationid' => 'test-123',That gives you the exact shape HubSpot returns, and you can unit-test:• Parsing policvName correctlv• Routing to the right queue's backoff• Honoring Retrv-After• Not double-counting the failed call against the bucketPostman's valute is regllv one-ofl eynloration ("does this header exist? what does al429 body look like?"). For wiring up the limiter, mocked tests are faster and don'tKeep going in Claude CodeSwitch to Claude Code and let Claude work directiv in vour.Write a message…Opus 4. Adaptive*x Hubspot v• SearchYour team is now on the Free plan with 1 admin. You retain editing access and other members are read-only. View team permissions to see who can edit, or upgrade to restore collaborationGET nexto • POST searc • POST Read •Run orderRun Sequence• geT Read CopyGET readGET Get Er•GET Read CoDeselect AllSelect All ResetIteration40"Lukas sterka 121• In 2n 3mNo environmentvCOLLECTIONS> Associations V4• CMS - URL Redirects APl Collection• Companies• COMPARE› Contactsv CRM Obiectsv crm/v3/objects/{object Type}>u batchD (object ld)› associations<to Obiect TypeGET Read5g. An error occurredca. successful onerationPaTCH Uindate>GET ListPOST Createy Post Filter, Sort, and Search CRM Obiectsca. succeccful onerationeg. An error occurred› CRM Owners• CRM Pioelines• Dealsv EngagementsIM OID ENGAGEMENTSGet list meetingsPoST soarch modified comnaniecPosT search tasksGET road call>PoST search callsGeT list callsPOST meetings scheduledGET get meetingPOST aet link to task> POSt Create Contact with Association> Hubspotv Iteration run HSGET Read Copyca. An error occurred.CaMiDANMeNre) spfcs>FLOWS§ Connect Git E Console TerrIterationD RunnerFunctionalPerformancechoose how to run vour pertormance test• In the app• Via the CLIContigure CLi command to run on your build pipelineSet up your performance testLoad profile ©Virtual users ©FixedI:120 Mule20 virtual users run for 10 minutes, each executina all requests sequentiallv.Data tile GSelect file>Pass test if...©100% L2Inu / May 10.21.40UparadeVAIIAll variablesE EnvironmentNo environment selected, seled enulommeaGlobalstokenCKPur5PqMxIZ@INOMi8kOfbaseUrlhttps://api.hubapi.comCeweToKenlCLLm5NnQMxIRQINQMI8kQ.• Local VaultStore your APl secrets locally in vault. Set up vaultGlobals Vault Tools?00O...
|
iTerm2
|
NULL
|
NULL
|
3576
|
|
3577
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp# Lukas/Stefka 121 • in 2h 3 m100% <478DEV (docker)DOCKERO &1DEV (docker)882APP (-zsh)Jiminny-worker-processing-4:jiminny-worker-processing-4_00:jiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedstoppedworker-crm-update:worker-crm-update_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker:worker_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00:stoppedworker-audio:worker-audio_00: stoppedworker-emails:worker-emails_00:stoppedartisan-schedule:artisan-schedule_00: stoppedworker-es-update:worker-es-update_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00: startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00: startedroot@docker_lamp_1:/home/jiminny# php artisan jiminny:debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# php artisan jiminny: debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# ]-zsh• $4screenpipe*•$5-zshThu 7 May 15:27:45T81₴6DEV...
|
iTerm2
|
NULL
|
NULL
|
3577
|
|
3578
|
PostmancaltVIewWindowHubSpot rate limit implement PostmancaltVIewWindowHubSpot rate limit implementation strategymuluple Newman processes run concurrenty.Option 4: Postman Performance Testing newer feature)Ir your rostman version has it, collection Kunner has a Pertormance tad nowalonesiee runcuonal. luruns une conecuon wu conncuradie vntuar usersinparallel — set 20 virtual users, 30-second duration, and you'll saturate the burstwindow without any external tooling, Path is Run collection - Performance →contoureYou probably don t actually need to hit itWorth pausing here: the goal or this exercise is to veriy your limiter handles 429Sconecuy, nent. rou can do unat wiun a mock witnout durie real quora// In your test, take a 429 responseSmockResnonse = new Guzz lehttn Psrz Resnonse!429'Retrv-Afterl => 'g'.json encodeL'status' => 'error','message' => 'You have reached your secondly limit.'.'errorType' => 'RATE LIMIT'.oolicvName' =>"SECONDLY,'correlationid' => 'test-123',That gives you the exact shape HubSpot returns, and you can unit-test:• Parsing policvName correctlv• Routing to the right queue's backoff• Honoring Retrv-After• Not double-counting the failed call against the bucketPostman's valute is regllv one-ofl eynloration ("does this header exist? what does al429 body look like?"). For wiring up the limiter, mocked tests are faster and don'tKeep going in Claude CodeSwitch to Claude Code and let Claude work directiv in vour.Write a message…Opus 4. Adaptive*x Hubspot v• SearchYour team is now on the Free plan with 1 admin. You retain editing access and other members are read-only. View team permissions to see who can edit, or upgrade to restore collaborationGET nexto • POST searc • POST Read •Run orderRun Sequence• geT Read CopyGET readGET Get Er•GET Read CoDeselect AllSelect All Reset40"Lukas sterka 121• In 2n 3mIterationNo environmentvCOLLECTIONS> Associations V4• CMS - URL Redirects APl Collection• Companies• COMPARE› Contactsv CRM Obiectsv crm/v3/objects/{object Type}>u batchD (object ld)› associations<to Obiect TypeGET Read5g. An error occurredca. successful onerationPaTCH Uindate>GET ListPOST Createy Post Filter, Sort, and Search CRM Obiectsca. succeccful onerationeg. An error occurred› CRM Owners• CRM Pioelines• Dealsv EngagementsIM OID ENGAGEMENTSGet list meetingsPoST soarch modified comnaniecPosT search tasksGET road call>PoST search callsGeT list callsPOST meetings scheduledGET get meetingPOST aet link to task> POSt Create Contact with Association> Hubspotv Iteration run HSGET Read Copyca. An error occurred.CaMiDANMeNre) spfcs>FLOWS§ Connect Git E Console TerrIterationD RunnerFunctionalPerformancechoose how to run vour pertormance testIn the app• Via the CLIContigure CLi command to run on your build pipelineSet up your performance testLoad profile ©Virtual users ©Test durationFixed20 Mule20 virtual users run for 1 minute, each executina all requests sequentiallvData tile GSelect file>Pass test if...©100% L2Inu / May 10.2/.41UparadeVAIIAll variablesE EnvironmentNo environment selected, seled enulommeaGlobalstokenCKPur5PqMxIZ@INOMi8kOfbaseUrlhttps://api.hubapi.comCeweToKenlCLLm5NnQMxIRQINQMI8kQ.• Local VaultStore your APl secrets locally in vault. Set up vaultGiobals Vault Tooks •- m=m...
|
iTerm2
|
NULL
|
NULL
|
3578
|
|
3579
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp# Lukas/Stefka 121 • in 2h 3 mA100% <478DEV (docker)DOCKERO &1DEV (docker)882APP (-zsh)Jiminny-worker-processing-4:jiminny-worker-processing-4_00:jiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedstoppedworker-crm-update:worker-crm-update_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker:worker_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00:stoppedworker-audio:worker-audio_00: stoppedworker-emails:worker-emails_00:stoppedartisan-schedule:artisan-schedule_00: stoppedworker-es-update:worker-es-update_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00: startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00: startedroot@docker_lamp_1:/home/jiminny# php artisan jiminny:debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# php artisan jiminny: debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# ]-zsh• $4screenpipe*•$5-zshThu 7 May 15:27:47T81₴6DEV...
|
iTerm2
|
NULL
|
NULL
|
3579
|
|
3580
|
PostmancaltVIewWindowHubSpot rate limit implement PostmancaltVIewWindowHubSpot rate limit implementation strategymuluple Newman processes run concurrenty.Option 4: Postman Performance Testing newer feature)Ir your rostman version has it, collection Kunner has a Pertormance tad nowalonesiee runcuonal. luruns une conecuon wu conncuradie vntuar usersinparallel — set 20 virtual users, 30-second duration, and you'll saturate the burstwindow without any external tooling, Path is Run collection - Performance →contoureYou probably don t actually need to hit itWorth pausing here: the goal or this exercise is to veriy your limiter handles 429Sconecuy, nent. rou can do unat wiun a mock witnout durie real quora// In your test, take a 429 responseSmockResnonse = new Guzz lehttn Psrz Resnonse!429'Retrv-Afterl => 'g'.json encodeL'status' => 'error','message' => 'You have reached your secondly limit.'.'errorType' => 'RATE LIMIT'.oolicvName' =>"SECONDLY,'correlationid' => 'test-123',That gives you the exact shape HubSpot returns, and you can unit-test:• Parsing policvName correctlv• Routing to the right queue's backoff• Honoring Retrv-After• Not double-counting the failed call against the bucketPostman's valute is regllv one-ofl eynloration ("does this header exist? what does al429 body look like?"). For wiring up the limiter, mocked tests are faster and don'tKeep going in Claude CodeSwitch to Claude Code and let Claude work directiv in vour.Write a message…Opus 4. AdaptiveXx Hubspot v• SearchYour team is now on the Free plan with 1 admin. You retain editing access and other members are read-only. View team permissions to see who can edit, or upgrade to restore collaborationGET nexto • POST searc • POST Read •Run orderRun Sequence• geT Read CopyGET readGET Get Er •GET Read CoDeselect AllSelect All Reset40"Lukas sterka 121• In 2n 3mIterationNo environmentvCOLLECTIONS> Associations V4• CMS - URL Redirects APl Collection• Companies• COMPARE› Contactsv CRM Obiectsv crm/v3/objects/{object Type}>u batchD (object ld)› associations<to Obiect TypeGET Read5g. An error occurredca. successful onerationPaTCH Uindate>GET ListPOST Createy Post Filter, Sort, and Search CRM Obiectsca. succeccful onerationeg. An error occurred› CRM Owners• CRM Pioelines• Dealsv EngagementsIM OID ENGAGEMENTSGet list meetingsPoST soarch modified comnaniecPosT search tasksGET road call>PoST search callsGeT list callsPOST meetings scheduledGET get meetingPOST aet link to task> POSt Create Contact with Association> Hubspotv Iteration run HSGET Read Copyca. An error occurred.CaMiDANMeNre) spfcs>FLOWS§ Connect Git E Console TerrO IterationD RunnerFunctionalPerformancechoose how to run vour pertormance testIn the app• Via the CLIContigure CLi command to run on your build pipelineSet up your performance testLoad profile ©Virtual users ©Fixed20 Mule20 virtual users run for 1 minute, each executina all requests sequentiallvData tile GSeleify filePass test if...©Select option100% 52Inu / May 10.2/.49UparadeVAIIAll variablesE EnvironmentNo environment selected, seled enulommeaGlobalstokenCKPur5PqMxIZ@INOMi8kOfbaseUrlhttps://api.hubapi.comCeweToKenlCLLm5NnQMxIRQINQMI8kQ.• Local VaultStore your APl secrets locally in vault. Set up vaultGlobals Vault Tools?00O...
|
iTerm2
|
NULL
|
NULL
|
3580
|
|
3581
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp# Lukas/Stefka 121 • in 2h 3 m100% <478DEV (docker)DOCKERO &1DEV (docker)882APP (-zsh)Jiminny-worker-processing-4:jiminny-worker-processing-4_00:jiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedstoppedworker-crm-update:worker-crm-update_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker:worker_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00:stoppedworker-audio:worker-audio_00: stoppedworker-emails:worker-emails_00:stoppedartisan-schedule:artisan-schedule_00: stoppedworker-es-update:worker-es-update_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00: startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00: startedroot@docker_lamp_1:/home/jiminny# php artisan jiminny:debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# php artisan jiminny: debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# ]-zsh• $4screenpipe*•$5-zshThu 7 May 15:27:49T81₴6DEV...
|
iTerm2
|
NULL
|
NULL
|
3581
|
|
3582
|
PostmanVIewWindow•• 0HubSpot rate limit implement PostmanVIewWindow•• 0HubSpot rate limit implementation strategymulaple Newman processes run concurrenty.Option 4: Postman Performance Testing (newer feature)Ir your rostman version has it, collection Kunner has a Pertormance tad nowalonesiee runcuonal. luruns une colecuon wiu conncuradie virtuar usersinparallel — set 20 virtual users, 30-second duration, and you'll saturate the burstwindow without any external tooling, Path is Run collection - Performance →contoureYou probably don t actually need to hit itWorth pausing here: the goal or this exercise is to veriy your limiter handles 429Sconecuy, nent. rou can do tnat wiun a mock witnout durie real quora// In your test, take a 429 responseSmockResnonse = new Guzz lehttn Psrz Resnonse!429'Retrv-Afterl => 'g'.json encodeL'status' => 'error','message' => 'You have reached your secondly limit.'.'errorType' => 'RATE LIMIT'.oolicvName' =>"SECONDLY,'correlationid => 'test-123',That gives you the exact shape HubSpot returns, and you can unit-test:• Parsing policvName correctlv• Routing to the right queue's backoff• Honoring Retrv-After• Not double-counting the failed call against the bucketPostman's vallute is regllv one-ofl eynloration ( "does this hegder exist? what does a l429 body look like?"). For wiring up the limiter, mocked tests are faster and don'tKeep going in Claude CodeSwitch to Claude Code and let Claude work directiv in vour.Write a message…40"Lukas sterka 121• In 2n 3m100% 2Inu / May 10.2/:01Your team is now on the Free plan with 1 admin. You retain editing access and other members are read-only. View team permissions to see who can edit, or upgrade to restore collaboration• COLLECTIONSDeselect AllSelect All Reset• Associations V4|V GET Read CopyCMS - URL Redirects APl CollectionCompaniesCOMPARE• Contacts• CRM Obiects• crm/v3/objects/{object Type}> D batch• D {object Id)}> associatieg. An error occurredee successful operation> patcи Uindate• post Createed. successful oneratiore9- An error occurredCRM OwnersCRM PipelinesDeals• Engagements• D OLD ENGAGEMENTSGet list meetingsPost search tasksGET road calliGEt list callsPOST meetinas scheduledGET get meetingPOST aet link to task> Hubspoted. An error occurredCAMiDANMCuTeSPECS>FLOWSUpgrade to use data filesData files let you drive monitors, functional and performance collection runswith test data. Uparade vour plan to get started.Solo 59 per seat / month• Team S19 ner seat / month.For teams building and shinning APls toaether• Enterprise $49 per seat / monthFor organs bulldina, managina, and distributing APis at scaleContinue with Team PlanStart TrialChoose how to run vour pertormance test• In the appRun this performance test in the aod) Via the CLConfigure CLI command to run on your build pipeli.Set up your performance testAll variablesG GlobalsbaseUrl?VeloKelal• Local VaulyCKpursp.MvlZOiNOMiekosCLLm5NnQMxIRQINQMI8kQStore your API secrets locally in vault. Set up vaultTeam plan includes:Team collaborationUnlimited workspace & collection viewersBasic Role Based Access Control (RBAC)SDK generationSimple security (add-on)Opus 4. AdaptiveGlobals Vault Tools? 0 0...
|
iTerm2
|
NULL
|
NULL
|
3582
|
|
3583
|
PostmanVIewWindow•• 0HubSpot rate limit implement PostmanVIewWindow•• 0HubSpot rate limit implementation strategymulaple Newman processes run concurrenty.Option 4: Postman Performance Testing (newer feature)Ir your rostman version has it, collection Kunner has a Pertormance tad nowalonesiee runcuonal. luruns une colecuon wiu conncuradie virtuar usersinparallel — set 20 virtual users, 30-second duration, and you'll saturate the burstwindow without any external tooling, Path is Run collection - Performance →contoureYou probably don t actually need to hit itWorth pausing here: the goal or this exercise is to veriy your limiter handles 429Sconecuy, nent. rou can do tnat wiun a mock witnout durie real quora// In your test, take a 429 responseSmockResnonse = new Guzz lehttn Psrz Resnonse!429'Retrv-Afterl => 'g'.json encodeL'status' => 'error','message' => 'You have reached your secondly limit.'.'errorType' => 'RATE LIMIT'.oolicvName' =>"SECONDLY,'correlationid => 'test-123',That gives you the exact shape HubSpot returns, and you can unit-test:• Parsing policvName correctlv• Routing to the right queue's backoff• Honoring Retrv-After• Not double-counting the failed call against the bucketPostman's vallute is regllv one-ofl eynloration ( "does this hegder exist? what does a l429 body look like?"). For wiring up the limiter, mocked tests are faster and don'tKeep going in Claude CodeSwitch to Claude Code and let Claude work directiv in vour.Write a message…40"Lukas sterka 121• In 2n 3m100% 2Inu / May 10.2/:00Your team is now on the Free plan with 1 admin. You retain editing access and other members are read-only. View team permissions to see who can edit, or upgrade to restore collaboration• COLLECTIONSDeselect AllSelect All Reset• Associations V4|V GET Read CopyCMS - URL Redirects APl CollectionCompaniesCOMPARE• Contacts• CRM Obiects• crm/v3/objects/{object Type}> D batch• D {object Id)}> associatieg. An error occurredee successful operation> patcи Uindate• post Createed. successful oneratiore9- An error occurredCRM OwnersCRM PipelinesDeals• Engagements• D OLD ENGAGEMENTSGet list meetingsPost search tasksGET road calliGEt list callsPOST meetinas scheduledGET get meetingPOST aet link to task> Hubspoted. An error occurredCAMiDANMCuTeSPECS>FLOWSUpgrade to use data filesData files let you drive monitors, functional and performance collection runswith test data. Uparade vour plan to get started.Solo 59 per seat / month• Team S19 ner seat / month.For teams building and shinning APls toaether• Enterprise $49 per seat / monthFor organs bulldina, managina, and distributing APis at scaleContinue with Team PlanStart TrialChoose how to run vour pertormance test• In the appRun this performance test in the aod) Via the CLConfigure CLI command to run on your build pipeli.Set up your performance testAll variablesG GlobalsbaseUrl?VeloKelal• Local VaulyCKpursp.MvlZOiNOMiekosCLLm5NnQMxIRQINQMI8kQStore your API secrets locally in vault. Set up vaultTeam plan includes:Team collaborationUnlimited workspace & collection viewersBasic Role Based Access Control (RBAC)SDK generationSimple security (add-on)Opus 4. AdaptiveGlobals Vault Tools? 0 0...
|
iTerm2
|
NULL
|
NULL
|
3583
|
|
3584
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp# Lukas/Stefka 121 • in 2h 3 mA100% [8Thu 7 May 15:27:55DEV (docker)DOCKERO &1DEV (docker)882APP (-zsh)Jiminny-worker-processing-4:jiminny-worker-processing-4_00:jiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedstoppedworker-crm-update:worker-crm-update_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker:worker_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00:stoppedworker-audio:worker-audio_00: stoppedworker-emails:worker-emails_00:stoppedartisan-schedule:artisan-schedule_00: stoppedworker-es-update:worker-es-update_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00: startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00: startedroot@docker_lamp_1:/home/jiminny# php artisan jiminny:debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# php artisan jiminny: debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# ]-zsh• $4screenpipe*•$5-zsh₴6DEV...
|
iTerm2
|
NULL
|
NULL
|
3584
|
|
3585
|
PostmancaltVIewWindowHubSpot rate limit implement PostmancaltVIewWindowHubSpot rate limit implementation strategymuluple Newman processes run concurrenty.Option 4: Postman Performance Testing newer feature)Ir your rostman version has it, collection Kunner has a Pertormance tad nowalonesiee runcuonal. luruns une conecuon wu conncuradie vntuar usersinparallel — set 20 virtual users, 30-second duration, and you'll saturate the burstwindow without any external tooling, Path is Run collection - Performance →contoureYou probably don t actually need to hit itWorth pausing here: the goal or this exercise is to veriy your limiter handles 429Sconecuy, nent. rou can do unat wiun a mock witnout durie real quora// In your test, take a 429 responseSmockResnonse = new Guzz lehttn Psrz Resnonse!429'Retrv-Afterl => 'g'.json encodeL'status' => 'error','message' => 'You have reached your secondly limit.'.'errorType' => 'RATE LIMIT'.oolicvName' =>"SECONDLY,'correlationid' => 'test-123',That gives you the exact shape HubSpot returns, and you can unit-test:• Parsing policvName correctlv• Routing to the right queue's backoff• Honoring Retrv-After• Not double-counting the failed call against the bucketPostman's valute is regllv one-ofl eynloration ("does this header exist? what does al429 body look like?"). For wiring up the limiter, mocked tests are faster and don'tKeep going in Claude CodeSwitch to Claude Code and let Claude work directiv in vour.Write a message…Opus 4. AdaptiveXx Hubspot v• SearchYour team is now on the Free plan with 1 admin. You retain editing access and other members are read-only. View team permissions to see who can edit, or upgrade to restore collaborationGET nexto • POST searc • POST Read •Run orderRun Sequence• geT Read CopyGET readGET Get Er •Deselect AllSelect All Reset40"Lukas sterka 121• In 2n 3mIterationNo environmentvCOLLECTIONS> Associations V4• CMS - URL Redirects APl Collection• Companies• COMPARE› Contactsv CRM Obiectsv crm/v3/objects/{object Type}>u batchD (object ld)› associations<to Obiect TypeGET Read5g. An error occurredca. successful onerationPaTCH Uindate>GET ListPOST Createy Post Filter, Sort, and Search CRM Obiectsca. succeccful onerationeg. An error occurred› CRM Owners• CRM Pioelines• Dealsv EngagementsIM OID ENGAGEMENTSGet list meetingsPoST soarch modified comnaniecPosT search tasksGET road call>PoST search callsGeT list callsPOST meetings scheduledGET get meetingPOST aet link to task> POSt Create Contact with Association> Hubspotv Iteration run HSGET Read Copyca. An error occurred.CaMiDANMeNre) spfcs>FLOWS§ Connect Git E Console TerrO IterationD RunnerFunctionalPerformancechoose how to run vour pertormance testIn the app• Via the CLIContigure CLi command to run on your build pipelineSet up your performance testLoad profile ©Virtual users ©Fixed20 Mule20 virtual users run for 1 minute, each executina all requests sequentiallvData tile GSelect filePass test if...©MetricSelect option100% 2Inu/ May 10.2/:0/UparadeVAIIAll variablesE EnvironmentNo environment selected, seled enulommeaGlobalstokenCKPur5PqMxIZ@INOMi8kOfbaseUrlhttps://api.hubapi.comCeweToKenlCLLm5NnQMxIRQINQMI8kQ.• Local VaultStore your APl secrets locally in vault. Set up vaultGlobals Vault Tools?00O...
|
iTerm2
|
NULL
|
NULL
|
3585
|
|
3586
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
2
68
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Crm\Hubspot;
use HubSpot\Client\Crm\Deals\ApiException as DealApiException;
use HubSpot\Client\Crm\Contacts\ApiException as ContactApiException;
use HubSpot\Client\Crm\Companies\ApiException as CompanyApiException;
use HubSpot\Client\Crm\Contacts\Model\SimplePublicObjectWithAssociations as ContactsWithAssociations;
use HubSpot\Client\Crm\Companies\Model\SimplePublicObjectWithAssociations as CompaniesWithAssociations;
use HubSpot\Client\Crm\Deals\Model\SimplePublicObjectWithAssociations as DealWithAssociations;
use HubSpot\Client\Crm\Objects\Model\SimplePublicObjectInput;
use HubSpot\Client\Crm\Objects\Model\SimplePublicObjectWithAssociations as ObjectWithAssociations;
use HubSpot\Client\Crm\Pipelines\Model\Error;
use HubSpot\Client\Crm\Pipelines\Model\PipelineStage;
use HubSpot\Client\Crm\Properties\Model\Property;
use HubSpot\Discovery\Discovery;
use Jiminny\Component\Utility\Service\ProviderRateLimiter;
use Jiminny\Exceptions\CrmException;
use Jiminny\Exceptions\RateLimitException;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Jobs\Crm\NoteObject;
use Jiminny\Models\Crm\Field;
use Jiminny\Services\Crm\BaseClient;
use Jiminny\Services\Crm\Hubspot\DTO\Response\Owner;
use Jiminny\Services\SocialAccountService;
use SevenShores\Hubspot\Exceptions\BadRequest;
use SevenShores\Hubspot\Exceptions\HubspotException;
use SevenShores\Hubspot\Factory;
use SevenShores\Hubspot\Http\Response;
use Jiminny\Services\Crm\Hubspot\Pagination\HubspotPaginationService;
use Throwable;
/**
* @phpstan-type CrmFieldOption array{id:string, label:string, value?:string}
*/
class Client extends BaseClient implements HubspotClientInterface
{
public const string MIN_API_VERSION = '2';
public const string BASE_URL = '[URL_WITH_CREDENTIALS] T
* @param callable(): T $apiCall
* @return T
*
* @throws RateLimitException
*/
private function executeRequest(callable $apiCall)
{
if (! $this->rateLimiter->canMakeRequest($this->config)) {
$retryAfter = $this->rateLimiter->requestAvailableIn($this->config);
$this->log->warning('[Hubspot] Rate limit exceeded, deferring request', [
'team_id' => $this->config->team_id,
'config_id' => $this->config->getId(),
'retry_after' => $retryAfter,
]);
throw new RateLimitException(
'Hubspot rate limit reached for configuration ' . $this->config->getId(),
$retryAfter,
);
}
$this->rateLimiter->incrementRequestCount($this->config);
try {
return $apiCall();
} catch (Throwable $e) {
if ($this->isHubspotRateLimit($e)) {
$retryAfter = $this->parseRetryAfter($e);
$this->log->warning('[Hubspot] Received 429 from API', [
'team_id' => $this->config->team_id,
'config_id' => $this->config->getId(),
'retry_after' => $retryAfter,
'reason' => $e->getMessage(),
]);
throw new RateLimitException('Hubspot returned 429', $retryAfter, $e);
}
throw $e;
}
}
private function isHubspotRateLimit(Throwable $e): bool
{
return method_exists($e, 'getCode') && (int) $e->getCode() === 429;
}
private function parseRetryAfter(Throwable $e): int
{
if (method_exists($e, 'getResponseHeaders')) {
$headers = $e->getResponseHeaders() ?: [];
$value = $headers['Retry-After'] ?? $headers['retry-after'] ?? null;
if (is_array($value)) {
$value = $value[0] ?? null;
}
if (is_numeric($value)) {
return (int) $value;
}
}
return 10;
}
public function getMinimumApiVersion(): string
{
return self::MIN_API_VERSION;
}
public function getInstance(): Factory
{
return new Factory([
'key' => $this->accessToken,
'oauth2' => true,
'base_url' => $this->baseUrl,
]);
}
public function getNewInstance(): Discovery
{
return \HubSpot\Factory::createWithAccessToken($this->accessToken);
}
/**
* Secondly and daily limits for Hubspot API
*
* Product Tier: Free & Starter | Professional & Enterprise | API add-on (any tier)
* Burst: 100/10 seconds | 150/10 seconds | 200/10 seconds
* Daily: 250,000 | 500,000 | 1,000,000
*
* Official documentation states: The search endpoints are rate limited to five requests per second.
* Since with 5 RPS were still hitting secondly rate limits we lowered it to 4
*/
public function getPaginatedData(array $payload, string $type, int $offset = 0): array
{
$total = 0;
$lastId = null;
$rows = [];
foreach ($this->getPaginatedDataGenerator($payload, $type, $offset, $total, $lastId) as $row) {
$rows[] = $row;
}
return ['results' => $rows, 'total' => $total, 'last_record' => $lastId];
}
/**
* @throws HubspotException
* @throws SocialAccountTokenInvalidException
* @throws BadRequest
*/
public function getPaginatedDataGenerator(
array $payload,
string $type,
int $offset = 0,
int &$total = 0,
?string &$lastRecordId = null
): \Generator {
return $this->paginationService->getPaginatedDataGenerator(
$this,
$payload,
$type,
$offset,
$total,
$lastRecordId
);
}
/**
* @throws DealApiException
* @throws CrmException
*/
public function getOpportunityById(string $crmId, array $fields): array
{
try {
// $deal = $this->executeRequest(fn () => $this->getNewInstance()->crm()->deals()->basicApi()->getById(
$deal = $this->getNewInstance()->crm()->deals()->basicApi()->getById(
$crmId,
implode(',', $fields),
'companies,contacts'
);
} catch (DealApiException $e) {
$this->log->info('[Hubspot] Failed to fetch opportunity', [
'crm_id' => $crmId,
'reason' => $e->getMessage(),
]);
throw $e;
}
if (! $deal instanceof DealWithAssociations) {
throw new CrmException('Deal not found');
}
return [
'id' => $deal->getId(),
'properties' => $deal->getProperties(),
'associations' => $deal->getAssociations(),
];
}
/**
* Generic batch read method for HubSpot objects
*
* @param string $objectType The object type ('deals', 'companies', 'contacts')
* @param array<string> $crmIds Array of HubSpot object IDs (max 100)
* @param array<string> $fields Array of property names to fetch
*
* @return array<string, array> Array keyed by CRM ID with object data
*/
private function batchReadObjects(string $objectType, array $crmIds, array $fields): array
{
if (empty($crmIds)) {
return [];
}
$this->validateBatchSize($objectType, $crmIds);
$this->ensureValidToken();
try {
$batchConfig = $this->createBatchConfiguration($objectType);
$batchReadRequest = $this->prepareBatchRequest($batchConfig, $crmIds, $fields);
$response = $batchConfig['api']->read($batchReadRequest);
$this->validateApiResponse($response, $objectType);
$results = $this->processApiResults($response);
$this->logBatchResults($objectType, $crmIds, $results);
return $results;
} catch (\Throwable $e) {
$this->handleBatchError($e, $objectType, $crmIds);
}
}
private function validateBatchSize(string $objectType, array $crmIds): void
{
if (count($crmIds) > 100) {
throw new \InvalidArgumentException("Batch size cannot exceed 100 {$objectType}");
}
}
private function createBatchConfiguration(string $objectType): array
{
$configurations = [
'deals' => [
'batchReadRequest' => new \HubSpot\Client\Crm\Deals\Model\BatchReadInputSimplePublicObjectId(),
'inputClass' => \HubSpot\Client\Crm\Deals\Model\SimplePublicObjectId::class,
'api' => $this->getNewInstance()->crm()->deals()->batchApi(),
],
'companies' => [
'batchReadRequest' => new \HubSpot\Client\Crm\Companies\Model\BatchReadInputSimplePublicObjectId(),
'inputClass' => \HubSpot\Client\Crm\Companies\Model\SimplePublicObjectId::class,
'api' => $this->getNewInstance()->crm()->companies()->batchApi(),
],
'contacts' => [
'batchReadRequest' => new \HubSpot\Client\Crm\Contacts\Model\BatchReadInputSimplePublicObjectId(),
'inputClass' => \HubSpot\Client\Crm\Contacts\Model\SimplePublicObjectId::class,
'api' => $this->getNewInstance()->crm()->contacts()->batchApi(),
],
];
if (! isset($configurations[$objectType])) {
throw new \InvalidArgumentException("Unsupported object type: {$objectType}");
}
return $configurations[$objectType];
}
private function prepareBatchRequest(array $batchConfig, array $crmIds, array $fields): object
{
$batchReadRequest = $batchConfig['batchReadRequest'];
$inputClass = $batchConfig['inputClass'];
$inputs = array_map(function ($crmId) use ($inputClass) {
$input = new $inputClass();
$input->setId($crmId);
return $input;
}, $crmIds);
$batchReadRequest->setInputs($inputs);
$batchReadRequest->setProperties($fields);
return $batchReadRequest;
}
private function validateApiResponse($response, string $objectType): void
{
if (! $response) {
throw new CrmException("HubSpot API returned null response for {$objectType} batch read");
}
}
private function processApiResults($response): array
{
$results = [];
$responseResults = $response->getResults();
if ($responseResults) {
foreach ($responseResults as $object) {
if ($object && $object->getId()) {
$results[$object->getId()] = [
'id' => $object->getId(),
'properties' => $object->getProperties() ?: [],
];
}
}
}
return $results;
}
private function logBatchResults(string $objectType, array $crmIds, array $results): void
{
$this->log->info("[HubSpot] Batch fetched {$objectType}", [
'requested_count' => count($crmIds),
'returned_count' => count($results),
'crm_ids' => $crmIds,
]);
}
private function handleBatchError(\Throwable $e, string $objectType, array $crmIds): void
{
$errorMessage = $e->getMessage() ?: 'Unknown error';
$errorTrace = $e->getTraceAsString() ?: 'No trace available';
$this->log->error("[HubSpot] Failed to batch fetch {$objectType}", [
'crm_ids' => $crmIds,
'error' => $errorMessage,
'trace' => $errorTrace,
]);
throw new CrmException("Failed to batch fetch {$objectType}: " . $errorMessage);
}
/**
* Batch read multiple opportunities by their CRM IDs
*
* @param array<string> $crmIds Array of HubSpot deal IDs (max 100)
* @param array<string> $fields Array of property names to fetch
*
* @return array<string, array> Array keyed by CRM ID with opportunity data
*/
public function getOpportunitiesByIds(array $crmIds, array $fields): array
{
return $this->batchReadObjects('deals', $crmIds, $fields);
}
/**
* Batch read multiple companies by their CRM IDs
*
* @param array<string> $crmIds Array of HubSpot company IDs (max 100)
* @param array<string> $fields Array of property names to fetch
*
* @return array<string, array> Array keyed by CRM ID with company data
*/
public function getCompaniesByIds(array $crmIds, array $fields): array
{
return $this->batchReadObjects('companies', $crmIds, $fields);
}
/**
* Batch read multiple contacts by their CRM IDs
*
* @param array<string> $crmIds Array of HubSpot contact IDs (max 100)
* @param array<string> $fields Array of property names to fetch
*
* @return array<string, array> Array keyed by CRM ID with contact data
*/
public function getContactsByIds(array $crmIds, array $fields): array
{
return $this->batchReadObjects('contacts', $crmIds, $fields);
}
/**
* @throws CompanyApiException
* @throws CrmException
*/
public function getAccountById(string $crmId, array $fields): array
{
try {
$company = $this->getNewInstance()->crm()->companies()->basicApi()->getById(
$crmId,
implode(',', $fields),
);
} catch (CompanyApiException $e) {
$this->log->info('[Hubspot] Failed to fetch account', [
'crm_id' => $crmId,
'reason' => $e->getMessage(),
]);
throw $e;
}
if (! $company instanceof CompaniesWithAssociations) {
throw new CrmException('Account not found');
}
return [
'id' => $company->getId(),
'properties' => $company->getProperties(),
];
}
/**
* @throws ContactApiException
* @throws CrmException
*/
public function getContactById(string $crmId, array $fields): array
{
try {
$contact = $this->getNewInstance()->crm()->contacts()->basicApi()->getById(
$crmId,
implode(',', $fields)
);
} catch (ContactApiException $e) {
$this->log->info('[Hubspot] Failed to fetch contact', [
'crm_id' => $crmId,
'reason' => $e->getMessage(),
]);
throw $e;
}
if (! $contact instanceof ContactsWithAssociations) {
throw new CrmException('Contact not found');
}
return [
'id' => $contact->getId(),
'properties' => $contact->getProperties(),
];
}
/**
* This is email search request that Hubspot offers as GET (more generous quota)
*/
public function getContactByEmail(string $email, array $fields = []): array
{
try {
$contact = $this->getNewInstance()->crm()->contacts()->basicApi()->getById(
$email,
implode(',', $fields),
null,
false,
'email'
);
return [
'id' => $contact->getId(),
'properties' => $contact->getProperties(),
];
} catch (ContactApiException $e) {
$this->log->info('[Hubspot] Failed to fetch contact', [
'email' => $email,
'reason' => $e->getMessage(),
]);
return [];
}
}
/**
* @throws CrmException
*/
public function fetchProperty(string $objectType, string $propertyId): Property
{
$result = $this->getNewInstance()->crm()->properties()->coreApi()->getByName($objectType, $propertyId);
if (! $result instanceof Property) {
$this->log->error('[Hubspot] Failed to fetch property', [
'object_type' => $objectType,
'property_id' => $propertyId,
'reason' => $result->getMessage(),
]);
throw new CrmException('Failed to fetch property');
}
return $result;
}
/**
* @return array<CrmFieldOption>
*/
public function fetchPropertyOptions(string $objectType, string $propertyId): array
{
/** @var array<CrmFieldOption> */
return $this->fetchProperty($objectType, $propertyId)->getOptions();
}
/**
* @return array<array{id:string, label:string, deleted:bool}>
*/
public function fetchCallDispositions(): array
{
/** @var Response $response */
$response = $this->getInstance()->engagements()->getCallDispositions();
/**
* @var array<array{
* id:string,
* label:string,
* deleted: bool
* }>
*/
return $response->toArray();
}
/**
* @return array<CrmFieldOption>
*/
public function fetchOpportunityPipelineStages(): array
{
$stages = [];
$apiResponse = $this->getNewInstance()->crm()->pipelines()->pipelinesApi()->getAll('deals');
if ($apiResponse instanceof Error) {
$this->log->error('[Hubspot] Failed to fetch opportunity pipelines', [
'reason' => $apiResponse->getMessage(),
]);
return [];
}
foreach ($apiResponse->getResults() as $pipeline) {
$pipelineStages = array_map(
static function (PipelineStage $stage) {
return [
'id' => $stage->getId(),
'label' => $stage->getLabel(),
];
},
$pipeline->getStages()
);
$stages = array_merge($stages, $pipelineStages);
}
return $stages;
}
public function fetchOpportunityPipelines(): array
{
$pipelines = [];
try {
$apiResponse = $this->makeRequest('/crm/v3/pipelines/deals');
} catch (\Exception $e) {
$this->log->info('[Hubspot] Failed to fetch opportunity pipelines', [
'reason' => $e->getMessage(),
]);
return [];
}
$response = $apiResponse->toArray();
foreach ($response['results'] as $pipeline) {
$pipelines[] = [
'id' => $pipeline['id'],
'label' => $pipeline['label'],
];
}
return $pipelines;
}
/**
* @return array<CrmFieldOption>
*/
public function fetchMeetingOutcomeFieldOptions(Field $field): array
{
return $field->getCrmProviderId() === 'meetingOutcome'
? $this->fetchMeetingOutcomeTypes()
: $this->fetchCallActivityTypes();
}
public function fetchMeetingOutcomeTypes(): array
{
return $this->extractMeetingTypeOptions(
'[URL_WITH_CREDENTIALS] Response $response */
$response = $this->getInstance()
->getClient()
->request('GET', $endpoint);
/**
* @var array<array{
* value: string,
* label: string,
* displayOrder: int
* }> $optionData
*/
$optionData = $response->toArray()['options'] ?? [];
$options = [];
foreach ($optionData as $item) {
$options[] = [
'id' => $item['value'],
'value' => $item['value'],
'label' => $item['label'],
'display_order' => $item['displayOrder'],
];
}
return $options;
}
/**
* @return array<CrmFieldOption>
*/
public function fetchDispositionFieldOptions(): array
{
$options = [];
$dispositions = $this->fetchCallDispositions();
foreach ($dispositions as $disposition) {
if ($disposition['deleted'] !== false) {
continue;
}
$option['value'] = $disposition['id'];
$option['id'] = $disposition['id'];
$option['label'] = $disposition['label'];
$options[] = $option;
}
return $options;
}
/**
* @return array<CrmFieldOption>
*/
public function fetchOpportunityFieldOptions(Field $field): array
{
if ($field->isStageField()) {
return $this->fetchOpportunityPipelineStages();
}
if ($field->isPipelineField()) {
return $this->fetchOpportunityPipelines();
}
return $this->fetchPropertyOptions('deals', $field->getCrmProviderId());
}
/**
* @throws BadRequest
* @throws HubspotException
*/
public function makeRequest(string $endpoint, $method = 'GET', $payload = [], ?string $queryString = null)
{
$endpoint = self::BASE_URL . $endpoint;
if ($method === 'GET') {
$response = $this->getInstance()->getClient()?->request(
method: $method,
endpoint: $endpoint,
query_string: $queryString
);
} else {
$response = $this->getInstance()->getClient()->request($method, $endpoint, [
'json' => ($payload),
]);
}
$max = $response->getHeaderLine('X-HubSpot-RateLimit-Max'); // "110"
$remaining = $response->getHeaderLine('X-HubSpot-RateLimit-Remaining'); // "109"
$interval = $response->getHeaderLine('X-HubSpot-RateLimit-Interval-Milliseconds'); // "10000"
$body = json_decode((string) $response->getBody(), true);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$max ' . PHP_EOL . print_r($max, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$remaining ' . PHP_EOL . print_r($remaining, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$interval ' . PHP_EOL . print_r($interval, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$body ' . PHP_EOL . print_r($body, true));
return $response;
}
/**
* @throws BadRequest
* @throws HubspotException
*/
public function createMeeting(array $payload): Response
{
$endpoint = '/crm/v3/objects/meetings';
return $this->makeRequest($endpoint, 'POST', $payload);
}
/**
* @throws BadRequest
* @throws HubspotException
*/
public function updateMeeting(string $meetingId, array $payload): Response
{
$endpoint = '/crm/v3/objects/meetings/' . $meetingId;
return $this->makeRequest($endpoint, 'PATCH', $payload);
}
/**
* @throws \Exception
*/
public function createNote(
string $body,
string $ownerId,
int $timestamp,
string $objectId,
NoteObject $noteObject
): ?string {
try {
$noteInput = new SimplePublicObjectInput([
'properties' => [
'hs_note_body' => $body,
'hubspot_owner_id' => $ownerId,
'hs_timestamp' => $timestamp,
],
]);
// Create note
$note = $this->getNewInstance()->crm()->objects()->basicApi()->create('note', $noteInput);
$this->getNewInstance()->crm()->objects()->associationsApi()->create(
'note',
$note->getId(),
$this->getNoteObject($noteObject),
$objectId,
$this->getNoteAssociationType($noteObject),
);
return $note->getId();
} catch (\Exception $e) {
$this->log->error('[Hubspot] Failed to create note', [
'objectId' => $objectId,
'noteObject' => $noteObject->getObjectType(),
'reason' => $e->getMessage(),
]);
\Sentry::captureException($e);
}
return null;
}
public function updateEngagement(string $objectId, array $engagement, array $metadata): void
{
$this->getInstance()->engagements()->update($objectId, $engagement, $metadata);
}
public function getEngagementData(string $engagementId): array
{
$engagement = $this->getInstance()->engagements()->get($engagementId);
return $engagement->toArray();
}
public function createEngagement(array $engagement, array $associations, array $metadata): Response
{
return $this->getInstance()
->engagements()
->create($engagement, $associations, $metadata);
}
public function isUnauthorizedException(\Exception $e): bool
{
// Check for specific HubSpot API exception types first
if ($e instanceof BadRequest) {
// BadRequest can contain 401 status codes
return $e->getCode() === 401;
}
// Check for HTTP client exceptions with status codes
if ($e instanceof \GuzzleHttp\Exception\RequestException && $e->hasResponse()) {
$response = $e->getResponse();
if ($response !== null) {
return $response->getStatusCode() === 401;
}
}
// Check for Guzzle HTTP exceptions
if ($e instanceof \GuzzleHttp\Exception\ClientException) {
return $e->getCode() === 401;
}
// Fallback to string matching as last resort, but be more specific
$message = strtolower($e->getMessage());
return str_contains($message, '401 unauthorized') ||
str_contains($message, 'http 401') ||
str_contains($message, 'status code 401') ||
(preg_match('/\b401\b/', $message) && str_contains($message, 'unauthorized'));
}
/**
* Validates and refreshes the access token if needed before API requests.
* This ensures long-running processes don't fail due to token expiration.
*
* @throws SocialAccountTokenInvalidException
*/
public function ensureValidToken(): void
{
if ($this->oauthAccount === null) {
return;
}
$newToken = $this->tokenManager->ensureValidToken($this->oauthAccount);
if ($newToken !== null) {
$this->accessToken = $newToken;
}
}
public function getConfig()
{
return $this->config;
}
// returns only active (archived=false)
public function getOwners(): array
{
return $this->getNewInstance()->crm()->owners()->getAll();
}
/**
* @param bool $archived
*
* @return array<Owner>|[]
*/
public function getOwnersArchived(bool $archived = true): array
{
$endpoint = '/crm/v3/owners';
$queryParams = [
'archived' => $archived ? 'true' : 'false',
];
$queryString = http_build_query($queryParams);
$owners = [];
try {
$response = $this->makeRequest(endpoint: $endpoint, queryString: $queryString);
$responseData = $response?->toArray();
foreach ($responseData['results'] as $result) {
try {
$owners[] = Owner::create($result);
} catch (Throwable $e) {
$this->log->error('[HubSpot] Failed to process owner data', [
'result' => $result,
'error' => $e->getMessage(),
]);
continue;
}
}
} catch (Throwable $e) {
$this->log->error('HubSpot] Failed to fetch owners', [
'archived' => $archived,
'error' => $e->getMessage(),
]);
return [];
}
return $owners;
}
public function getMeeting(string $engagementId): ObjectWithAssociations
{
return $this->getNewInstance()->crm()->objects()->basicApi()
->getById('meeting', $engagementId, null, 'contact,company,deal');
}
public function deleteEngagement(string $engagementId): void
{
$this->getInstance()->engagements()->delete((int) $engagementId);
}
public function getAssociationsData(array $ids, string $fromObject, string $toObject): array
{
$associationData = [];
$idChunks = array_chunk($ids, self::ASSOCIATIONS_BATCH_SIZE_LIMIT);
foreach ($idChunks as $idChunk) {
try {
$batchInput = new \HubSpot\Client\Crm\Associations\Model\BatchInputPublicObjectId();
$batchInput->setInputs(array_map(function ($id) {
$publicObjectId = new \HubSpot\Client\Crm\Associations\Model\PublicObjectId();
$publicObjectId->setId($id);
return $publicObjectId;
}, $idChunk));
$associatedObjectsData = $this
->getNewInstance()
->crm()
->associations()
->batchApi()
->read($fromObject, $toObject, $batchInput);
if ($associatedObjectsData instanceof \HubSpot\Client\Crm\Associations\Model\BatchResponsePublicAssociationMulti) {
foreach ($associatedObjectsData->getResults() as $association) {
$from = $association->getFrom()->getId();
$toAssociations = $association->getTo();
if (! empty($toAssociations)) {
$associationData[$from] = array_map(function ($item) {
return $item->getId();
}, $toAssociations);
}
}
}
} catch (\Exception $e) {
$this->log->error('[Hubspot] Failed to fetch associations', [
'from_object' => $fromObject,
'to_object' => $toObject,
'reason' => $e->getMessage(),
]);
}
}
return $associationData;
}
/**
* @throws \Exception
*/
private function getNoteAssociationType(NoteObject $noteObject): string
{
return match($noteObject) {
NoteObject::Opportunity => 'note_to_deal',
NoteObject::Lead, NoteObject::Contact => 'note_to_contact', // or 'note_to_lead' if your portal supports it
NoteObject::Account => 'note_to_company',
NoteObject::Call, NoteObject::Event => throw new \Exception('Not supported'),
};
}
/**
* @throws \Exception
*/
private function getNoteObject(NoteObject $noteObject): string
{
return match($noteObject) {
NoteObject::Opportunity => 'deal',
NoteObject::Lead, NoteObject::Contact => 'contact',
NoteObject::Account => 'company',
NoteObject::Call, NoteObject::Event => throw new \Exception('Not supported'),
};
}
public function addAssociations(string $objectType, string $associationType, array $payload): Response
{
$endpoint = "/crm/v4/associations/$objectType/$associationType/batch/create";
return $this->makeRequest($endpoint, 'POST', $payload);
}
public function removeAssociations(string $objectType, string $associationType, array $payload): Response
{
$endpoint = "/crm/v4/associations/$objectType/$associationType/batch/archive";
return $this->makeRequest($endpoint, 'POST', $payload);
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
3586
|
|
3587
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
2
68
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Crm\Hubspot;
use HubSpot\Client\Crm\Deals\ApiException as DealApiException;
use HubSpot\Client\Crm\Contacts\ApiException as ContactApiException;
use HubSpot\Client\Crm\Companies\ApiException as CompanyApiException;
use HubSpot\Client\Crm\Contacts\Model\SimplePublicObjectWithAssociations as ContactsWithAssociations;
use HubSpot\Client\Crm\Companies\Model\SimplePublicObjectWithAssociations as CompaniesWithAssociations;
use HubSpot\Client\Crm\Deals\Model\SimplePublicObjectWithAssociations as DealWithAssociations;
use HubSpot\Client\Crm\Objects\Model\SimplePublicObjectInput;
use HubSpot\Client\Crm\Objects\Model\SimplePublicObjectWithAssociations as ObjectWithAssociations;
use HubSpot\Client\Crm\Pipelines\Model\Error;
use HubSpot\Client\Crm\Pipelines\Model\PipelineStage;
use HubSpot\Client\Crm\Properties\Model\Property;
use HubSpot\Discovery\Discovery;
use Jiminny\Component\Utility\Service\ProviderRateLimiter;
use Jiminny\Exceptions\CrmException;
use Jiminny\Exceptions\RateLimitException;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Jobs\Crm\NoteObject;
use Jiminny\Models\Crm\Field;
use Jiminny\Services\Crm\BaseClient;
use Jiminny\Services\Crm\Hubspot\DTO\Response\Owner;
use Jiminny\Services\SocialAccountService;
use SevenShores\Hubspot\Exceptions\BadRequest;
use SevenShores\Hubspot\Exceptions\HubspotException;
use SevenShores\Hubspot\Factory;
use SevenShores\Hubspot\Http\Response;
use Jiminny\Services\Crm\Hubspot\Pagination\HubspotPaginationService;
use Throwable;
/**
* @phpstan-type CrmFieldOption array{id:string, label:string, value?:string}
*/
class Client extends BaseClient implements HubspotClientInterface
{
public const string MIN_API_VERSION = '2';
public const string BASE_URL = '[URL_WITH_CREDENTIALS] T
* @param callable(): T $apiCall
* @return T
*
* @throws RateLimitException
*/
private function executeRequest(callable $apiCall)
{
if (! $this->rateLimiter->canMakeRequest($this->config)) {
$retryAfter = $this->rateLimiter->requestAvailableIn($this->config);
$this->log->warning('[Hubspot] Rate limit exceeded, deferring request', [
'team_id' => $this->config->team_id,
'config_id' => $this->config->getId(),
'retry_after' => $retryAfter,
]);
throw new RateLimitException(
'Hubspot rate limit reached for configuration ' . $this->config->getId(),
$retryAfter,
);
}
$this->rateLimiter->incrementRequestCount($this->config);
try {
return $apiCall();
} catch (Throwable $e) {
if ($this->isHubspotRateLimit($e)) {
$retryAfter = $this->parseRetryAfter($e);
$this->log->warning('[Hubspot] Received 429 from API', [
'team_id' => $this->config->team_id,
'config_id' => $this->config->getId(),
'retry_after' => $retryAfter,
'reason' => $e->getMessage(),
]);
throw new RateLimitException('Hubspot returned 429', $retryAfter, $e);
}
throw $e;
}
}
private function isHubspotRateLimit(Throwable $e): bool
{
return method_exists($e, 'getCode') && (int) $e->getCode() === 429;
}
private function parseRetryAfter(Throwable $e): int
{
if (method_exists($e, 'getResponseHeaders')) {
$headers = $e->getResponseHeaders() ?: [];
$value = $headers['Retry-After'] ?? $headers['retry-after'] ?? null;
if (is_array($value)) {
$value = $value[0] ?? null;
}
if (is_numeric($value)) {
return (int) $value;
}
}
return 10;
}
public function getMinimumApiVersion(): string
{
return self::MIN_API_VERSION;
}
public function getInstance(): Factory
{
return new Factory([
'key' => $this->accessToken,
'oauth2' => true,
'base_url' => $this->baseUrl,
]);
}
public function getNewInstance(): Discovery
{
return \HubSpot\Factory::createWithAccessToken($this->accessToken);
}
/**
* Secondly and daily limits for Hubspot API
*
* Product Tier: Free & Starter | Professional & Enterprise | API add-on (any tier)
* Burst: 100/10 seconds | 150/10 seconds | 200/10 seconds
* Daily: 250,000 | 500,000 | 1,000,000
*
* Official documentation states: The search endpoints are rate limited to five requests per second.
* Since with 5 RPS were still hitting secondly rate limits we lowered it to 4
*/
public function getPaginatedData(array $payload, string $type, int $offset = 0): array
{
$total = 0;
$lastId = null;
$rows = [];
foreach ($this->getPaginatedDataGenerator($payload, $type, $offset, $total, $lastId) as $row) {
$rows[] = $row;
}
return ['results' => $rows, 'total' => $total, 'last_record' => $lastId];
}
/**
* @throws HubspotException
* @throws SocialAccountTokenInvalidException
* @throws BadRequest
*/
public function getPaginatedDataGenerator(
array $payload,
string $type,
int $offset = 0,
int &$total = 0,
?string &$lastRecordId = null
): \Generator {
return $this->paginationService->getPaginatedDataGenerator(
$this,
$payload,
$type,
$offset,
$total,
$lastRecordId
);
}
/**
* @throws DealApiException
* @throws CrmException
*/
public function getOpportunityById(string $crmId, array $fields): array
{
try {
// $deal = $this->executeRequest(fn () => $this->getNewInstance()->crm()->deals()->basicApi()->getById(
$deal = $this->getNewInstance()->crm()->deals()->basicApi()->getById(
$crmId,
implode(',', $fields),
'companies,contacts'
);
} catch (DealApiException $e) {
$this->log->info('[Hubspot] Failed to fetch opportunity', [
'crm_id' => $crmId,
'reason' => $e->getMessage(),
]);
throw $e;
}
if (! $deal instanceof DealWithAssociations) {
throw new CrmException('Deal not found');
}
return [
'id' => $deal->getId(),
'properties' => $deal->getProperties(),
'associations' => $deal->getAssociations(),
];
}
/**
* Generic batch read method for HubSpot objects
*
* @param string $objectType The object type ('deals', 'companies', 'contacts')
* @param array<string> $crmIds Array of HubSpot object IDs (max 100)
* @param array<string> $fields Array of property names to fetch
*
* @return array<string, array> Array keyed by CRM ID with object data
*/
private function batchReadObjects(string $objectType, array $crmIds, array $fields): array
{
if (empty($crmIds)) {
return [];
}
$this->validateBatchSize($objectType, $crmIds);
$this->ensureValidToken();
try {
$batchConfig = $this->createBatchConfiguration($objectType);
$batchReadRequest = $this->prepareBatchRequest($batchConfig, $crmIds, $fields);
$response = $batchConfig['api']->read($batchReadRequest);
$this->validateApiResponse($response, $objectType);
$results = $this->processApiResults($response);
$this->logBatchResults($objectType, $crmIds, $results);
return $results;
} catch (\Throwable $e) {
$this->handleBatchError($e, $objectType, $crmIds);
}
}
private function validateBatchSize(string $objectType, array $crmIds): void
{
if (count($crmIds) > 100) {
throw new \InvalidArgumentException("Batch size cannot exceed 100 {$objectType}");
}
}
private function createBatchConfiguration(string $objectType): array
{
$configurations = [
'deals' => [
'batchReadRequest' => new \HubSpot\Client\Crm\Deals\Model\BatchReadInputSimplePublicObjectId(),
'inputClass' => \HubSpot\Client\Crm\Deals\Model\SimplePublicObjectId::class,
'api' => $this->getNewInstance()->crm()->deals()->batchApi(),
],
'companies' => [
'batchReadRequest' => new \HubSpot\Client\Crm\Companies\Model\BatchReadInputSimplePublicObjectId(),
'inputClass' => \HubSpot\Client\Crm\Companies\Model\SimplePublicObjectId::class,
'api' => $this->getNewInstance()->crm()->companies()->batchApi(),
],
'contacts' => [
'batchReadRequest' => new \HubSpot\Client\Crm\Contacts\Model\BatchReadInputSimplePublicObjectId(),
'inputClass' => \HubSpot\Client\Crm\Contacts\Model\SimplePublicObjectId::class,
'api' => $this->getNewInstance()->crm()->contacts()->batchApi(),
],
];
if (! isset($configurations[$objectType])) {
throw new \InvalidArgumentException("Unsupported object type: {$objectType}");
}
return $configurations[$objectType];
}
private function prepareBatchRequest(array $batchConfig, array $crmIds, array $fields): object
{
$batchReadRequest = $batchConfig['batchReadRequest'];
$inputClass = $batchConfig['inputClass'];
$inputs = array_map(function ($crmId) use ($inputClass) {
$input = new $inputClass();
$input->setId($crmId);
return $input;
}, $crmIds);
$batchReadRequest->setInputs($inputs);
$batchReadRequest->setProperties($fields);
return $batchReadRequest;
}
private function validateApiResponse($response, string $objectType): void
{
if (! $response) {
throw new CrmException("HubSpot API returned null response for {$objectType} batch read");
}
}
private function processApiResults($response): array
{
$results = [];
$responseResults = $response->getResults();
if ($responseResults) {
foreach ($responseResults as $object) {
if ($object && $object->getId()) {
$results[$object->getId()] = [
'id' => $object->getId(),
'properties' => $object->getProperties() ?: [],
];
}
}
}
return $results;
}
private function logBatchResults(string $objectType, array $crmIds, array $results): void
{
$this->log->info("[HubSpot] Batch fetched {$objectType}", [
'requested_count' => count($crmIds),
'returned_count' => count($results),
'crm_ids' => $crmIds,
]);
}
private function handleBatchError(\Throwable $e, string $objectType, array $crmIds): void
{
$errorMessage = $e->getMessage() ?: 'Unknown error';
$errorTrace = $e->getTraceAsString() ?: 'No trace available';
$this->log->error("[HubSpot] Failed to batch fetch {$objectType}", [
'crm_ids' => $crmIds,
'error' => $errorMessage,
'trace' => $errorTrace,
]);
throw new CrmException("Failed to batch fetch {$objectType}: " . $errorMessage);
}
/**
* Batch read multiple opportunities by their CRM IDs
*
* @param array<string> $crmIds Array of HubSpot deal IDs (max 100)
* @param array<string> $fields Array of property names to fetch
*
* @return array<string, array> Array keyed by CRM ID with opportunity data
*/
public function getOpportunitiesByIds(array $crmIds, array $fields): array
{
return $this->batchReadObjects('deals', $crmIds, $fields);
}
/**
* Batch read multiple companies by their CRM IDs
*
* @param array<string> $crmIds Array of HubSpot company IDs (max 100)
* @param array<string> $fields Array of property names to fetch
*
* @return array<string, array> Array keyed by CRM ID with company data
*/
public function getCompaniesByIds(array $crmIds, array $fields): array
{
return $this->batchReadObjects('companies', $crmIds, $fields);
}
/**
* Batch read multiple contacts by their CRM IDs
*
* @param array<string> $crmIds Array of HubSpot contact IDs (max 100)
* @param array<string> $fields Array of property names to fetch
*
* @return array<string, array> Array keyed by CRM ID with contact data
*/
public function getContactsByIds(array $crmIds, array $fields): array
{
return $this->batchReadObjects('contacts', $crmIds, $fields);
}
/**
* @throws CompanyApiException
* @throws CrmException
*/
public function getAccountById(string $crmId, array $fields): array
{
try {
$company = $this->getNewInstance()->crm()->companies()->basicApi()->getById(
$crmId,
implode(',', $fields),
);
} catch (CompanyApiException $e) {
$this->log->info('[Hubspot] Failed to fetch account', [
'crm_id' => $crmId,
'reason' => $e->getMessage(),
]);
throw $e;
}
if (! $company instanceof CompaniesWithAssociations) {
throw new CrmException('Account not found');
}
return [
'id' => $company->getId(),
'properties' => $company->getProperties(),
];
}
/**
* @throws ContactApiException
* @throws CrmException
*/
public function getContactById(string $crmId, array $fields): array
{
try {
$contact = $this->getNewInstance()->crm()->contacts()->basicApi()->getById(
$crmId,
implode(',', $fields)
);
} catch (ContactApiException $e) {
$this->log->info('[Hubspot] Failed to fetch contact', [
'crm_id' => $crmId,
'reason' => $e->getMessage(),
]);
throw $e;
}
if (! $contact instanceof ContactsWithAssociations) {
throw new CrmException('Contact not found');
}
return [
'id' => $contact->getId(),
'properties' => $contact->getProperties(),
];
}
/**
* This is email search request that Hubspot offers as GET (more generous quota)
*/
public function getContactByEmail(string $email, array $fields = []): array
{
try {
$contact = $this->getNewInstance()->crm()->contacts()->basicApi()->getById(
$email,
implode(',', $fields),
null,
false,
'email'
);
return [
'id' => $contact->getId(),
'properties' => $contact->getProperties(),
];
} catch (ContactApiException $e) {
$this->log->info('[Hubspot] Failed to fetch contact', [
'email' => $email,
'reason' => $e->getMessage(),
]);
return [];
}
}
/**
* @throws CrmException
*/
public function fetchProperty(string $objectType, string $propertyId): Property
{
$result = $this->getNewInstance()->crm()->properties()->coreApi()->getByName($objectType, $propertyId);
if (! $result instanceof Property) {
$this->log->error('[Hubspot] Failed to fetch property', [
'object_type' => $objectType,
'property_id' => $propertyId,
'reason' => $result->getMessage(),
]);
throw new CrmException('Failed to fetch property');
}
return $result;
}
/**
* @return array<CrmFieldOption>
*/
public function fetchPropertyOptions(string $objectType, string $propertyId): array
{
/** @var array<CrmFieldOption> */
return $this->fetchProperty($objectType, $propertyId)->getOptions();
}
/**
* @return array<array{id:string, label:string, deleted:bool}>
*/
public function fetchCallDispositions(): array
{
/** @var Response $response */
$response = $this->getInstance()->engagements()->getCallDispositions();
/**
* @var array<array{
* id:string,
* label:string,
* deleted: bool
* }>
*/
return $response->toArray();
}
/**
* @return array<CrmFieldOption>
*/
public function fetchOpportunityPipelineStages(): array
{
$stages = [];
$apiResponse = $this->getNewInstance()->crm()->pipelines()->pipelinesApi()->getAll('deals');
if ($apiResponse instanceof Error) {
$this->log->error('[Hubspot] Failed to fetch opportunity pipelines', [
'reason' => $apiResponse->getMessage(),
]);
return [];
}
foreach ($apiResponse->getResults() as $pipeline) {
$pipelineStages = array_map(
static function (PipelineStage $stage) {
return [
'id' => $stage->getId(),
'label' => $stage->getLabel(),
];
},
$pipeline->getStages()
);
$stages = array_merge($stages, $pipelineStages);
}
return $stages;
}
public function fetchOpportunityPipelines(): array
{
$pipelines = [];
try {
$apiResponse = $this->makeRequest('/crm/v3/pipelines/deals');
} catch (\Exception $e) {
$this->log->info('[Hubspot] Failed to fetch opportunity pipelines', [
'reason' => $e->getMessage(),
]);
return [];
}
$response = $apiResponse->toArray();
foreach ($response['results'] as $pipeline) {
$pipelines[] = [
'id' => $pipeline['id'],
'label' => $pipeline['label'],
];
}
return $pipelines;
}
/**
* @return array<CrmFieldOption>
*/
public function fetchMeetingOutcomeFieldOptions(Field $field): array
{
return $field->getCrmProviderId() === 'meetingOutcome'
? $this->fetchMeetingOutcomeTypes()
: $this->fetchCallActivityTypes();
}
public function fetchMeetingOutcomeTypes(): array
{
return $this->extractMeetingTypeOptions(
'[URL_WITH_CREDENTIALS] Response $response */
$response = $this->getInstance()
->getClient()
->request('GET', $endpoint);
/**
* @var array<array{
* value: string,
* label: string,
* displayOrder: int
* }> $optionData
*/
$optionData = $response->toArray()['options'] ?? [];
$options = [];
foreach ($optionData as $item) {
$options[] = [
'id' => $item['value'],
'value' => $item['value'],
'label' => $item['label'],
'display_order' => $item['displayOrder'],
];
}
return $options;
}
/**
* @return array<CrmFieldOption>
*/
public function fetchDispositionFieldOptions(): array
{
$options = [];
$dispositions = $this->fetchCallDispositions();
foreach ($dispositions as $disposition) {
if ($disposition['deleted'] !== false) {
continue;
}
$option['value'] = $disposition['id'];
$option['id'] = $disposition['id'];
$option['label'] = $disposition['label'];
$options[] = $option;
}
return $options;
}
/**
* @return array<CrmFieldOption>
*/
public function fetchOpportunityFieldOptions(Field $field): array
{
if ($field->isStageField()) {
return $this->fetchOpportunityPipelineStages();
}
if ($field->isPipelineField()) {
return $this->fetchOpportunityPipelines();
}
return $this->fetchPropertyOptions('deals', $field->getCrmProviderId());
}
/**
* @throws BadRequest
* @throws HubspotException
*/
public function makeRequest(string $endpoint, $method = 'GET', $payload = [], ?string $queryString = null)
{
$endpoint = self::BASE_URL . $endpoint;
if ($method === 'GET') {
$response = $this->getInstance()->getClient()?->request(
method: $method,
endpoint: $endpoint,
query_string: $queryString
);
} else {
$response = $this->getInstance()->getClient()->request($method, $endpoint, [
'json' => ($payload),
]);
}
$max = $response->getHeaderLine('X-HubSpot-RateLimit-Max'); // "110"
$remaining = $response->getHeaderLine('X-HubSpot-RateLimit-Remaining'); // "109"
$interval = $response->getHeaderLine('X-HubSpot-RateLimit-Interval-Milliseconds'); // "10000"
$body = json_decode((string) $response->getBody(), true);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$max ' . PHP_EOL . print_r($max, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$remaining ' . PHP_EOL . print_r($remaining, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$interval ' . PHP_EOL . print_r($interval, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$body ' . PHP_EOL . print_r($body, true));
return $response;
}
/**
* @throws BadRequest
* @throws HubspotException
*/
public function createMeeting(array $payload): Response
{
$endpoint = '/crm/v3/objects/meetings';
return $this->makeRequest($endpoint, 'POST', $payload);
}
/**
* @throws BadRequest
* @throws HubspotException
*/
public function updateMeeting(string $meetingId, array $payload): Response
{
$endpoint = '/crm/v3/objects/meetings/' . $meetingId;
return $this->makeRequest($endpoint, 'PATCH', $payload);
}
/**
* @throws \Exception
*/
public function createNote(
string $body,
string $ownerId,
int $timestamp,
string $objectId,
NoteObject $noteObject
): ?string {
try {
$noteInput = new SimplePublicObjectInput([
'properties' => [
'hs_note_body' => $body,
'hubspot_owner_id' => $ownerId,
'hs_timestamp' => $timestamp,
],
]);
// Create note
$note = $this->getNewInstance()->crm()->objects()->basicApi()->create('note', $noteInput);
$this->getNewInstance()->crm()->objects()->associationsApi()->create(
'note',
$note->getId(),
$this->getNoteObject($noteObject),
$objectId,
$this->getNoteAssociationType($noteObject),
);
return $note->getId();
} catch (\Exception $e) {
$this->log->error('[Hubspot] Failed to create note', [
'objectId' => $objectId,
'noteObject' => $noteObject->getObjectType(),
'reason' => $e->getMessage(),
]);
\Sentry::captureException($e);
}
return null;
}
public function updateEngagement(string $objectId, array $engagement, array $metadata): void
{
$this->getInstance()->engagements()->update($objectId, $engagement, $metadata);
}
public function getEngagementData(string $engagementId): array
{
$engagement = $this->getInstance()->engagements()->get($engagementId);
return $engagement->toArray();
}
public function createEngagement(array $engagement, array $associations, array $metadata): Response
{
return $this->getInstance()
->engagements()
->create($engagement, $associations, $metadata);
}
public function isUnauthorizedException(\Exception $e): bool
{
// Check for specific HubSpot API exception types first
if ($e instanceof BadRequest) {
// BadRequest can contain 401 status codes
return $e->getCode() === 401;
}
// Check for HTTP client exceptions with status codes
if ($e instanceof \GuzzleHttp\Exception\RequestException && $e->hasResponse()) {
$response = $e->getResponse();
if ($response !== null) {
return $response->getStatusCode() === 401;
}
}
// Check for Guzzle HTTP exceptions
if ($e instanceof \GuzzleHttp\Exception\ClientException) {
return $e->getCode() === 401;
}
// Fallback to string matching as last resort, but be more specific
$message = strtolower($e->getMessage());
return str_contains($message, '401 unauthorized') ||
str_contains($message, 'http 401') ||
str_contains($message, 'status code 401') ||
(preg_match('/\b401\b/', $message) && str_contains($message, 'unauthorized'));
}
/**
* Validates and refreshes the access token if needed before API requests.
* This ensures long-running processes don't fail due to token expiration.
*
* @throws SocialAccountTokenInvalidException
*/
public function ensureValidToken(): void
{
if ($this->oauthAccount === null) {
return;
}
$newToken = $this->tokenManager->ensureValidToken($this->oauthAccount);
if ($newToken !== null) {
$this->accessToken = $newToken;
}
}
public function getConfig()
{
return $this->config;
}
// returns only active (archived=false)
public function getOwners(): array
{
return $this->getNewInstance()->crm()->owners()->getAll();
}
/**
* @param bool $archived
*
* @return array<Owner>|[]
*/
public function getOwnersArchived(bool $archived = true): array
{
$endpoint = '/crm/v3/owners';
$queryParams = [
'archived' => $archived ? 'true' : 'false',
];
$queryString = http_build_query($queryParams);
$owners = [];
try {
$response = $this->makeRequest(endpoint: $endpoint, queryString: $queryString);
$responseData = $response?->toArray();
foreach ($responseData['results'] as $result) {
try {
$owners[] = Owner::create($result);
} catch (Throwable $e) {
$this->log->error('[HubSpot] Failed to process owner data', [
'result' => $result,
'error' => $e->getMessage(),
]);
continue;
}
}
} catch (Throwable $e) {
$this->log->error('HubSpot] Failed to fetch owners', [
'archived' => $archived,
'error' => $e->getMessage(),
]);
return [];
}
return $owners;
}
public function getMeeting(string $engagementId): ObjectWithAssociations
{
return $this->getNewInstance()->crm()->objects()->basicApi()
->getById('meeting', $engagementId, null, 'contact,company,deal');
}
public function deleteEngagement(string $engagementId): void
{
$this->getInstance()->engagements()->delete((int) $engagementId);
}
public function getAssociationsData(array $ids, string $fromObject, string $toObject): array
{
$associationData = [];
$idChunks = array_chunk($ids, self::ASSOCIATIONS_BATCH_SIZE_LIMIT);
foreach ($idChunks as $idChunk) {
try {
$batchInput = new \HubSpot\Client\Crm\Associations\Model\BatchInputPublicObjectId();
$batchInput->setInputs(array_map(function ($id) {
$publicObjectId = new \HubSpot\Client\Crm\Associations\Model\PublicObjectId();
$publicObjectId->setId($id);
return $publicObjectId;
}, $idChunk));
$associatedObjectsData = $this
->getNewInstance()
->crm()
->associations()
->batchApi()
->read($fromObject, $toObject, $batchInput);
if ($associatedObjectsData instanceof \HubSpot\Client\Crm\Associations\Model\BatchResponsePublicAssociationMulti) {
foreach ($associatedObjectsData->getResults() as $association) {
$from = $association->getFrom()->getId();
$toAssociations = $association->getTo();
if (! empty($toAssociations)) {
$associationData[$from] = array_map(function ($item) {
return $item->getId();
}, $toAssociations);
}
}
}
} catch (\Exception $e) {
$this->log->error('[Hubspot] Failed to fetch associations', [
'from_object' => $fromObject,
'to_object' => $toObject,
'reason' => $e->getMessage(),
]);
}
}
return $associationData;
}
/**
* @throws \Exception
*/
private function getNoteAssociationType(NoteObject $noteObject): string
{
return match($noteObject) {
NoteObject::Opportunity => 'note_to_deal',
NoteObject::Lead, NoteObject::Contact => 'note_to_contact', // or 'note_to_lead' if your portal supports it
NoteObject::Account => 'note_to_company',
NoteObject::Call, NoteObject::Event => throw new \Exception('Not supported'),
};
}
/**
* @throws \Exception
*/
private function getNoteObject(NoteObject $noteObject): string
{
return match($noteObject) {
NoteObject::Opportunity => 'deal',
NoteObject::Lead, NoteObject::Contact => 'contact',
NoteObject::Account => 'company',
NoteObject::Call, NoteObject::Event => throw new \Exception('Not supported'),
};
}
public function addAssociations(string $objectType, string $associationType, array $payload): Response
{
$endpoint = "/crm/v4/associations/$objectType/$associationType/batch/create";
return $this->makeRequest($endpoint, 'POST', $payload);
}
public function removeAssociations(string $objectType, string $associationType, array $payload): Response
{
$endpoint = "/crm/v4/associations/$objectType/$associationType/batch/archive";
return $this->makeRequest($endpoint, 'POST', $payload);
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
3587
|
|
3588
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Editor for custom.log
Sync Changes
Hide This Notification
Code changed:
Hide
2
68
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Crm\Hubspot;
use HubSpot\Client\Crm\Deals\ApiException as DealApiException;
use HubSpot\Client\Crm\Contacts\ApiException as ContactApiException;
use HubSpot\Client\Crm\Companies\ApiException as CompanyApiException;
use HubSpot\Client\Crm\Contacts\Model\SimplePublicObjectWithAssociations as ContactsWithAssociations;
use HubSpot\Client\Crm\Companies\Model\SimplePublicObjectWithAssociations as CompaniesWithAssociations;
use HubSpot\Client\Crm\Deals\Model\SimplePublicObjectWithAssociations as DealWithAssociations;
use HubSpot\Client\Crm\Objects\Model\SimplePublicObjectInput;
use HubSpot\Client\Crm\Objects\Model\SimplePublicObjectWithAssociations as ObjectWithAssociations;
use HubSpot\Client\Crm\Pipelines\Model\Error;
use HubSpot\Client\Crm\Pipelines\Model\PipelineStage;
use HubSpot\Client\Crm\Properties\Model\Property;
use HubSpot\Discovery\Discovery;
use Jiminny\Component\Utility\Service\ProviderRateLimiter;
use Jiminny\Exceptions\CrmException;
use Jiminny\Exceptions\RateLimitException;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Jobs\Crm\NoteObject;
use Jiminny\Models\Crm\Field;
use Jiminny\Services\Crm\BaseClient;
use Jiminny\Services\Crm\Hubspot\DTO\Response\Owner;
use Jiminny\Services\SocialAccountService;
use SevenShores\Hubspot\Exceptions\BadRequest;
use SevenShores\Hubspot\Exceptions\HubspotException;
use SevenShores\Hubspot\Factory;
use SevenShores\Hubspot\Http\Response;
use Jiminny\Services\Crm\Hubspot\Pagination\HubspotPaginationService;
use Throwable;
/**
* @phpstan-type CrmFieldOption array{id:string, label:string, value?:string}
*/
class Client extends BaseClient implements HubspotClientInterface
{
public const string MIN_API_VERSION = '2';
public const string BASE_URL = '[URL_WITH_CREDENTIALS] T
* @param callable(): T $apiCall
* @return T
*
* @throws RateLimitException
*/
private function executeRequest(callable $apiCall)
{
if (! $this->rateLimiter->canMakeRequest($this->config)) {
$retryAfter = $this->rateLimiter->requestAvailableIn($this->config);
$this->log->warning('[Hubspot] Rate limit exceeded, deferring request', [
'team_id' => $this->config->team_id,
'config_id' => $this->config->getId(),
'retry_after' => $retryAfter,
]);
throw new RateLimitException(
'Hubspot rate limit reached for configuration ' . $this->config->getId(),
$retryAfter,
);
}
$this->rateLimiter->incrementRequestCount($this->config);
try {
return $apiCall();
} catch (Throwable $e) {
if ($this->isHubspotRateLimit($e)) {
$retryAfter = $this->parseRetryAfter($e);
$this->log->warning('[Hubspot] Received 429 from API', [
'team_id' => $this->config->team_id,
'config_id' => $this->config->getId(),
'retry_after' => $retryAfter,
'reason' => $e->getMessage(),
]);
throw new RateLimitException('Hubspot returned 429', $retryAfter, $e);
}
throw $e;
}
}
private function isHubspotRateLimit(Throwable $e): bool
{
return method_exists($e, 'getCode') && (int) $e->getCode() === 429;
}
private function parseRetryAfter(Throwable $e): int
{
if (method_exists($e, 'getResponseHeaders')) {
$headers = $e->getResponseHeaders() ?: [];
$value = $headers['Retry-After'] ?? $headers['retry-after'] ?? null;
if (is_array($value)) {
$value = $value[0] ?? null;
}
if (is_numeric($value)) {
return (int) $value;
}
}
return 10;
}
public function getMinimumApiVersion(): string
{
return self::MIN_API_VERSION;
}
public function getInstance(): Factory
{
return new Factory([
'key' => $this->accessToken,
'oauth2' => true,
'base_url' => $this->baseUrl,
]);
}
public function getNewInstance(): Discovery
{
return \HubSpot\Factory::createWithAccessToken($this->accessToken);
}
/**
* Secondly and daily limits for Hubspot API
*
* Product Tier: Free & Starter | Professional & Enterprise | API add-on (any tier)
* Burst: 100/10 seconds | 150/10 seconds | 200/10 seconds
* Daily: 250,000 | 500,000 | 1,000,000
*
* Official documentation states: The search endpoints are rate limited to five requests per second.
* Since with 5 RPS were still hitting secondly rate limits we lowered it to 4
*/
public function getPaginatedData(array $payload, string $type, int $offset = 0): array
{
$total = 0;
$lastId = null;
$rows = [];
foreach ($this->getPaginatedDataGenerator($payload, $type, $offset, $total, $lastId) as $row) {
$rows[] = $row;
}
return ['results' => $rows, 'total' => $total, 'last_record' => $lastId];
}
/**
* @throws HubspotException
* @throws SocialAccountTokenInvalidException
* @throws BadRequest
*/
public function getPaginatedDataGenerator(
array $payload,
string $type,
int $offset = 0,
int &$total = 0,
?string &$lastRecordId = null
): \Generator {
return $this->paginationService->getPaginatedDataGenerator(
$this,
$payload,
$type,
$offset,
$total,
$lastRecordId
);
}
/**
* @throws DealApiException
* @throws CrmException
*/
public function getOpportunityById(string $crmId, array $fields): array
{
try {
// $deal = $this->executeRequest(fn () => $this->getNewInstance()->crm()->deals()->basicApi()->getById(
$deal = $this->getNewInstance()->crm()->deals()->basicApi()->getById(
$crmId,
implode(',', $fields),
'companies,contacts'
);
} catch (DealApiException $e) {
$this->log->info('[Hubspot] Failed to fetch opportunity', [
'crm_id' => $crmId,
'reason' => $e->getMessage(),
]);
throw $e;
}
if (! $deal instanceof DealWithAssociations) {
throw new CrmException('Deal not found');
}
return [
'id' => $deal->getId(),
'properties' => $deal->getProperties(),
'associations' => $deal->getAssociations(),
];
}
/**
* Generic batch read method for HubSpot objects
*
* @param string $objectType The object type ('deals', 'companies', 'contacts')
* @param array<string> $crmIds Array of HubSpot object IDs (max 100)
* @param array<string> $fields Array of property names to fetch
*
* @return array<string, array> Array keyed by CRM ID with object data
*/
private function batchReadObjects(string $objectType, array $crmIds, array $fields): array
{
if (empty($crmIds)) {
return [];
}
$this->validateBatchSize($objectType, $crmIds);
$this->ensureValidToken();
try {
$batchConfig = $this->createBatchConfiguration($objectType);
$batchReadRequest = $this->prepareBatchRequest($batchConfig, $crmIds, $fields);
$response = $batchConfig['api']->read($batchReadRequest);
$this->validateApiResponse($response, $objectType);
$results = $this->processApiResults($response);
$this->logBatchResults($objectType, $crmIds, $results);
return $results;
} catch (\Throwable $e) {
$this->handleBatchError($e, $objectType, $crmIds);
}
}
private function validateBatchSize(string $objectType, array $crmIds): void
{
if (count($crmIds) > 100) {
throw new \InvalidArgumentException("Batch size cannot exceed 100 {$objectType}");
}
}
private function createBatchConfiguration(string $objectType): array
{
$configurations = [
'deals' => [
'batchReadRequest' => new \HubSpot\Client\Crm\Deals\Model\BatchReadInputSimplePublicObjectId(),
'inputClass' => \HubSpot\Client\Crm\Deals\Model\SimplePublicObjectId::class,
'api' => $this->getNewInstance()->crm()->deals()->batchApi(),
],
'companies' => [
'batchReadRequest' => new \HubSpot\Client\Crm\Companies\Model\BatchReadInputSimplePublicObjectId(),
'inputClass' => \HubSpot\Client\Crm\Companies\Model\SimplePublicObjectId::class,
'api' => $this->getNewInstance()->crm()->companies()->batchApi(),
],
'contacts' => [
'batchReadRequest' => new \HubSpot\Client\Crm\Contacts\Model\BatchReadInputSimplePublicObjectId(),
'inputClass' => \HubSpot\Client\Crm\Contacts\Model\SimplePublicObjectId::class,
'api' => $this->getNewInstance()->crm()->contacts()->batchApi(),
],
];
if (! isset($configurations[$objectType])) {
throw new \InvalidArgumentException("Unsupported object type: {$objectType}");
}
return $configurations[$objectType];
}
private function prepareBatchRequest(array $batchConfig, array $crmIds, array $fields): object
{
$batchReadRequest = $batchConfig['batchReadRequest'];
$inputClass = $batchConfig['inputClass'];
$inputs = array_map(function ($crmId) use ($inputClass) {
$input = new $inputClass();
$input->setId($crmId);
return $input;
}, $crmIds);
$batchReadRequest->setInputs($inputs);
$batchReadRequest->setProperties($fields);
return $batchReadRequest;
}
private function validateApiResponse($response, string $objectType): void
{
if (! $response) {
throw new CrmException("HubSpot API returned null response for {$objectType} batch read");
}
}
private function processApiResults($response): array
{
$results = [];
$responseResults = $response->getResults();
if ($responseResults) {
foreach ($responseResults as $object) {
if ($object && $object->getId()) {
$results[$object->getId()] = [
'id' => $object->getId(),
'properties' => $object->getProperties() ?: [],
];
}
}
}
return $results;
}
private function logBatchResults(string $objectType, array $crmIds, array $results): void
{
$this->log->info("[HubSpot] Batch fetched {$objectType}", [
'requested_count' => count($crmIds),
'returned_count' => count($results),
'crm_ids' => $crmIds,
]);
}
private function handleBatchError(\Throwable $e, string $objectType, array $crmIds): void
{
$errorMessage = $e->getMessage() ?: 'Unknown error';
$errorTrace = $e->getTraceAsString() ?: 'No trace available';
$this->log->error("[HubSpot] Failed to batch fetch {$objectType}", [
'crm_ids' => $crmIds,
'error' => $errorMessage,
'trace' => $errorTrace,
]);
throw new CrmException("Failed to batch fetch {$objectType}: " . $errorMessage);
}
/**
* Batch read multiple opportunities by their CRM IDs
*
* @param array<string> $crmIds Array of HubSpot deal IDs (max 100)
* @param array<string> $fields Array of property names to fetch
*
* @return array<string, array> Array keyed by CRM ID with opportunity data
*/
public function getOpportunitiesByIds(array $crmIds, array $fields): array
{
return $this->batchReadObjects('deals', $crmIds, $fields);
}
/**
* Batch read multiple companies by their CRM IDs
*
* @param array<string> $crmIds Array of HubSpot company IDs (max 100)
* @param array<string> $fields Array of property names to fetch
*
* @return array<string, array> Array keyed by CRM ID with company data
*/
public function getCompaniesByIds(array $crmIds, array $fields): array
{
return $this->batchReadObjects('companies', $crmIds, $fields);
}
/**
* Batch read multiple contacts by their CRM IDs
*
* @param array<string> $crmIds Array of HubSpot contact IDs (max 100)
* @param array<string> $fields Array of property names to fetch
*
* @return array<string, array> Array keyed by CRM ID with contact data
*/
public function getContactsByIds(array $crmIds, array $fields): array
{
return $this->batchReadObjects('contacts', $crmIds, $fields);
}
/**
* @throws CompanyApiException
* @throws CrmException
*/
public function getAccountById(string $crmId, array $fields): array
{
try {
$company = $this->getNewInstance()->crm()->companies()->basicApi()->getById(
$crmId,
implode(',', $fields),
);
} catch (CompanyApiException $e) {
$this->log->info('[Hubspot] Failed to fetch account', [
'crm_id' => $crmId,
'reason' => $e->getMessage(),
]);
throw $e;
}
if (! $company instanceof CompaniesWithAssociations) {
throw new CrmException('Account not found');
}
return [
'id' => $company->getId(),
'properties' => $company->getProperties(),
];
}
/**
* @throws ContactApiException
* @throws CrmException
*/
public function getContactById(string $crmId, array $fields): array
{
try {
$contact = $this->getNewInstance()->crm()->contacts()->basicApi()->getById(
$crmId,
implode(',', $fields)
);
} catch (ContactApiException $e) {
$this->log->info('[Hubspot] Failed to fetch contact', [
'crm_id' => $crmId,
'reason' => $e->getMessage(),
]);
throw $e;
}
if (! $contact instanceof ContactsWithAssociations) {
throw new CrmException('Contact not found');
}
return [
'id' => $contact->getId(),
'properties' => $contact->getProperties(),
];
}
/**
* This is email search request that Hubspot offers as GET (more generous quota)
*/
public function getContactByEmail(string $email, array $fields = []): array
{
try {
$contact = $this->getNewInstance()->crm()->contacts()->basicApi()->getById(
$email,
implode(',', $fields),
null,
false,
'email'
);
return [
'id' => $contact->getId(),
'properties' => $contact->getProperties(),
];
} catch (ContactApiException $e) {
$this->log->info('[Hubspot] Failed to fetch contact', [
'email' => $email,
'reason' => $e->getMessage(),
]);
return [];
}
}
/**
* @throws CrmException
*/
public function fetchProperty(string $objectType, string $propertyId): Property
{
$result = $this->getNewInstance()->crm()->properties()->coreApi()->getByName($objectType, $propertyId);
if (! $result instanceof Property) {
$this->log->error('[Hubspot] Failed to fetch property', [
'object_type' => $objectType,
'property_id' => $propertyId,
'reason' => $result->getMessage(),
]);
throw new CrmException('Failed to fetch property');
}
return $result;
}
/**
* @return array<CrmFieldOption>
*/
public function fetchPropertyOptions(string $objectType, string $propertyId): array
{
/** @var array<CrmFieldOption> */
return $this->fetchProperty($objectType, $propertyId)->getOptions();
}
/**
* @return array<array{id:string, label:string, deleted:bool}>
*/
public function fetchCallDispositions(): array
{
/** @var Response $response */
$response = $this->getInstance()->engagements()->getCallDispositions();
/**
* @var array<array{
* id:string,
* label:string,
* deleted: bool
* }>
*/
return $response->toArray();
}
/**
* @return array<CrmFieldOption>
*/
public function fetchOpportunityPipelineStages(): array
{
$stages = [];
$apiResponse = $this->getNewInstance()->crm()->pipelines()->pipelinesApi()->getAll('deals');
if ($apiResponse instanceof Error) {
$this->log->error('[Hubspot] Failed to fetch opportunity pipelines', [
'reason' => $apiResponse->getMessage(),
]);
return [];
}
foreach ($apiResponse->getResults() as $pipeline) {
$pipelineStages = array_map(
static function (PipelineStage $stage) {
return [
'id' => $stage->getId(),
'label' => $stage->getLabel(),
];
},
$pipeline->getStages()
);
$stages = array_merge($stages, $pipelineStages);
}
return $stages;
}
public function fetchOpportunityPipelines(): array
{
$pipelines = [];
try {
$apiResponse = $this->makeRequest('/crm/v3/pipelines/deals');
} catch (\Exception $e) {
$this->log->info('[Hubspot] Failed to fetch opportunity pipelines', [
'reason' => $e->getMessage(),
]);
return [];
}
$response = $apiResponse->toArray();
foreach ($response['results'] as $pipeline) {
$pipelines[] = [
'id' => $pipeline['id'],
'label' => $pipeline['label'],
];
}
return $pipelines;
}
/**
* @return array<CrmFieldOption>
*/
public function fetchMeetingOutcomeFieldOptions(Field $field): array
{
return $field->getCrmProviderId() === 'meetingOutcome'
? $this->fetchMeetingOutcomeTypes()
: $this->fetchCallActivityTypes();
}
public function fetchMeetingOutcomeTypes(): array
{
return $this->extractMeetingTypeOptions(
'[URL_WITH_CREDENTIALS] Response $response */
$response = $this->getInstance()
->getClient()
->request('GET', $endpoint);
/**
* @var array<array{
* value: string,
* label: string,
* displayOrder: int
* }> $optionData
*/
$optionData = $response->toArray()['options'] ?? [];
$options = [];
foreach ($optionData as $item) {
$options[] = [
'id' => $item['value'],
'value' => $item['value'],
'label' => $item['label'],
'display_order' => $item['displayOrder'],
];
}
return $options;
}
/**
* @return array<CrmFieldOption>
*/
public function fetchDispositionFieldOptions(): array
{
$options = [];
$dispositions = $this->fetchCallDispositions();
foreach ($dispositions as $disposition) {
if ($disposition['deleted'] !== false) {
continue;
}
$option['value'] = $disposition['id'];
$option['id'] = $disposition['id'];
$option['label'] = $disposition['label'];
$options[] = $option;
}
return $options;
}
/**
* @return array<CrmFieldOption>
*/
public function fetchOpportunityFieldOptions(Field $field): array
{
if ($field->isStageField()) {
return $this->fetchOpportunityPipelineStages();
}
if ($field->isPipelineField()) {
return $this->fetchOpportunityPipelines();
}
return $this->fetchPropertyOptions('deals', $field->getCrmProviderId());
}
/**
* @throws BadRequest
* @throws HubspotException
*/
public function makeRequest(string $endpoint, $method = 'GET', $payload = [], ?string $queryString = null)
{
$endpoint = self::BASE_URL . $endpoint;
if ($method === 'GET') {
$response = $this->getInstance()->getClient()?->request(
method: $method,
endpoint: $endpoint,
query_string: $queryString
);
} else {
$response = $this->getInstance()->getClient()->request($method, $endpoint, [
'json' => ($payload),
]);
}
$max = $response->getHeaderLine('X-HubSpot-RateLimit-Max'); // "110"
$remaining = $response->getHeaderLine('X-HubSpot-RateLimit-Remaining'); // "109"
$interval = $response->getHeaderLine('X-HubSpot-RateLimit-Interval-Milliseconds'); // "10000"
$body = json_decode((string) $response->getBody(), true);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$max ' . PHP_EOL . print_r($max, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$remaining ' . PHP_EOL . print_r($remaining, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$interval ' . PHP_EOL . print_r($interval, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$body ' . PHP_EOL . print_r($body, true));
return $response;
}
/**
* @throws BadRequest
* @throws HubspotException
*/
public function createMeeting(array $payload): Response
{
$endpoint = '/crm/v3/objects/meetings';
return $this->makeRequest($endpoint, 'POST', $payload);
}
/**
* @throws BadRequest
* @throws HubspotException
*/
public function updateMeeting(string $meetingId, array $payload): Response
{
$endpoint = '/crm/v3/objects/meetings/' . $meetingId;
return $this->makeRequest($endpoint, 'PATCH', $payload);
}
/**
* @throws \Exception
*/
public function createNote(
string $body,
string $ownerId,
int $timestamp,
string $objectId,
NoteObject $noteObject
): ?string {
try {
$noteInput = new SimplePublicObjectInput([
'properties' => [
'hs_note_body' => $body,
'hubspot_owner_id' => $ownerId,
'hs_timestamp' => $timestamp,
],
]);
// Create note
$note = $this->getNewInstance()->crm()->objects()->basicApi()->create('note', $noteInput);
$this->getNewInstance()->crm()->objects()->associationsApi()->create(
'note',
$note->getId(),
$this->getNoteObject($noteObject),
$objectId,
$this->getNoteAssociationType($noteObject),
);
return $note->getId();
} catch (\Exception $e) {
$this->log->error('[Hubspot] Failed to create note', [
'objectId' => $objectId,
'noteObject' => $noteObject->getObjectType(),
'reason' => $e->getMessage(),
]);
\Sentry::captureException($e);
}
return null;
}
public function updateEngagement(string $objectId, array $engagement, array $metadata): void
{
$this->getInstance()->engagements()->update($objectId, $engagement, $metadata);
}
public function getEngagementData(string $engagementId): array
{
$engagement = $this->getInstance()->engagements()->get($engagementId);
return $engagement->toArray();
}
public function createEngagement(array $engagement, array $associations, array $metadata): Response
{
return $this->getInstance()
->engagements()
->create($engagement, $associations, $metadata);
}
public function isUnauthorizedException(\Exception $e): bool
{
// Check for specific HubSpot API exception types first
if ($e instanceof BadRequest) {
// BadRequest can contain 401 status codes
return $e->getCode() === 401;
}
// Check for HTTP client exceptions with status codes
if ($e instanceof \GuzzleHttp\Exception\RequestException && $e->hasResponse()) {
$response = $e->getResponse();
if ($response !== null) {
return $response->getStatusCode() === 401;
}
}
// Check for Guzzle HTTP exceptions
if ($e instanceof \GuzzleHttp\Exception\ClientException) {
return $e->getCode() === 401;
}
// Fallback to string matching as last resort, but be more specific
$message = strtolower($e->getMessage());
return str_contains($message, '401 unauthorized') ||
str_contains($message, 'http 401') ||
str_contains($message, 'status code 401') ||
(preg_match('/\b401\b/', $message) && str_contains($message, 'unauthorized'));
}
/**
* Validates and refreshes the access token if needed before API requests.
* This ensures long-running processes don't fail due to token expiration.
*
* @throws SocialAccountTokenInvalidException
*/
public function ensureValidToken(): void
{
if ($this->oauthAccount === null) {
return;
}
$newToken = $this->tokenManager->ensureValidToken($this->oauthAccount);
if ($newToken !== null) {
$this->accessToken = $newToken;
}
}
public function getConfig()
{
return $this->config;
}
// returns only active (archived=false)
public function getOwners(): array
{
return $this->getNewInstance()->crm()->owners()->getAll();
}
/**
* @param bool $archived
*
* @return array<Owner>|[]
*/
public function getOwnersArchived(bool $archived = true): array
{
$endpoint = '/crm/v3/owners';
$queryParams = [
'archived' => $archived ? 'true' : 'false',
];
$queryString = http_build_query($queryParams);
$owners = [];
try {
$response = $this->makeRequest(endpoint: $endpoint, queryString: $queryString);
$responseData = $response?->toArray();
foreach ($responseData['results'] as $result) {
try {
$owners[] = Owner::create($result);
} catch (Throwable $e) {
$this->log->error('[HubSpot] Failed to process owner data', [
'result' => $result,
'error' => $e->getMessage(),
]);
continue;
}
}
} catch (Throwable $e) {
$this->log->error('HubSpot] Failed to fetch owners', [
'archived' => $archived,
'error' => $e->getMessage(),
]);
return [];
}
return $owners;
}
public function getMeeting(string $engagementId): ObjectWithAssociations
{
return $this->getNewInstance()->crm()->objects()->basicApi()
->getById('meeting', $engagementId, null, 'contact,company,deal');
}
public function deleteEngagement(string $engagementId): void
{
$this->getInstance()->engagements()->delete((int) $engagementId);
}
public function getAssociationsData(array $ids, string $fromObject, string $toObject): array
{
$associationData = [];
$idChunks = array_chunk($ids, self::ASSOCIATIONS_BATCH_SIZE_LIMIT);
foreach ($idChunks as $idChunk) {
try {
$batchInput = new \HubSpot\Client\Crm\Associations\Model\BatchInputPublicObjectId();
$batchInput->setInputs(array_map(function ($id) {
$publicObjectId = new \HubSpot\Client\Crm\Associations\Model\PublicObjectId();
$publicObjectId->setId($id);
return $publicObjectId;
}, $idChunk));
$associatedObjectsData = $this
->getNewInstance()
->crm()
->associations()
->batchApi()
->read($fromObject, $toObject, $batchInput);
if ($associatedObjectsData instanceof \HubSpot\Client\Crm\Associations\Model\BatchResponsePublicAssociationMulti) {
foreach ($associatedObjectsData->getResults() as $association) {
$from = $association->getFrom()->getId();
$toAssociations = $association->getTo();
if (! empty($toAssociations)) {
$associationData[$from] = array_map(function ($item) {
return $item->getId();
}, $toAssociations);
}
}
}
} catch (\Exception $e) {
$this->log->error('[Hubspot] Failed to fetch associations', [
'from_object' => $fromObject,
'to_object' => $toObject,
'reason' => $e->getMessage(),
]);
}
}
return $associationData;
}
/**
* @throws \Exception
*/
private function getNoteAssociationType(NoteObject $noteObject): string
{
return match($noteObject) {
NoteObject::Opportunity => 'note_to_deal',
NoteObject::Lead, NoteObject::Contact => 'note_to_contact', // or 'note_to_lead' if your portal supports it
NoteObject::Account => 'note_to_company',
NoteObject::Call, NoteObject::Event => throw new \Exception('Not supported'),
};
}
/**
* @throws \Exception
*/
private function getNoteObject(NoteObject $noteObject): string
{
return match($noteObject) {
NoteObject::Opportunity => 'deal',
NoteObject::Lead, NoteObject::Contact => 'contact',
NoteObject::Account => 'company',
NoteObject::Call, NoteObject::Event => throw new \Exception('Not supported'),
};
}
public function addAssociations(string $objectType, string $associationType, array $payload): Response
{
$endpoint = "/crm/v4/associations/$objectType/$associationType/batch/create";
return $this->makeRequest($endpoint, 'POST', $payload);
}
public function removeAssociations(string $objectType, string $associationType, array $payload): Response
{
$endpoint = "/crm/v4/associations/$objectType/$associationType/batch/archive";
return $this->makeRequest($endpoint, 'POST', $payload);
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – custom.log
|
NULL
|
3588
|
|
3589
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Editor for custom.log
Sync Changes
Hide This Notification
Code changed:
Hide
2
68
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Crm\Hubspot;
use HubSpot\Client\Crm\Deals\ApiException as DealApiException;
use HubSpot\Client\Crm\Contacts\ApiException as ContactApiException;
use HubSpot\Client\Crm\Companies\ApiException as CompanyApiException;
use HubSpot\Client\Crm\Contacts\Model\SimplePublicObjectWithAssociations as ContactsWithAssociations;
use HubSpot\Client\Crm\Companies\Model\SimplePublicObjectWithAssociations as CompaniesWithAssociations;
use HubSpot\Client\Crm\Deals\Model\SimplePublicObjectWithAssociations as DealWithAssociations;
use HubSpot\Client\Crm\Objects\Model\SimplePublicObjectInput;
use HubSpot\Client\Crm\Objects\Model\SimplePublicObjectWithAssociations as ObjectWithAssociations;
use HubSpot\Client\Crm\Pipelines\Model\Error;
use HubSpot\Client\Crm\Pipelines\Model\PipelineStage;
use HubSpot\Client\Crm\Properties\Model\Property;
use HubSpot\Discovery\Discovery;
use Jiminny\Component\Utility\Service\ProviderRateLimiter;
use Jiminny\Exceptions\CrmException;
use Jiminny\Exceptions\RateLimitException;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Jobs\Crm\NoteObject;
use Jiminny\Models\Crm\Field;
use Jiminny\Services\Crm\BaseClient;
use Jiminny\Services\Crm\Hubspot\DTO\Response\Owner;
use Jiminny\Services\SocialAccountService;
use SevenShores\Hubspot\Exceptions\BadRequest;
use SevenShores\Hubspot\Exceptions\HubspotException;
use SevenShores\Hubspot\Factory;
use SevenShores\Hubspot\Http\Response;
use Jiminny\Services\Crm\Hubspot\Pagination\HubspotPaginationService;
use Throwable;
/**
* @phpstan-type CrmFieldOption array{id:string, label:string, value?:string}
*/
class Client extends BaseClient implements HubspotClientInterface
{
public const string MIN_API_VERSION = '2';
public const string BASE_URL = '[URL_WITH_CREDENTIALS] T
* @param callable(): T $apiCall
* @return T
*
* @throws RateLimitException
*/
private function executeRequest(callable $apiCall)
{
if (! $this->rateLimiter->canMakeRequest($this->config)) {
$retryAfter = $this->rateLimiter->requestAvailableIn($this->config);
$this->log->warning('[Hubspot] Rate limit exceeded, deferring request', [
'team_id' => $this->config->team_id,
'config_id' => $this->config->getId(),
'retry_after' => $retryAfter,
]);
throw new RateLimitException(
'Hubspot rate limit reached for configuration ' . $this->config->getId(),
$retryAfter,
);
}
$this->rateLimiter->incrementRequestCount($this->config);
try {
return $apiCall();
} catch (Throwable $e) {
if ($this->isHubspotRateLimit($e)) {
$retryAfter = $this->parseRetryAfter($e);
$this->log->warning('[Hubspot] Received 429 from API', [
'team_id' => $this->config->team_id,
'config_id' => $this->config->getId(),
'retry_after' => $retryAfter,
'reason' => $e->getMessage(),
]);
throw new RateLimitException('Hubspot returned 429', $retryAfter, $e);
}
throw $e;
}
}
private function isHubspotRateLimit(Throwable $e): bool
{
return method_exists($e, 'getCode') && (int) $e->getCode() === 429;
}
private function parseRetryAfter(Throwable $e): int
{
if (method_exists($e, 'getResponseHeaders')) {
$headers = $e->getResponseHeaders() ?: [];
$value = $headers['Retry-After'] ?? $headers['retry-after'] ?? null;
if (is_array($value)) {
$value = $value[0] ?? null;
}
if (is_numeric($value)) {
return (int) $value;
}
}
return 10;
}
public function getMinimumApiVersion(): string
{
return self::MIN_API_VERSION;
}
public function getInstance(): Factory
{
return new Factory([
'key' => $this->accessToken,
'oauth2' => true,
'base_url' => $this->baseUrl,
]);
}
public function getNewInstance(): Discovery
{
return \HubSpot\Factory::createWithAccessToken($this->accessToken);
}
/**
* Secondly and daily limits for Hubspot API
*
* Product Tier: Free & Starter | Professional & Enterprise | API add-on (any tier)
* Burst: 100/10 seconds | 150/10 seconds | 200/10 seconds
* Daily: 250,000 | 500,000 | 1,000,000
*
* Official documentation states: The search endpoints are rate limited to five requests per second.
* Since with 5 RPS were still hitting secondly rate limits we lowered it to 4
*/
public function getPaginatedData(array $payload, string $type, int $offset = 0): array
{
$total = 0;
$lastId = null;
$rows = [];
foreach ($this->getPaginatedDataGenerator($payload, $type, $offset, $total, $lastId) as $row) {
$rows[] = $row;
}
return ['results' => $rows, 'total' => $total, 'last_record' => $lastId];
}
/**
* @throws HubspotException
* @throws SocialAccountTokenInvalidException
* @throws BadRequest
*/
public function getPaginatedDataGenerator(
array $payload,
string $type,
int $offset = 0,
int &$total = 0,
?string &$lastRecordId = null
): \Generator {
return $this->paginationService->getPaginatedDataGenerator(
$this,
$payload,
$type,
$offset,
$total,
$lastRecordId
);
}
/**
* @throws DealApiException
* @throws CrmException
*/
public function getOpportunityById(string $crmId, array $fields): array
{
try {
// $deal = $this->executeRequest(fn () => $this->getNewInstance()->crm()->deals()->basicApi()->getById(
$deal = $this->getNewInstance()->crm()->deals()->basicApi()->getById(
$crmId,
implode(',', $fields),
'companies,contacts'
);
} catch (DealApiException $e) {
$this->log->info('[Hubspot] Failed to fetch opportunity', [
'crm_id' => $crmId,
'reason' => $e->getMessage(),
]);
throw $e;
}
if (! $deal instanceof DealWithAssociations) {
throw new CrmException('Deal not found');
}
return [
'id' => $deal->getId(),
'properties' => $deal->getProperties(),
'associations' => $deal->getAssociations(),
];
}
/**
* Generic batch read method for HubSpot objects
*
* @param string $objectType The object type ('deals', 'companies', 'contacts')
* @param array<string> $crmIds Array of HubSpot object IDs (max 100)
* @param array<string> $fields Array of property names to fetch
*
* @return array<string, array> Array keyed by CRM ID with object data
*/
private function batchReadObjects(string $objectType, array $crmIds, array $fields): array
{
if (empty($crmIds)) {
return [];
}
$this->validateBatchSize($objectType, $crmIds);
$this->ensureValidToken();
try {
$batchConfig = $this->createBatchConfiguration($objectType);
$batchReadRequest = $this->prepareBatchRequest($batchConfig, $crmIds, $fields);
$response = $batchConfig['api']->read($batchReadRequest);
$this->validateApiResponse($response, $objectType);
$results = $this->processApiResults($response);
$this->logBatchResults($objectType, $crmIds, $results);
return $results;
} catch (\Throwable $e) {
$this->handleBatchError($e, $objectType, $crmIds);
}
}
private function validateBatchSize(string $objectType, array $crmIds): void
{
if (count($crmIds) > 100) {
throw new \InvalidArgumentException("Batch size cannot exceed 100 {$objectType}");
}
}
private function createBatchConfiguration(string $objectType): array
{
$configurations = [
'deals' => [
'batchReadRequest' => new \HubSpot\Client\Crm\Deals\Model\BatchReadInputSimplePublicObjectId(),
'inputClass' => \HubSpot\Client\Crm\Deals\Model\SimplePublicObjectId::class,
'api' => $this->getNewInstance()->crm()->deals()->batchApi(),
],
'companies' => [
'batchReadRequest' => new \HubSpot\Client\Crm\Companies\Model\BatchReadInputSimplePublicObjectId(),
'inputClass' => \HubSpot\Client\Crm\Companies\Model\SimplePublicObjectId::class,
'api' => $this->getNewInstance()->crm()->companies()->batchApi(),
],
'contacts' => [
'batchReadRequest' => new \HubSpot\Client\Crm\Contacts\Model\BatchReadInputSimplePublicObjectId(),
'inputClass' => \HubSpot\Client\Crm\Contacts\Model\SimplePublicObjectId::class,
'api' => $this->getNewInstance()->crm()->contacts()->batchApi(),
],
];
if (! isset($configurations[$objectType])) {
throw new \InvalidArgumentException("Unsupported object type: {$objectType}");
}
return $configurations[$objectType];
}
private function prepareBatchRequest(array $batchConfig, array $crmIds, array $fields): object
{
$batchReadRequest = $batchConfig['batchReadRequest'];
$inputClass = $batchConfig['inputClass'];
$inputs = array_map(function ($crmId) use ($inputClass) {
$input = new $inputClass();
$input->setId($crmId);
return $input;
}, $crmIds);
$batchReadRequest->setInputs($inputs);
$batchReadRequest->setProperties($fields);
return $batchReadRequest;
}
private function validateApiResponse($response, string $objectType): void
{
if (! $response) {
throw new CrmException("HubSpot API returned null response for {$objectType} batch read");
}
}
private function processApiResults($response): array
{
$results = [];
$responseResults = $response->getResults();
if ($responseResults) {
foreach ($responseResults as $object) {
if ($object && $object->getId()) {
$results[$object->getId()] = [
'id' => $object->getId(),
'properties' => $object->getProperties() ?: [],
];
}
}
}
return $results;
}
private function logBatchResults(string $objectType, array $crmIds, array $results): void
{
$this->log->info("[HubSpot] Batch fetched {$objectType}", [
'requested_count' => count($crmIds),
'returned_count' => count($results),
'crm_ids' => $crmIds,
]);
}
private function handleBatchError(\Throwable $e, string $objectType, array $crmIds): void
{
$errorMessage = $e->getMessage() ?: 'Unknown error';
$errorTrace = $e->getTraceAsString() ?: 'No trace available';
$this->log->error("[HubSpot] Failed to batch fetch {$objectType}", [
'crm_ids' => $crmIds,
'error' => $errorMessage,
'trace' => $errorTrace,
]);
throw new CrmException("Failed to batch fetch {$objectType}: " . $errorMessage);
}
/**
* Batch read multiple opportunities by their CRM IDs
*
* @param array<string> $crmIds Array of HubSpot deal IDs (max 100)
* @param array<string> $fields Array of property names to fetch
*
* @return array<string, array> Array keyed by CRM ID with opportunity data
*/
public function getOpportunitiesByIds(array $crmIds, array $fields): array
{
return $this->batchReadObjects('deals', $crmIds, $fields);
}
/**
* Batch read multiple companies by their CRM IDs
*
* @param array<string> $crmIds Array of HubSpot company IDs (max 100)
* @param array<string> $fields Array of property names to fetch
*
* @return array<string, array> Array keyed by CRM ID with company data
*/
public function getCompaniesByIds(array $crmIds, array $fields): array
{
return $this->batchReadObjects('companies', $crmIds, $fields);
}
/**
* Batch read multiple contacts by their CRM IDs
*
* @param array<string> $crmIds Array of HubSpot contact IDs (max 100)
* @param array<string> $fields Array of property names to fetch
*
* @return array<string, array> Array keyed by CRM ID with contact data
*/
public function getContactsByIds(array $crmIds, array $fields): array
{
return $this->batchReadObjects('contacts', $crmIds, $fields);
}
/**
* @throws CompanyApiException
* @throws CrmException
*/
public function getAccountById(string $crmId, array $fields): array
{
try {
$company = $this->getNewInstance()->crm()->companies()->basicApi()->getById(
$crmId,
implode(',', $fields),
);
} catch (CompanyApiException $e) {
$this->log->info('[Hubspot] Failed to fetch account', [
'crm_id' => $crmId,
'reason' => $e->getMessage(),
]);
throw $e;
}
if (! $company instanceof CompaniesWithAssociations) {
throw new CrmException('Account not found');
}
return [
'id' => $company->getId(),
'properties' => $company->getProperties(),
];
}
/**
* @throws ContactApiException
* @throws CrmException
*/
public function getContactById(string $crmId, array $fields): array
{
try {
$contact = $this->getNewInstance()->crm()->contacts()->basicApi()->getById(
$crmId,
implode(',', $fields)
);
} catch (ContactApiException $e) {
$this->log->info('[Hubspot] Failed to fetch contact', [
'crm_id' => $crmId,
'reason' => $e->getMessage(),
]);
throw $e;
}
if (! $contact instanceof ContactsWithAssociations) {
throw new CrmException('Contact not found');
}
return [
'id' => $contact->getId(),
'properties' => $contact->getProperties(),
];
}
/**
* This is email search request that Hubspot offers as GET (more generous quota)
*/
public function getContactByEmail(string $email, array $fields = []): array
{
try {
$contact = $this->getNewInstance()->crm()->contacts()->basicApi()->getById(
$email,
implode(',', $fields),
null,
false,
'email'
);
return [
'id' => $contact->getId(),
'properties' => $contact->getProperties(),
];
} catch (ContactApiException $e) {
$this->log->info('[Hubspot] Failed to fetch contact', [
'email' => $email,
'reason' => $e->getMessage(),
]);
return [];
}
}
/**
* @throws CrmException
*/
public function fetchProperty(string $objectType, string $propertyId): Property
{
$result = $this->getNewInstance()->crm()->properties()->coreApi()->getByName($objectType, $propertyId);
if (! $result instanceof Property) {
$this->log->error('[Hubspot] Failed to fetch property', [
'object_type' => $objectType,
'property_id' => $propertyId,
'reason' => $result->getMessage(),
]);
throw new CrmException('Failed to fetch property');
}
return $result;
}
/**
* @return array<CrmFieldOption>
*/
public function fetchPropertyOptions(string $objectType, string $propertyId): array
{
/** @var array<CrmFieldOption> */
return $this->fetchProperty($objectType, $propertyId)->getOptions();
}
/**
* @return array<array{id:string, label:string, deleted:bool}>
*/
public function fetchCallDispositions(): array
{
/** @var Response $response */
$response = $this->getInstance()->engagements()->getCallDispositions();
/**
* @var array<array{
* id:string,
* label:string,
* deleted: bool
* }>
*/
return $response->toArray();
}
/**
* @return array<CrmFieldOption>
*/
public function fetchOpportunityPipelineStages(): array
{
$stages = [];
$apiResponse = $this->getNewInstance()->crm()->pipelines()->pipelinesApi()->getAll('deals');
if ($apiResponse instanceof Error) {
$this->log->error('[Hubspot] Failed to fetch opportunity pipelines', [
'reason' => $apiResponse->getMessage(),
]);
return [];
}
foreach ($apiResponse->getResults() as $pipeline) {
$pipelineStages = array_map(
static function (PipelineStage $stage) {
return [
'id' => $stage->getId(),
'label' => $stage->getLabel(),
];
},
$pipeline->getStages()
);
$stages = array_merge($stages, $pipelineStages);
}
return $stages;
}
public function fetchOpportunityPipelines(): array
{
$pipelines = [];
try {
$apiResponse = $this->makeRequest('/crm/v3/pipelines/deals');
} catch (\Exception $e) {
$this->log->info('[Hubspot] Failed to fetch opportunity pipelines', [
'reason' => $e->getMessage(),
]);
return [];
}
$response = $apiResponse->toArray();
foreach ($response['results'] as $pipeline) {
$pipelines[] = [
'id' => $pipeline['id'],
'label' => $pipeline['label'],
];
}
return $pipelines;
}
/**
* @return array<CrmFieldOption>
*/
public function fetchMeetingOutcomeFieldOptions(Field $field): array
{
return $field->getCrmProviderId() === 'meetingOutcome'
? $this->fetchMeetingOutcomeTypes()
: $this->fetchCallActivityTypes();
}
public function fetchMeetingOutcomeTypes(): array
{
return $this->extractMeetingTypeOptions(
'[URL_WITH_CREDENTIALS] Response $response */
$response = $this->getInstance()
->getClient()
->request('GET', $endpoint);
/**
* @var array<array{
* value: string,
* label: string,
* displayOrder: int
* }> $optionData
*/
$optionData = $response->toArray()['options'] ?? [];
$options = [];
foreach ($optionData as $item) {
$options[] = [
'id' => $item['value'],
'value' => $item['value'],
'label' => $item['label'],
'display_order' => $item['displayOrder'],
];
}
return $options;
}
/**
* @return array<CrmFieldOption>
*/
public function fetchDispositionFieldOptions(): array
{
$options = [];
$dispositions = $this->fetchCallDispositions();
foreach ($dispositions as $disposition) {
if ($disposition['deleted'] !== false) {
continue;
}
$option['value'] = $disposition['id'];
$option['id'] = $disposition['id'];
$option['label'] = $disposition['label'];
$options[] = $option;
}
return $options;
}
/**
* @return array<CrmFieldOption>
*/
public function fetchOpportunityFieldOptions(Field $field): array
{
if ($field->isStageField()) {
return $this->fetchOpportunityPipelineStages();
}
if ($field->isPipelineField()) {
return $this->fetchOpportunityPipelines();
}
return $this->fetchPropertyOptions('deals', $field->getCrmProviderId());
}
/**
* @throws BadRequest
* @throws HubspotException
*/
public function makeRequest(string $endpoint, $method = 'GET', $payload = [], ?string $queryString = null)
{
$endpoint = self::BASE_URL . $endpoint;
if ($method === 'GET') {
$response = $this->getInstance()->getClient()?->request(
method: $method,
endpoint: $endpoint,
query_string: $queryString
);
} else {
$response = $this->getInstance()->getClient()->request($method, $endpoint, [
'json' => ($payload),
]);
}
$max = $response->getHeaderLine('X-HubSpot-RateLimit-Max'); // "110"
$remaining = $response->getHeaderLine('X-HubSpot-RateLimit-Remaining'); // "109"
$interval = $response->getHeaderLine('X-HubSpot-RateLimit-Interval-Milliseconds'); // "10000"
$body = json_decode((string) $response->getBody(), true);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$max ' . PHP_EOL . print_r($max, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$remaining ' . PHP_EOL . print_r($remaining, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$interval ' . PHP_EOL . print_r($interval, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$body ' . PHP_EOL . print_r($body, true));
return $response;
}
/**
* @throws BadRequest
* @throws HubspotException
*/
public function createMeeting(array $payload): Response
{
$endpoint = '/crm/v3/objects/meetings';
return $this->makeRequest($endpoint, 'POST', $payload);
}
/**
* @throws BadRequest
* @throws HubspotException
*/
public function updateMeeting(string $meetingId, array $payload): Response
{
$endpoint = '/crm/v3/objects/meetings/' . $meetingId;
return $this->makeRequest($endpoint, 'PATCH', $payload);
}
/**
* @throws \Exception
*/
public function createNote(
string $body,
string $ownerId,
int $timestamp,
string $objectId,
NoteObject $noteObject
): ?string {
try {
$noteInput = new SimplePublicObjectInput([
'properties' => [
'hs_note_body' => $body,
'hubspot_owner_id' => $ownerId,
'hs_timestamp' => $timestamp,
],
]);
// Create note
$note = $this->getNewInstance()->crm()->objects()->basicApi()->create('note', $noteInput);
$this->getNewInstance()->crm()->objects()->associationsApi()->create(
'note',
$note->getId(),
$this->getNoteObject($noteObject),
$objectId,
$this->getNoteAssociationType($noteObject),
);
return $note->getId();
} catch (\Exception $e) {
$this->log->error('[Hubspot] Failed to create note', [
'objectId' => $objectId,
'noteObject' => $noteObject->getObjectType(),
'reason' => $e->getMessage(),
]);
\Sentry::captureException($e);
}
return null;
}
public function updateEngagement(string $objectId, array $engagement, array $metadata): void
{
$this->getInstance()->engagements()->update($objectId, $engagement, $metadata);
}
public function getEngagementData(string $engagementId): array
{
$engagement = $this->getInstance()->engagements()->get($engagementId);
return $engagement->toArray();
}
public function createEngagement(array $engagement, array $associations, array $metadata): Response
{
return $this->getInstance()
->engagements()
->create($engagement, $associations, $metadata);
}
public function isUnauthorizedException(\Exception $e): bool
{
// Check for specific HubSpot API exception types first
if ($e instanceof BadRequest) {
// BadRequest can contain 401 status codes
return $e->getCode() === 401;
}
// Check for HTTP client exceptions with status codes
if ($e instanceof \GuzzleHttp\Exception\RequestException && $e->hasResponse()) {
$response = $e->getResponse();
if ($response !== null) {
return $response->getStatusCode() === 401;
}
}
// Check for Guzzle HTTP exceptions
if ($e instanceof \GuzzleHttp\Exception\ClientException) {
return $e->getCode() === 401;
}
// Fallback to string matching as last resort, but be more specific
$message = strtolower($e->getMessage());
return str_contains($message, '401 unauthorized') ||
str_contains($message, 'http 401') ||
str_contains($message, 'status code 401') ||
(preg_match('/\b401\b/', $message) && str_contains($message, 'unauthorized'));
}
/**
* Validates and refreshes the access token if needed before API requests.
* This ensures long-running processes don't fail due to token expiration.
*
* @throws SocialAccountTokenInvalidException
*/
public function ensureValidToken(): void
{
if ($this->oauthAccount === null) {
return;
}
$newToken = $this->tokenManager->ensureValidToken($this->oauthAccount);
if ($newToken !== null) {
$this->accessToken = $newToken;
}
}
public function getConfig()
{
return $this->config;
}
// returns only active (archived=false)
public function getOwners(): array
{
return $this->getNewInstance()->crm()->owners()->getAll();
}
/**
* @param bool $archived
*
* @return array<Owner>|[]
*/
public function getOwnersArchived(bool $archived = true): array
{
$endpoint = '/crm/v3/owners';
$queryParams = [
'archived' => $archived ? 'true' : 'false',
];
$queryString = http_build_query($queryParams);
$owners = [];
try {
$response = $this->makeRequest(endpoint: $endpoint, queryString: $queryString);
$responseData = $response?->toArray();
foreach ($responseData['results'] as $result) {
try {
$owners[] = Owner::create($result);
} catch (Throwable $e) {
$this->log->error('[HubSpot] Failed to process owner data', [
'result' => $result,
'error' => $e->getMessage(),
]);
continue;
}
}
} catch (Throwable $e) {
$this->log->error('HubSpot] Failed to fetch owners', [
'archived' => $archived,
'error' => $e->getMessage(),
]);
return [];
}
return $owners;
}
public function getMeeting(string $engagementId): ObjectWithAssociations
{
return $this->getNewInstance()->crm()->objects()->basicApi()
->getById('meeting', $engagementId, null, 'contact,company,deal');
}
public function deleteEngagement(string $engagementId): void
{
$this->getInstance()->engagements()->delete((int) $engagementId);
}
public function getAssociationsData(array $ids, string $fromObject, string $toObject): array
{
$associationData = [];
$idChunks = array_chunk($ids, self::ASSOCIATIONS_BATCH_SIZE_LIMIT);
foreach ($idChunks as $idChunk) {
try {
$batchInput = new \HubSpot\Client\Crm\Associations\Model\BatchInputPublicObjectId();
$batchInput->setInputs(array_map(function ($id) {
$publicObjectId = new \HubSpot\Client\Crm\Associations\Model\PublicObjectId();
$publicObjectId->setId($id);
return $publicObjectId;
}, $idChunk));
$associatedObjectsData = $this
->getNewInstance()
->crm()
->associations()
->batchApi()
->read($fromObject, $toObject, $batchInput);
if ($associatedObjectsData instanceof \HubSpot\Client\Crm\Associations\Model\BatchResponsePublicAssociationMulti) {
foreach ($associatedObjectsData->getResults() as $association) {
$from = $association->getFrom()->getId();
$toAssociations = $association->getTo();
if (! empty($toAssociations)) {
$associationData[$from] = array_map(function ($item) {
return $item->getId();
}, $toAssociations);
}
}
}
} catch (\Exception $e) {
$this->log->error('[Hubspot] Failed to fetch associations', [
'from_object' => $fromObject,
'to_object' => $toObject,
'reason' => $e->getMessage(),
]);
}
}
return $associationData;
}
/**
* @throws \Exception
*/
private function getNoteAssociationType(NoteObject $noteObject): string
{
return match($noteObject) {
NoteObject::Opportunity => 'note_to_deal',
NoteObject::Lead, NoteObject::Contact => 'note_to_contact', // or 'note_to_lead' if your portal supports it
NoteObject::Account => 'note_to_company',
NoteObject::Call, NoteObject::Event => throw new \Exception('Not supported'),
};
}
/**
* @throws \Exception
*/
private function getNoteObject(NoteObject $noteObject): string
{
return match($noteObject) {
NoteObject::Opportunity => 'deal',
NoteObject::Lead, NoteObject::Contact => 'contact',
NoteObject::Account => 'company',
NoteObject::Call, NoteObject::Event => throw new \Exception('Not supported'),
};
}
public function addAssociations(string $objectType, string $associationType, array $payload): Response
{
$endpoint = "/crm/v4/associations/$objectType/$associationType/batch/create";
return $this->makeRequest($endpoint, 'POST', $payload);
}
public function removeAssociations(string $objectType, string $associationType, array $payload): Response
{
$endpoint = "/crm/v4/associations/$objectType/$associationType/batch/archive";
return $this->makeRequest($endpoint, 'POST', $payload);
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – custom.log
|
NULL
|
3589
|
|
3590
|
PostmanVIewWindowmelpProiect vC. RateLimitaware.on PostmanVIewWindowmelpProiect vC. RateLimitaware.onpRematchActivityOnCrmObjectD•.gitignoreC) AddRateLimitCommand.pnpoclientonpx© Jime audio.wav© SyncOpportunitiesJob.phpE hubspot-journal-poll.log© ImportOpportunityBatch.phpTImportBatchJobTrait.plE laravel.log<> phpunit.xmlI ttt.js= oauth-private.kev( Hubspot/.../SyncCrmEntitiesTrait.phpclass Cllent extends Baseclient 1mpLenE oauth-public.key219220= storageE supervisord.pidwtext-relav.ison22%vtests→ Feature>M Intearation> M Servicesv Unit>M ActionsM Comnonent> M Confiaurationi> M Console) M Contractc> D Domain> D DTO> D Enums)m Suonte> D Exceptions>C fixtures> C Guards> C Helpers>C Http.> C Integrations> C Interactionsv O Jobs>DACTIVITM> M AiAutomationD Audiov M AutomatedReportsC CreateResultsTest.ohvC RequestGenerateReno250@ SendReportExpiringSoC) SendRenort.lohTect.ofC SendRenortMail.lobTe‹C SendRenortNotGeneram Calendar• MCrmm NoslDickem MailhoyC7 StreamingM Toamououc tunction cetiooortunitvivld'crm.1d' => Scrmidreason' = se->getMesthrow se:if @ Sdeal instanceof DealWitthrow new_CrmExcentiondmreturn['id' => $deal-›getIdO,'properties' = $deal->get'associations' => $deal->g* benerac buuch read mecnod ror h* doaram string sobectlupe Ihe o* anaram arrau<string> ScrmIds An* doaram arrau<string> Stlelds An* dreturn arrau<strina. arrau> Anprivate function batchRead0biectsaif (emptv($crmIds)) $return1Sthis->validateRatchSize/SohielSthis->ensureValidTokend+ny dChatchfonfia = Cthic-senoalChatchPondPonuoct = CthiclCnocnonco = ChatchfonfiallCthic-sualidatolniPocnoncc• SearchYour team is now on the Free plan with 1 admin. You retain editing access and other members are read-only. View team permissions to see who can edit, or upgrade to restore collaborationRun orderRun SequenceGET Get Er •Deselect AllSelect All Resetv COLLECtIONS• Associations V4|• CMS - URL Redirects APl Collection› Companies• COMPARE• Contactsv CRM Obiectsv crm/v3/objects/{object Type}>u batchD (object ld)› associations<to Obiect Type5g. An error occurredca. successful onerationPaTCH Uindate>GET ListPOST Createy Post Filter, Sort, and Search CRM Obiectsed. succocsful onerationcg. An error occurred› CRM Owners• CRM Pipelines• Dealsv EngagementsIM OID ENGAGEMENTSGet list meetingsPoST soarch modified comnaniecPosT search tasksGET road callGeT list callsPOST meetings scheduledGET get meetingPOST aet link to task> POSt Create Contact with Association> Hubspotv Iteration run HSGET Read Copyea. An error occurred.CaMiDANMeNreSPECS>FLOWS§ Connect GitConcole 5.l TermiGeT Read CopyO IterationD RunnerFunctionalPerformancechoose how to run vour pertormance testIn the app• Via the CLIContigure CLi command to run on your build pipelineSet up your performance testLoad profile ©Virtual users ©Fixed20 Mule20 virtual users run for 1 minute, each executina all requests sequentiallvData tile GSelect filePass test if...©Select optionIterationhl"Lukas sterka 121•in zn zmNo environmentv100% 52Thu 7 May 15:28:07UparadeVXAlAll variablesE EnvironmentNo environment selected, seled enulommenGlobalstokenCKPur5PqMxIZ@INOMi8kOfbaseUrlhttps://api.hubapi.comCeweToKenlCLLm5NnQMxIRQINQMI8kQ.• Local VaultStore your APl secrets locally in vault. Set up vaultGlobals Vault Tools?00O...
|
iTerm2
|
NULL
|
NULL
|
3590
|
|
3591
|
PostmanVIewWindowmelpProiect vC. RateLimitaware.on PostmanVIewWindowmelpProiect vC. RateLimitaware.onoRematchActivityOnCrmObjectD•.gitignoreC) AddRateLimitCommana.pnpoclientonpx© Jime audio.wav© SyncOpportunitiesJob.phpE hubspot-journal-poll.log© ImportOpportunityBatch.phpTImportBatchJobTrait.plE laravel.log<> phpunit.xmlI ttt.js= oauth-private.kev( Hubspot/.../SyncCrmEntitiesTrait.phpclass Cllent extends Baseclient 1mpLenE oauth-public.key219220= storageE supervisord.pidwtext-relav.ison22%vtests→ Feature>M Intearation> M Servicesv Unit>M ActionsM Comnonent> M Confiaurationi> M Console) M Contractc> D Domain>DDTO> D Enums)m Suonte> D Exceptions>C fixtures> C Guards> C Helpers>C Http.> C Integrations> C Interactionsv O Jobs>DACTIVITM> M AiAutomationD Audiov M AutomatedReportsC CreateResultsTest.ohvC RequestGenerateReno250@ SendReportExpiringSoC) SendRenort.lohTect.ofC SendRenortMail.lobTe‹C SendRenortNotGeneram Calendar• MCrmm NoslDickem MailhoyC7 StreamingM Toamououc tunction cetiooortunitvivld'crm.1d' => Scrmidreason' => se->qetmesthrow se:if @ Sdeal instanceof DealWitthrow new_CrmExcentiondmreturn'id' => $deal-›getIdO,'properties' = $deal->get'associations' => $deal->g* benerac buuch read mecnod ror h* doaram string sobectlupe Ihe o* ananam array<string> ScrmIds An* doaram arrau<string> Stlelds An* dreturn arrau<strina. arrau> Anprivate function batchRead0biectsaif (emptv($crmIds)) $return1Sthis->validateRatchSize/SohielSthis->ensureValidTokeno+ny dChatchfonfia = Cthic-senoalChatchPondPonuoct = CthiclCnocnonco = ChatchfonfiallCthic-sualidatolniPocnoncc• SearchYour team is now on the Free plan with 1 admin. You retain editing access and other members are read-only. View team permissions to see who can edit, or upgrade to restore collaborationGET nexto • POST searc • POST Read •Run orderRun Sequence• geT Read CopyGET readGET Get ErGET Read CoDeselect AllSelect All Resetv COLLECtIONS• Associations V4|• CMS - URL Redirects APl Collection› Companies• COMPARE• Contactsv CRM Obiectsv crm/v3/objects/{object Type}>u batchD (object ld)› associations<to Obiect Type5g. An error occurredca. successful onerationPaTCH Uindate>GET ListPOST Createy Post Filter, Sort, and Search CRM Obiectsed. succocsful onerationcg. An error occurred› CRM Owners• CRM Pipelines• Dealsv EngagementsIM OID ENGAGEMENTSGet list meetingsPoST soarch modified comnaniecPosT search tasksGET road callGeT list callsPOST meetings scheduledGET get meetingPOST aet link to task> pOSt Create Contact with Association> Hubspotv Iteration run HSGET Read Copyea. An error occurred.CaMiDANMeNreSPECS>FLOWS§ Connect GitConcole 5.l TermiIterationD RunnerFunctionalPerformancechoose how to run vour pertormance test• In the app• Via the CLIContigure CLi command to run on your build pipelineSet up your performance testLoad profile ©Virtual users ©Fixed20 Mule20 virtual users run for 1 minute, each executina all requests sequentiallvData tile GSelect filePass test if...©MetricSelect optionIterationhl"Lukas sterka 121•in zn zmNo environmentv100% 2Inu / May 10.20.00UparadeVAIIAll variablesE EnvironmentNo environment selected, seled enulommenGlobalstokenCKPur5PqMxIZ@INOMi8kOfbaseUrlhttps://api.hubapi.comCeweToKenlCLLm5NnQMxIRQINQMI8kQ.• Local VaultStore your APl secrets locally in vault. Set up vaultGlobals Vault Tools?00O...
|
iTerm2
|
NULL
|
NULL
|
3591
|
|
3592
|
iTerm2ShellEditViewSessionScriptsProfilesWindowHel iTerm2ShellEditViewSessionScriptsProfilesWindowHelp# Lukas/Stefka 121 • in 2h 2m100% <478DEV (docker)DOCKERDEV (docker)882APP (-zsh)Jiminny-worker-processing-4:jiminny-worker-processing-4_00:jiminny-worker-processing-5:jiminny-worker-processing-5_00:stoppedstoppedworker-crm-update:worker-crm-update_00: stoppedworker-analytics:worker-analytics_00: stoppedworker-download:worker-download_00: stoppedworker:worker_00: stoppedjiminny-worker-processing-1:jiminny-worker-processing-1_00: stoppedworker-calendar:worker-calendar_00:stoppedworker-conferences:worker-conferences_00: stoppedworker-crm-sync:worker-crm-sync_00:stoppedworker-audio:worker-audio_00: stoppedworker-emails:worker-emails_00:stoppedartisan-schedule:artisan-schedule_00: stoppedworker-es-update:worker-es-update_00: stoppedartisan-schedule:artisan-schedule_00: startedjiminny-worker-processing-1:jiminny-worker-processing-1_00: startedjiminny-worker-processing-2:jiminny-worker-processing-2_00: startedjiminny-worker-processing-3:jiminny-worker-processing-3_00: startedjiminny-worker-processing-4:jiminny-worker-processing-4_00: startedjiminny-worker-processing-5:jiminny-worker-processing-5_00: startedjiminny-worker-processing-delayed: jiminny-worker-processing-delayed_00: startedworker:worker_00: startedworker-analytics:worker-analytics_00: startedworker-audio:worker-audio_00: startedworker-calendar:worker-calendar_00: startedworker-conferences:worker-conferences_00: startedworker-crm-sync:worker-crm-sync_00: startedworker-crm-update:worker-crm-update_00: startedworker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00: startedroot@docker_lamp_1:/home/jiminny# php artisan jiminny:debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# php artisan jiminny: debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# ]-zsh• $4screenpipe*•$5-zshThu 7 May 15:28:09T81₴6DEV...
|
iTerm2
|
NULL
|
NULL
|
3592
|
|
3593
|
root@docker_lamp_1:/home/jiminny# php artisan jimi root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Syncing opportunity 0
Syncing opportunity 25
Syncing opportunity 50
Syncing opportunity 75
Syncing opportunity 100
root@docker_lamp_1:/home/jiminny# php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 4.32ms DONE
cache [PASSWORD_DOTS] 10.62ms DONE
compiled [PASSWORD_DOTS] 3.60ms DONE
events [PASSWORD_DOTS] 2.60ms DONE
routes [PASSWORD_DOTS] 2.72ms DONE
views [PASSWORD_DOTS] 5.95ms DONE
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-download:worker-download_00: stopped
worker:worker_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-audio:worker-audio_00: stopped
worker-emails:worker-emails_00: stopped
artisan-schedule:artisan-schedule_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Syncing opportunity 0
Syncing opportunity 25
Syncing opportunity 50
Syncing opportunity 75
Syncing opportunity 100
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Syncing opportunity 0
Syncing opportunity 25
Syncing opportunity 50
Syncing opportunity 75
Syncing opportunity 100
root@docker_lamp_1:/home/jiminny#
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
-zsh
Close Tab
⌥⌘1
DEV (docker)...
|
iTerm2
|
DEV (docker)
|
NULL
|
3593
|
|
3594
|
root@docker_lamp_1:/home/jiminny# php artisan jimi root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Syncing opportunity 0
Syncing opportunity 25
Syncing opportunity 50
Syncing opportunity 75
Syncing opportunity 100
root@docker_lamp_1:/home/jiminny# php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 4.32ms DONE
cache [PASSWORD_DOTS] 10.62ms DONE
compiled [PASSWORD_DOTS] 3.60ms DONE
events [PASSWORD_DOTS] 2.60ms DONE
routes [PASSWORD_DOTS] 2.72ms DONE
views [PASSWORD_DOTS] 5.95ms DONE
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-download:worker-download_00: stopped
worker:worker_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-audio:worker-audio_00: stopped
worker-emails:worker-emails_00: stopped
artisan-schedule:artisan-schedule_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Syncing opportunity 0
Syncing opportunity 25
Syncing opportunity 50
Syncing opportunity 75
Syncing opportunity 100
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Syncing opportunity 0
Syncing opportunity 25
Syncing opportunity 50
Syncing opportunity 75
Syncing opportunity 100
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
-zsh
Close Tab
⌥⌘1
DEV (docker)...
|
iTerm2
|
DEV (docker)
|
NULL
|
3594
|
|
3595
|
root@docker_lamp_1:/home/jiminny# php artisan jimi root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Syncing opportunity 0
Syncing opportunity 25
Syncing opportunity 50
Syncing opportunity 75
Syncing opportunity 100
root@docker_lamp_1:/home/jiminny# php artisan optimize:clear && supervisorctl restart all
INFO Clearing cached bootstrap files.
config [PASSWORD_DOTS] 4.32ms DONE
cache [PASSWORD_DOTS] 10.62ms DONE
compiled [PASSWORD_DOTS] 3.60ms DONE
events [PASSWORD_DOTS] 2.60ms DONE
routes [PASSWORD_DOTS] 2.72ms DONE
views [PASSWORD_DOTS] 5.95ms DONE
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: stopped
worker-nudges:worker-nudges_00: stopped
jiminny-worker-processing-2:jiminny-worker-processing-2_00: stopped
jiminny-worker-processing-3:jiminny-worker-processing-3_00: stopped
jiminny-worker-processing-4:jiminny-worker-processing-4_00: stopped
jiminny-worker-processing-5:jiminny-worker-processing-5_00: stopped
worker-crm-update:worker-crm-update_00: stopped
worker-analytics:worker-analytics_00: stopped
worker-download:worker-download_00: stopped
worker:worker_00: stopped
jiminny-worker-processing-1:jiminny-worker-processing-1_00: stopped
worker-calendar:worker-calendar_00: stopped
worker-conferences:worker-conferences_00: stopped
worker-crm-sync:worker-crm-sync_00: stopped
worker-audio:worker-audio_00: stopped
worker-emails:worker-emails_00: stopped
artisan-schedule:artisan-schedule_00: stopped
worker-es-update:worker-es-update_00: stopped
artisan-schedule:artisan-schedule_00: started
jiminny-worker-processing-1:jiminny-worker-processing-1_00: started
jiminny-worker-processing-2:jiminny-worker-processing-2_00: started
jiminny-worker-processing-3:jiminny-worker-processing-3_00: started
jiminny-worker-processing-4:jiminny-worker-processing-4_00: started
jiminny-worker-processing-5:jiminny-worker-processing-5_00: started
jiminny-worker-processing-delayed:jiminny-worker-processing-delayed_00: started
worker:worker_00: started
worker-analytics:worker-analytics_00: started
worker-audio:worker-audio_00: started
worker-calendar:worker-calendar_00: started
worker-conferences:worker-conferences_00: started
worker-crm-sync:worker-crm-sync_00: started
worker-crm-update:worker-crm-update_00: started
worker-download:worker-download_00: started
worker-emails:worker-emails_00: started
worker-es-update:worker-es-update_00: started
worker-nudges:worker-nudges_00: started
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Syncing opportunity 0
Syncing opportunity 25
Syncing opportunity 50
Syncing opportunity 75
Syncing opportunity 100
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Syncing opportunity 0
Syncing opportunity 25
Syncing opportunity 50
Syncing opportunity 75
Syncing opportunity 100
root@docker_lamp_1:/home/jiminny# php artisan jiminny:debug
Syncing opportunity 0
HubSpot\Client\Crm\Deals\ApiException
[429] Client error: `GET [URL_WITH_CREDENTIALS]
DOCKER
Close Tab
DEV (docker)
Close Tab
APP (-zsh)
Close Tab
-zsh
Close Tab
screenpipe"
Close Tab
-zsh
Close Tab
⌥⌘1
DEV (docker)...
|
iTerm2
|
DEV (docker)
|
NULL
|
3595
|
|
3596
|
PhostormVIewINavigarecodeKeractorrTavsco.s?9 maste PhostormVIewINavigarecodeKeractorrTavsco.s?9 masterProledeyC. RateLimitaware.onpRateLimitException.php© SyncToUserPilot.phpC) RateLimitAwarewrapper.pnp•.gitignoree audio.wavC) AddRateLimitCommana.pnpT IntegrationApp/.../SyncCrmEntitiesTrait.php© BasicApi.php© SyncOpportunity.php© SyncOpportunitiesJob.php© HubspotWebhookBatchSyncStrategy.php© WebhookSyncBatchProcessor.phpE hubspot-journal-poll.log© ImportOpportunityBatch.phpTImportBatchJobTrait.phg)Middleware/RateLimited.pnp© Http/RateLimited.php© BaseRateLimiter.php© Service.phgE laravel.log‹ phpunit.xmlI ttt.js= oauth-private.kev( Hubspot/.../SyncCrmEntitiesTrait.phpc Opportunitysynclest.ono© RateLimiterInstance.php© ProviderRateLimiter.phpclass Client extends Basecllent implements Hubspotcllentintertaceououc tunction cetiooortunitvsv distrino Scrmid. arrav stlelds): arrav= ScrmidA2 468 M2 A V= oauth-public.kev= storagereason' => se->getMessaqeo= supervisord.oidwtext-relav.ison22%v tests→ Feature>M Intearation> M Servicesv Unit>M Actions>M comnonent> M Confiaurationi> M Console) M Contractc› D Domain> D DTO> D Enums)m Suonte> D Exceptions>C fixtures> C Guards> C Helpers>C Http.C IntegrationsC Interactions• M Jobs>DACTIVITM> M AiAutomation• D Audiov M AutomatedReportsC CreateResultsTest.ohoC RequestGenerateReno@ SendReportExpiringSoC) SendRenort.lohTect.ofC SendRenortMail.lobTe‹C SendRenortNotGenera• MCalendar• MCrm> D DealRisks) M Mailbay> C StreaminaMToamthrow se:if @ Sdeal instanceof DealWithAssociations)<throw new Crmexcentiond me'Deal not found'):return['id' => $deal->getIdO'properties' => $deal->getPropertieslassociationsi => Sdeal->aetAscociations0l* benerac buuch read mecnod ror nubsoor obfects* Anaram string SobiectTupe The obiect tupe ('deals', 'companies', 'contacts')* @param array<string> $crmIds Array of HubSpot object IDs (max 100)* doaram arrau<string> Stlelds Arrau of propertu names to fetch* dreturn arrausstrina. arrou> Arrau keued ou cri l with obnect dotaprivate function batchReadObiects(strina Sobiecttvoe, arrav Scrmids, arrav Sfields): arravif (emptv($crmIds)) $return1:Sthis->validateRatchSize(SohiectTvne. Scrmids)•Sthis->ensureValidTokend+ny dSbatchConfig = $this->createBatchConfiguration($objectType):$batchReadRequest = $this->prepareBatchRequest($batchConfig, $crmIds, $fields);Gnocnonco = Chatchfonfiaflanitl-snond/ChatchPoadPoauoct)•Sthis->validateApiResponse(Sresponse, SobiectType):lore // Don't ask again (today 10:25)= custom.log X = laravel.log4 SF jjiminny@localhost]HS_local (jiminny@localhost]# console [PKol)40 hl 0 # Lukas/Stefka 121 • in 2h 2 m100% @ 8Thu 7 May 15:28:37A console (eu)« console [STAGING]I IФШfo 4 spaces 0...
|
PhpStorm
|
faVsco.js – custom.log
|
NULL
|
3596
|
|
3597
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Editor for custom.log
Sync Changes
Hide This Notification
Code changed:
Hide
2
68
2
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Jiminny\Services\Crm\Hubspot;
use HubSpot\Client\Crm\Deals\ApiException as DealApiException;
use HubSpot\Client\Crm\Contacts\ApiException as ContactApiException;
use HubSpot\Client\Crm\Companies\ApiException as CompanyApiException;
use HubSpot\Client\Crm\Contacts\Model\SimplePublicObjectWithAssociations as ContactsWithAssociations;
use HubSpot\Client\Crm\Companies\Model\SimplePublicObjectWithAssociations as CompaniesWithAssociations;
use HubSpot\Client\Crm\Deals\Model\SimplePublicObjectWithAssociations as DealWithAssociations;
use HubSpot\Client\Crm\Objects\Model\SimplePublicObjectInput;
use HubSpot\Client\Crm\Objects\Model\SimplePublicObjectWithAssociations as ObjectWithAssociations;
use HubSpot\Client\Crm\Pipelines\Model\Error;
use HubSpot\Client\Crm\Pipelines\Model\PipelineStage;
use HubSpot\Client\Crm\Properties\Model\Property;
use HubSpot\Discovery\Discovery;
use Jiminny\Component\Utility\Service\ProviderRateLimiter;
use Jiminny\Exceptions\CrmException;
use Jiminny\Exceptions\RateLimitException;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Jobs\Crm\NoteObject;
use Jiminny\Models\Crm\Field;
use Jiminny\Services\Crm\BaseClient;
use Jiminny\Services\Crm\Hubspot\DTO\Response\Owner;
use Jiminny\Services\SocialAccountService;
use SevenShores\Hubspot\Exceptions\BadRequest;
use SevenShores\Hubspot\Exceptions\HubspotException;
use SevenShores\Hubspot\Factory;
use SevenShores\Hubspot\Http\Response;
use Jiminny\Services\Crm\Hubspot\Pagination\HubspotPaginationService;
use Throwable;
/**
* @phpstan-type CrmFieldOption array{id:string, label:string, value?:string}
*/
class Client extends BaseClient implements HubspotClientInterface
{
public const string MIN_API_VERSION = '2';
public const string BASE_URL = '[URL_WITH_CREDENTIALS] T
* @param callable(): T $apiCall
* @return T
*
* @throws RateLimitException
*/
private function executeRequest(callable $apiCall)
{
if (! $this->rateLimiter->canMakeRequest($this->config)) {
$retryAfter = $this->rateLimiter->requestAvailableIn($this->config);
$this->log->warning('[Hubspot] Rate limit exceeded, deferring request', [
'team_id' => $this->config->team_id,
'config_id' => $this->config->getId(),
'retry_after' => $retryAfter,
]);
throw new RateLimitException(
'Hubspot rate limit reached for configuration ' . $this->config->getId(),
$retryAfter,
);
}
$this->rateLimiter->incrementRequestCount($this->config);
try {
return $apiCall();
} catch (Throwable $e) {
if ($this->isHubspotRateLimit($e)) {
$retryAfter = $this->parseRetryAfter($e);
$this->log->warning('[Hubspot] Received 429 from API', [
'team_id' => $this->config->team_id,
'config_id' => $this->config->getId(),
'retry_after' => $retryAfter,
'reason' => $e->getMessage(),
]);
throw new RateLimitException('Hubspot returned 429', $retryAfter, $e);
}
throw $e;
}
}
private function isHubspotRateLimit(Throwable $e): bool
{
return method_exists($e, 'getCode') && (int) $e->getCode() === 429;
}
private function parseRetryAfter(Throwable $e): int
{
if (method_exists($e, 'getResponseHeaders')) {
$headers = $e->getResponseHeaders() ?: [];
$value = $headers['Retry-After'] ?? $headers['retry-after'] ?? null;
if (is_array($value)) {
$value = $value[0] ?? null;
}
if (is_numeric($value)) {
return (int) $value;
}
}
return 10;
}
public function getMinimumApiVersion(): string
{
return self::MIN_API_VERSION;
}
public function getInstance(): Factory
{
return new Factory([
'key' => $this->accessToken,
'oauth2' => true,
'base_url' => $this->baseUrl,
]);
}
public function getNewInstance(): Discovery
{
return \HubSpot\Factory::createWithAccessToken($this->accessToken);
}
/**
* Secondly and daily limits for Hubspot API
*
* Product Tier: Free & Starter | Professional & Enterprise | API add-on (any tier)
* Burst: 100/10 seconds | 150/10 seconds | 200/10 seconds
* Daily: 250,000 | 500,000 | 1,000,000
*
* Official documentation states: The search endpoints are rate limited to five requests per second.
* Since with 5 RPS were still hitting secondly rate limits we lowered it to 4
*/
public function getPaginatedData(array $payload, string $type, int $offset = 0): array
{
$total = 0;
$lastId = null;
$rows = [];
foreach ($this->getPaginatedDataGenerator($payload, $type, $offset, $total, $lastId) as $row) {
$rows[] = $row;
}
return ['results' => $rows, 'total' => $total, 'last_record' => $lastId];
}
/**
* @throws HubspotException
* @throws SocialAccountTokenInvalidException
* @throws BadRequest
*/
public function getPaginatedDataGenerator(
array $payload,
string $type,
int $offset = 0,
int &$total = 0,
?string &$lastRecordId = null
): \Generator {
return $this->paginationService->getPaginatedDataGenerator(
$this,
$payload,
$type,
$offset,
$total,
$lastRecordId
);
}
/**
* @throws DealApiException
* @throws CrmException
*/
public function getOpportunityById(string $crmId, array $fields): array
{
try {
// $deal = $this->executeRequest(fn () => $this->getNewInstance()->crm()->deals()->basicApi()->getById(
$deal = $this->getNewInstance()->crm()->deals()->basicApi()->getById(
$crmId,
implode(',', $fields),
'companies,contacts'
);
} catch (DealApiException $e) {
$this->log->info('[Hubspot] Failed to fetch opportunity', [
'crm_id' => $crmId,
'reason' => $e->getMessage(),
]);
throw $e;
}
if (! $deal instanceof DealWithAssociations) {
throw new CrmException('Deal not found');
}
return [
'id' => $deal->getId(),
'properties' => $deal->getProperties(),
'associations' => $deal->getAssociations(),
];
}
/**
* Generic batch read method for HubSpot objects
*
* @param string $objectType The object type ('deals', 'companies', 'contacts')
* @param array<string> $crmIds Array of HubSpot object IDs (max 100)
* @param array<string> $fields Array of property names to fetch
*
* @return array<string, array> Array keyed by CRM ID with object data
*/
private function batchReadObjects(string $objectType, array $crmIds, array $fields): array
{
if (empty($crmIds)) {
return [];
}
$this->validateBatchSize($objectType, $crmIds);
$this->ensureValidToken();
try {
$batchConfig = $this->createBatchConfiguration($objectType);
$batchReadRequest = $this->prepareBatchRequest($batchConfig, $crmIds, $fields);
$response = $batchConfig['api']->read($batchReadRequest);
$this->validateApiResponse($response, $objectType);
$results = $this->processApiResults($response);
$this->logBatchResults($objectType, $crmIds, $results);
return $results;
} catch (\Throwable $e) {
$this->handleBatchError($e, $objectType, $crmIds);
}
}
private function validateBatchSize(string $objectType, array $crmIds): void
{
if (count($crmIds) > 100) {
throw new \InvalidArgumentException("Batch size cannot exceed 100 {$objectType}");
}
}
private function createBatchConfiguration(string $objectType): array
{
$configurations = [
'deals' => [
'batchReadRequest' => new \HubSpot\Client\Crm\Deals\Model\BatchReadInputSimplePublicObjectId(),
'inputClass' => \HubSpot\Client\Crm\Deals\Model\SimplePublicObjectId::class,
'api' => $this->getNewInstance()->crm()->deals()->batchApi(),
],
'companies' => [
'batchReadRequest' => new \HubSpot\Client\Crm\Companies\Model\BatchReadInputSimplePublicObjectId(),
'inputClass' => \HubSpot\Client\Crm\Companies\Model\SimplePublicObjectId::class,
'api' => $this->getNewInstance()->crm()->companies()->batchApi(),
],
'contacts' => [
'batchReadRequest' => new \HubSpot\Client\Crm\Contacts\Model\BatchReadInputSimplePublicObjectId(),
'inputClass' => \HubSpot\Client\Crm\Contacts\Model\SimplePublicObjectId::class,
'api' => $this->getNewInstance()->crm()->contacts()->batchApi(),
],
];
if (! isset($configurations[$objectType])) {
throw new \InvalidArgumentException("Unsupported object type: {$objectType}");
}
return $configurations[$objectType];
}
private function prepareBatchRequest(array $batchConfig, array $crmIds, array $fields): object
{
$batchReadRequest = $batchConfig['batchReadRequest'];
$inputClass = $batchConfig['inputClass'];
$inputs = array_map(function ($crmId) use ($inputClass) {
$input = new $inputClass();
$input->setId($crmId);
return $input;
}, $crmIds);
$batchReadRequest->setInputs($inputs);
$batchReadRequest->setProperties($fields);
return $batchReadRequest;
}
private function validateApiResponse($response, string $objectType): void
{
if (! $response) {
throw new CrmException("HubSpot API returned null response for {$objectType} batch read");
}
}
private function processApiResults($response): array
{
$results = [];
$responseResults = $response->getResults();
if ($responseResults) {
foreach ($responseResults as $object) {
if ($object && $object->getId()) {
$results[$object->getId()] = [
'id' => $object->getId(),
'properties' => $object->getProperties() ?: [],
];
}
}
}
return $results;
}
private function logBatchResults(string $objectType, array $crmIds, array $results): void
{
$this->log->info("[HubSpot] Batch fetched {$objectType}", [
'requested_count' => count($crmIds),
'returned_count' => count($results),
'crm_ids' => $crmIds,
]);
}
private function handleBatchError(\Throwable $e, string $objectType, array $crmIds): void
{
$errorMessage = $e->getMessage() ?: 'Unknown error';
$errorTrace = $e->getTraceAsString() ?: 'No trace available';
$this->log->error("[HubSpot] Failed to batch fetch {$objectType}", [
'crm_ids' => $crmIds,
'error' => $errorMessage,
'trace' => $errorTrace,
]);
throw new CrmException("Failed to batch fetch {$objectType}: " . $errorMessage);
}
/**
* Batch read multiple opportunities by their CRM IDs
*
* @param array<string> $crmIds Array of HubSpot deal IDs (max 100)
* @param array<string> $fields Array of property names to fetch
*
* @return array<string, array> Array keyed by CRM ID with opportunity data
*/
public function getOpportunitiesByIds(array $crmIds, array $fields): array
{
return $this->batchReadObjects('deals', $crmIds, $fields);
}
/**
* Batch read multiple companies by their CRM IDs
*
* @param array<string> $crmIds Array of HubSpot company IDs (max 100)
* @param array<string> $fields Array of property names to fetch
*
* @return array<string, array> Array keyed by CRM ID with company data
*/
public function getCompaniesByIds(array $crmIds, array $fields): array
{
return $this->batchReadObjects('companies', $crmIds, $fields);
}
/**
* Batch read multiple contacts by their CRM IDs
*
* @param array<string> $crmIds Array of HubSpot contact IDs (max 100)
* @param array<string> $fields Array of property names to fetch
*
* @return array<string, array> Array keyed by CRM ID with contact data
*/
public function getContactsByIds(array $crmIds, array $fields): array
{
return $this->batchReadObjects('contacts', $crmIds, $fields);
}
/**
* @throws CompanyApiException
* @throws CrmException
*/
public function getAccountById(string $crmId, array $fields): array
{
try {
$company = $this->getNewInstance()->crm()->companies()->basicApi()->getById(
$crmId,
implode(',', $fields),
);
} catch (CompanyApiException $e) {
$this->log->info('[Hubspot] Failed to fetch account', [
'crm_id' => $crmId,
'reason' => $e->getMessage(),
]);
throw $e;
}
if (! $company instanceof CompaniesWithAssociations) {
throw new CrmException('Account not found');
}
return [
'id' => $company->getId(),
'properties' => $company->getProperties(),
];
}
/**
* @throws ContactApiException
* @throws CrmException
*/
public function getContactById(string $crmId, array $fields): array
{
try {
$contact = $this->getNewInstance()->crm()->contacts()->basicApi()->getById(
$crmId,
implode(',', $fields)
);
} catch (ContactApiException $e) {
$this->log->info('[Hubspot] Failed to fetch contact', [
'crm_id' => $crmId,
'reason' => $e->getMessage(),
]);
throw $e;
}
if (! $contact instanceof ContactsWithAssociations) {
throw new CrmException('Contact not found');
}
return [
'id' => $contact->getId(),
'properties' => $contact->getProperties(),
];
}
/**
* This is email search request that Hubspot offers as GET (more generous quota)
*/
public function getContactByEmail(string $email, array $fields = []): array
{
try {
$contact = $this->getNewInstance()->crm()->contacts()->basicApi()->getById(
$email,
implode(',', $fields),
null,
false,
'email'
);
return [
'id' => $contact->getId(),
'properties' => $contact->getProperties(),
];
} catch (ContactApiException $e) {
$this->log->info('[Hubspot] Failed to fetch contact', [
'email' => $email,
'reason' => $e->getMessage(),
]);
return [];
}
}
/**
* @throws CrmException
*/
public function fetchProperty(string $objectType, string $propertyId): Property
{
$result = $this->getNewInstance()->crm()->properties()->coreApi()->getByName($objectType, $propertyId);
if (! $result instanceof Property) {
$this->log->error('[Hubspot] Failed to fetch property', [
'object_type' => $objectType,
'property_id' => $propertyId,
'reason' => $result->getMessage(),
]);
throw new CrmException('Failed to fetch property');
}
return $result;
}
/**
* @return array<CrmFieldOption>
*/
public function fetchPropertyOptions(string $objectType, string $propertyId): array
{
/** @var array<CrmFieldOption> */
return $this->fetchProperty($objectType, $propertyId)->getOptions();
}
/**
* @return array<array{id:string, label:string, deleted:bool}>
*/
public function fetchCallDispositions(): array
{
/** @var Response $response */
$response = $this->getInstance()->engagements()->getCallDispositions();
/**
* @var array<array{
* id:string,
* label:string,
* deleted: bool
* }>
*/
return $response->toArray();
}
/**
* @return array<CrmFieldOption>
*/
public function fetchOpportunityPipelineStages(): array
{
$stages = [];
$apiResponse = $this->getNewInstance()->crm()->pipelines()->pipelinesApi()->getAll('deals');
if ($apiResponse instanceof Error) {
$this->log->error('[Hubspot] Failed to fetch opportunity pipelines', [
'reason' => $apiResponse->getMessage(),
]);
return [];
}
foreach ($apiResponse->getResults() as $pipeline) {
$pipelineStages = array_map(
static function (PipelineStage $stage) {
return [
'id' => $stage->getId(),
'label' => $stage->getLabel(),
];
},
$pipeline->getStages()
);
$stages = array_merge($stages, $pipelineStages);
}
return $stages;
}
public function fetchOpportunityPipelines(): array
{
$pipelines = [];
try {
$apiResponse = $this->makeRequest('/crm/v3/pipelines/deals');
} catch (\Exception $e) {
$this->log->info('[Hubspot] Failed to fetch opportunity pipelines', [
'reason' => $e->getMessage(),
]);
return [];
}
$response = $apiResponse->toArray();
foreach ($response['results'] as $pipeline) {
$pipelines[] = [
'id' => $pipeline['id'],
'label' => $pipeline['label'],
];
}
return $pipelines;
}
/**
* @return array<CrmFieldOption>
*/
public function fetchMeetingOutcomeFieldOptions(Field $field): array
{
return $field->getCrmProviderId() === 'meetingOutcome'
? $this->fetchMeetingOutcomeTypes()
: $this->fetchCallActivityTypes();
}
public function fetchMeetingOutcomeTypes(): array
{
return $this->extractMeetingTypeOptions(
'[URL_WITH_CREDENTIALS] Response $response */
$response = $this->getInstance()
->getClient()
->request('GET', $endpoint);
/**
* @var array<array{
* value: string,
* label: string,
* displayOrder: int
* }> $optionData
*/
$optionData = $response->toArray()['options'] ?? [];
$options = [];
foreach ($optionData as $item) {
$options[] = [
'id' => $item['value'],
'value' => $item['value'],
'label' => $item['label'],
'display_order' => $item['displayOrder'],
];
}
return $options;
}
/**
* @return array<CrmFieldOption>
*/
public function fetchDispositionFieldOptions(): array
{
$options = [];
$dispositions = $this->fetchCallDispositions();
foreach ($dispositions as $disposition) {
if ($disposition['deleted'] !== false) {
continue;
}
$option['value'] = $disposition['id'];
$option['id'] = $disposition['id'];
$option['label'] = $disposition['label'];
$options[] = $option;
}
return $options;
}
/**
* @return array<CrmFieldOption>
*/
public function fetchOpportunityFieldOptions(Field $field): array
{
if ($field->isStageField()) {
return $this->fetchOpportunityPipelineStages();
}
if ($field->isPipelineField()) {
return $this->fetchOpportunityPipelines();
}
return $this->fetchPropertyOptions('deals', $field->getCrmProviderId());
}
/**
* @throws BadRequest
* @throws HubspotException
*/
public function makeRequest(string $endpoint, $method = 'GET', $payload = [], ?string $queryString = null)
{
$endpoint = self::BASE_URL . $endpoint;
if ($method === 'GET') {
$response = $this->getInstance()->getClient()?->request(
method: $method,
endpoint: $endpoint,
query_string: $queryString
);
} else {
$response = $this->getInstance()->getClient()->request($method, $endpoint, [
'json' => ($payload),
]);
}
$max = $response->getHeaderLine('X-HubSpot-RateLimit-Max'); // "110"
$remaining = $response->getHeaderLine('X-HubSpot-RateLimit-Remaining'); // "109"
$interval = $response->getHeaderLine('X-HubSpot-RateLimit-Interval-Milliseconds'); // "10000"
$body = json_decode((string) $response->getBody(), true);
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$max ' . PHP_EOL . print_r($max, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$remaining ' . PHP_EOL . print_r($remaining, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$interval ' . PHP_EOL . print_r($interval, true));
\Illuminate\Support\Facades\Log::channel('custom_channel')->info('$body ' . PHP_EOL . print_r($body, true));
return $response;
}
/**
* @throws BadRequest
* @throws HubspotException
*/
public function createMeeting(array $payload): Response
{
$endpoint = '/crm/v3/objects/meetings';
return $this->makeRequest($endpoint, 'POST', $payload);
}
/**
* @throws BadRequest
* @throws HubspotException
*/
public function updateMeeting(string $meetingId, array $payload): Response
{
$endpoint = '/crm/v3/objects/meetings/' . $meetingId;
return $this->makeRequest($endpoint, 'PATCH', $payload);
}
/**
* @throws \Exception
*/
public function createNote(
string $body,
string $ownerId,
int $timestamp,
string $objectId,
NoteObject $noteObject
): ?string {
try {
$noteInput = new SimplePublicObjectInput([
'properties' => [
'hs_note_body' => $body,
'hubspot_owner_id' => $ownerId,
'hs_timestamp' => $timestamp,
],
]);
// Create note
$note = $this->getNewInstance()->crm()->objects()->basicApi()->create('note', $noteInput);
$this->getNewInstance()->crm()->objects()->associationsApi()->create(
'note',
$note->getId(),
$this->getNoteObject($noteObject),
$objectId,
$this->getNoteAssociationType($noteObject),
);
return $note->getId();
} catch (\Exception $e) {
$this->log->error('[Hubspot] Failed to create note', [
'objectId' => $objectId,
'noteObject' => $noteObject->getObjectType(),
'reason' => $e->getMessage(),
]);
\Sentry::captureException($e);
}
return null;
}
public function updateEngagement(string $objectId, array $engagement, array $metadata): void
{
$this->getInstance()->engagements()->update($objectId, $engagement, $metadata);
}
public function getEngagementData(string $engagementId): array
{
$engagement = $this->getInstance()->engagements()->get($engagementId);
return $engagement->toArray();
}
public function createEngagement(array $engagement, array $associations, array $metadata): Response
{
return $this->getInstance()
->engagements()
->create($engagement, $associations, $metadata);
}
public function isUnauthorizedException(\Exception $e): bool
{
// Check for specific HubSpot API exception types first
if ($e instanceof BadRequest) {
// BadRequest can contain 401 status codes
return $e->getCode() === 401;
}
// Check for HTTP client exceptions with status codes
if ($e instanceof \GuzzleHttp\Exception\RequestException && $e->hasResponse()) {
$response = $e->getResponse();
if ($response !== null) {
return $response->getStatusCode() === 401;
}
}
// Check for Guzzle HTTP exceptions
if ($e instanceof \GuzzleHttp\Exception\ClientException) {
return $e->getCode() === 401;
}
// Fallback to string matching as last resort, but be more specific
$message = strtolower($e->getMessage());
return str_contains($message, '401 unauthorized') ||
str_contains($message, 'http 401') ||
str_contains($message, 'status code 401') ||
(preg_match('/\b401\b/', $message) && str_contains($message, 'unauthorized'));
}
/**
* Validates and refreshes the access token if needed before API requests.
* This ensures long-running processes don't fail due to token expiration.
*
* @throws SocialAccountTokenInvalidException
*/
public function ensureValidToken(): void
{
if ($this->oauthAccount === null) {
return;
}
$newToken = $this->tokenManager->ensureValidToken($this->oauthAccount);
if ($newToken !== null) {
$this->accessToken = $newToken;
}
}
public function getConfig()
{
return $this->config;
}
// returns only active (archived=false)
public function getOwners(): array
{
return $this->getNewInstance()->crm()->owners()->getAll();
}
/**
* @param bool $archived
*
* @return array<Owner>|[]
*/
public function getOwnersArchived(bool $archived = true): array
{
$endpoint = '/crm/v3/owners';
$queryParams = [
'archived' => $archived ? 'true' : 'false',
];
$queryString = http_build_query($queryParams);
$owners = [];
try {
$response = $this->makeRequest(endpoint: $endpoint, queryString: $queryString);
$responseData = $response?->toArray();
foreach ($responseData['results'] as $result) {
try {
$owners[] = Owner::create($result);
} catch (Throwable $e) {
$this->log->error('[HubSpot] Failed to process owner data', [
'result' => $result,
'error' => $e->getMessage(),
]);
continue;
}
}
} catch (Throwable $e) {
$this->log->error('HubSpot] Failed to fetch owners', [
'archived' => $archived,
'error' => $e->getMessage(),
]);
return [];
}
return $owners;
}
public function getMeeting(string $engagementId): ObjectWithAssociations
{
return $this->getNewInstance()->crm()->objects()->basicApi()
->getById('meeting', $engagementId, null, 'contact,company,deal');
}
public function deleteEngagement(string $engagementId): void
{
$this->getInstance()->engagements()->delete((int) $engagementId);
}
public function getAssociationsData(array $ids, string $fromObject, string $toObject): array
{
$associationData = [];
$idChunks = array_chunk($ids, self::ASSOCIATIONS_BATCH_SIZE_LIMIT);
foreach ($idChunks as $idChunk) {
try {
$batchInput = new \HubSpot\Client\Crm\Associations\Model\BatchInputPublicObjectId();
$batchInput->setInputs(array_map(function ($id) {
$publicObjectId = new \HubSpot\Client\Crm\Associations\Model\PublicObjectId();
$publicObjectId->setId($id);
return $publicObjectId;
}, $idChunk));
$associatedObjectsData = $this
->getNewInstance()
->crm()
->associations()
->batchApi()
->read($fromObject, $toObject, $batchInput);
if ($associatedObjectsData instanceof \HubSpot\Client\Crm\Associations\Model\BatchResponsePublicAssociationMulti) {
foreach ($associatedObjectsData->getResults() as $association) {
$from = $association->getFrom()->getId();
$toAssociations = $association->getTo();
if (! empty($toAssociations)) {
$associationData[$from] = array_map(function ($item) {
return $item->getId();
}, $toAssociations);
}
}
}
} catch (\Exception $e) {
$this->log->error('[Hubspot] Failed to fetch associations', [
'from_object' => $fromObject,
'to_object' => $toObject,
'reason' => $e->getMessage(),
]);
}
}
return $associationData;
}
/**
* @throws \Exception
*/
private function getNoteAssociationType(NoteObject $noteObject): string
{
return match($noteObject) {
NoteObject::Opportunity => 'note_to_deal',
NoteObject::Lead, NoteObject::Contact => 'note_to_contact', // or 'note_to_lead' if your portal supports it
NoteObject::Account => 'note_to_company',
NoteObject::Call, NoteObject::Event => throw new \Exception('Not supported'),
};
}
/**
* @throws \Exception
*/
private function getNoteObject(NoteObject $noteObject): string
{
return match($noteObject) {
NoteObject::Opportunity => 'deal',
NoteObject::Lead, NoteObject::Contact => 'contact',
NoteObject::Account => 'company',
NoteObject::Call, NoteObject::Event => throw new \Exception('Not supported'),
};
}
public function addAssociations(string $objectType, string $associationType, array $payload): Response
{
$endpoint = "/crm/v4/associations/$objectType/$associationType/batch/create";
return $this->makeRequest($endpoint, 'POST', $payload);
}
public function removeAssociations(string $objectType, string $associationType, array $payload): Response
{
$endpoint = "/crm/v4/associations/$objectType/$associationType/batch/archive";
return $this->makeRequest($endpoint, 'POST', $payload);
}
}
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
PhpStorm
|
faVsco.js – custom.log
|
NULL
|
3597
|
|
3598
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
PhostormVIewINavigarecodeKeractorFV faVsco.js°9 master kProiectC. RateLimitaware.onoRateLimitException.php© SyncToUserPilot.phpC) RateLimitAwarewrapper.pnp•.gitignoree audio.wav© AddRateLimitCommand.phpT IntegrationApp/.../SyncCrmEntitiesTrait.php© BasicApi.php© SyncOpportunity.php© SyncOpportunitiesJob.php© HubspotWebhookBatchSyncStrategy.php© WebhookSyncBatchProcessor.phpE hubspot-journal-poll.log© ImportOpportunityBatch.phpTImportBatchJobTrait.phg)Middleware/RateLimited.onp* Http/RateLimited.php© BaseRateLimiter.php© Service.phgE laravel.log<> phpunit.xmlI ttt.js= oauth-private.kev( Hubspot/.../SyncCrmEntitiesTrait.phpc Opportunitysynclest.ono© RateLimiterInstance.php© ProviderRateLimiter.phpclass Client extends Basecllent implements Hubspotcllentintertaceououc tunction cetiooortunitvsv distrino Scrmid. arrav stlelds): arrav= ScrmidA2 A68 M2 A V=oauth-public.key= storagereason => se-›getMessaqe=supervisord.pidwtext-relav.ison22%v tests→ Feature>M Intearation> M Servicesv Unit>M Actions>M comnonent> M Confiaurationi> M Console) M Contractc› D Domain>DDTO> D Enums)m Suonte> D Exceptions>C fixtures> C Guards> C Helpers>C Http.C IntegrationsC Interactions• M Jobs>DActivIt> M AiAutomation• D Audiov M AutomatedReportsC CreateResultsTest.ohoC RequestGenerateReno@ SendReportExpiringSoC) SendRenort.lohTect.ofC SendRenortMail.lobTe‹C SendRenortNotGenera• MCalendar• MCrm> D DealRisks) M Mailbay> C StreaminaMToamthrow se:if @ Sdeal instanceof DealWithAssociations)<throw new Crmexcentione me'Deal not found'):return'id' => $deal->getIdO'properties' => $deal->getPropertieslassociationsi => Sdeal->aetAscociations0l* benerac buuch read mecnod ror nubsoor obfects* Ananam string SobiectTupe The obiect tupe ('deals', 'companies'. 'contacts')* @param array<string> $crmIds Array of HubSpot object IDs (max 100)* doaram arrau<string> Stlelds Arrau of propertu names to fetch* dreturn arrausstrina. arrou> Arrau keued ou cri l with obnect dotaprivate function batchReadObiects(strina Sobiecttvoe, arrav Scrmids, arrav Sfields): arravif (emptv($crmIds)) $return1:Sthis->validateRatchSize(Sohiecttvne Scrmids)•Sthis->ensureValidTokeno+ny dChatchfonfia= cthic-scnontoRatchfonGiaunation/Cohdion+tvno).$batchReadRequest = $this->prepareBatchRequest($batchConfig, $crmIds, $fields);Sresponse = $batchConfig['api']->read($batchReadRequest);Sthis->validateApiResponse(Sresponse, SobiectType):SonarQube for INF suadections: Netect more cecurity iccuec in vour DHP filec II Try Sae Sorver II Iearn more II Don't ack adain (todav 10-25)= cushom.log X = laravel.log4 SF jjiminny@localhost]A HS_local [jiminny@localhost]# console [PKol)40 hl 0 # Lukas/Stefka 121 • in 2h 2 m100% CThu 7 May 15:28:42AskJiminnyReportActivityServiceTest vA console (eu)« console [STAGING]W Windsurf ToamoUTF-8...
|
PhpStorm
|
faVsco.js – custom.log
|
NULL
|
3598
|
|
3599
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
iTerm2ShellEditViewSessionScriptsProfilesWindowHelplih)• Lukas/Stefka 121 • in 2h 2 m100%8DEV (docker)Thu 7 May 15:28:42181₴6DOCKER- ₴81DEV (docker)H82worker-download:worker-download_00:startedworker-emails:worker-emails_00: startedworker-es-update:worker-es-update_00: startedworker-nudges:worker-nudges_00: startedroot@docker_lamp_1:/home/jiminny#php artisan jiminny: debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncingopportunity 100root@docker_lamp_1:/home/jiminny# php artisan jiminny:debugSyncing opportunity 0Syncing opportunity 25Syncing opportunity 50Syncing opportunity 75Syncing opportunity 100root@docker_lamp_1:/home/jiminny# php artisan jiminny:debugSyncing opportunity 0APP (-zsh)-zsh|• 84screenpipe*-zshDEVHubSpot\Client\Crm\Deals\ApiException[429] Client error: *GET [URL_WITH_CREDENTIALS] ]...
|
PhpStorm
|
faVsco.js – custom.log
|
NULL
|
3599
|
|
3600
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
[2026-05-07 12:28:10] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"d4ce87a9-6ca5-4efe-99b3-4220893270d0","trace_id":"724e8238-2ed5-4089-9509-9c7c12a3c373"}
[2026-05-07 12:28:10] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {"correlation_id":"d4ce87a9-6ca5-4efe-99b3-4220893270d0","trace_id":"724e8238-2ed5-4089-9509-9c7c12a3c373"}
[2026-05-07 12:28:10] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"d4ce87a9-6ca5-4efe-99b3-4220893270d0","trace_id":"724e8238-2ed5-4089-9509-9c7c12a3c373"}
[2026-05-07 12:28:14] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"172d1ae8-b8cc-4804-bed9-e32d074e265c","trace_id":"4817cdef-8d3e-4914-8bee-feffb18efe1b"}
[2026-05-07 12:28:14] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"172d1ae8-b8cc-4804-bed9-e32d074e265c","trace_id":"4817cdef-8d3e-4914-8bee-feffb18efe1b"}
[2026-05-07 12:28:17] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"273355f2-6315-4b20-bc9a-c26c681d6344","trace_id":"5ea79a26-c838-48e8-9913-93ad508146a6"}
[2026-05-07 12:28:17] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"273355f2-6315-4b20-bc9a-c26c681d6344","trace_id":"5ea79a26-c838-48e8-9913-93ad508146a6"}
[2026-05-07 12:28:17] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"273355f2-6315-4b20-bc9a-c26c681d6344","trace_id":"5ea79a26-c838-48e8-9913-93ad508146a6"}
[2026-05-07 12:28:17] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1499,"provider":"hubspot","refreshToken":"96f94c623a404e02ebdbf07f1b75707bb6cdbf848cbf45d418baf608c41a8d86","state":"connected"} {"correlation_id":"273355f2-6315-4b20-bc9a-c26c681d6344","trace_id":"5ea79a26-c838-48e8-9913-93ad508146a6"}
[2026-05-07 12:28:18] local.NOTICE: Monitoring start {"correlation_id":"31aa6b7d-00d6-448a-bdcc-a3d215b4aeb5","trace_id":"b8eb7fe5-8471-4ffb-9bfa-a804c8e1ff72"}
[2026-05-07 12:28:18] local.NOTICE: Monitoring end {"correlation_id":"31aa6b7d-00d6-448a-bdcc-a3d215b4aeb5","trace_id":"b8eb7fe5-8471-4ffb-9bfa-a804c8e1ff72"}
[2026-05-07 12:28:18] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"273355f2-6315-4b20-bc9a-c26c681d6344","trace_id":"5ea79a26-c838-48e8-9913-93ad508146a6"}
[2026-05-07 12:28:18] local.INFO: [SocialAccountObserver] Access token was modified, encrypting {"correlation_id":"273355f2-6315-4b20-bc9a-c26c681d6344","trace_id":"5ea79a26-c838-48e8-9913-93ad508146a6"}
[2026-05-07 12:28:18] local.INFO: [SocialAccountService] Token refreshed {"socialAccountId":1499,"provider":"hubspot","state":"connected"} {"correlation_id":"273355f2-6315-4b20-bc9a-c26c681d6344","trace_id":"5ea79a26-c838-48e8-9913-93ad508146a6"}
[2026-05-07 12:28:18] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {"crm_provider":"hubspot","crm_owner":148,"team_id":2} {"correlation_id":"273355f2-6315-4b20-bc9a-c26c681d6344","trace_id":"5ea79a26-c838-48e8-9913-93ad508146a6"}
[2026-05-07 12:28:19] local.INFO: [Hubspot] Failed to fetch opportunity {"crm_id":"374720564","reason":"[429] Client error: `GET https://api.hubapi.com/crm/v3/objects/deals/374720564?properties=hs_object_id%2Cdealname&associations=companies%2Ccontacts&archived=0` resulted in a `429 Too Many Requests` response:
{\"status\":\"error\",\"message\":\"You have reached your ten_secondly_rolling limit.\",\"errorType\":\"RATE_LIMIT\",\"correlationId\" (truncated...)
"} {"correlation_id":"273355f2-6315-4b20-bc9a-c26c681d6344","trace_id":"5ea79a26-c838-48e8-9913-93ad508146a6"}
[2026-05-07 12:28:19] local.ERROR: [429] Client error: `GET https://api.hubapi.com/crm/v3/objects/deals/374720564?properties=hs_object_id%2Cdealname&associations=companies%2Ccontacts&archived=0` resulted in a `429 Too Many Requests` response:
{"status":"error","message":"You have reached your ten_secondly_rolling limit.","errorType":"RATE_LIMIT","correlationId" (truncated...)
{"exception":"[object] (HubSpot\\Client\\Crm\\Deals\\ApiException(code: 429): [429] Client error: `GET https://api.hubapi.com/crm/v3/objects/deals/374720564?properties=hs_object_id%2Cdealname&associations=companies%2Ccontacts&archived=0` resulted in a `429 Too Many Requests` response:
{\"status\":\"error\",\"message\":\"You have reached your ten_secondly_rolling limit.\",\"errorType\":\"RATE_LIMIT\",\"correlationId\" (truncated...)
at /home/jiminny/vendor/hubspot/api-client/codegen/Crm/Deals/Api/BasicApi.php:704)
[stacktrace]
#0 /home/jiminny/vendor/hubspot/api-client/codegen/Crm/Deals/Api/BasicApi.php(676): HubSpot\\Client\\Crm\\Deals\\Api\\BasicApi->getByIdWithHttpInfo('374720564', 'hs_object_id,de...', 'companies,conta...', false, NULL)
#1 /home/jiminny/app/Services/Crm/Hubspot/Client.php(212): HubSpot\\Client\\Crm\\Deals\\Api\\BasicApi->getById('374720564', 'hs_object_id,de...', 'companies,conta...')
#2 /home/jiminny/app/Services/Crm/Hubspot/ServiceTraits/OpportunitySyncTrait.php(130): Jiminny\\Services\\Crm\\Hubspot\\Client->getOpportunityById('374720564', Array)
#3 /home/jiminny/app/Console/Commands/JiminnyDebugCommand.php(351): Jiminny\\Services\\Crm\\Hubspot\\Service->syncOpportunity('374720564')
#4 /home/jiminny/app/Console/Commands/JiminnyDebugCommand.php(44): Jiminny\\Console\\Commands\\JiminnyDebugCommand->rateLimit()
#5 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Jiminny\\Console\\Commands\\JiminnyDebugCommand->handle(Object(Jiminny\\Jobs\\JobDispatcher), Object(Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService), Object(Jiminny\\Repositories\\AutomatedReportsRepository), Object(Jiminny\\Services\\UserPilot\\UserPilotClient))
#6 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/Util.php(43): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#7 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(96): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure))
#8 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure))
#9 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/Container.php(799): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL)
#10 /home/jiminny/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\\Container\\Container->call(Array)
#11 /home/jiminny/vendor/symfony/console/Command/Command.php(341): Illuminate\\Console\\Command->execute(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle))
#12 /home/jiminny/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\\Component\\Console\\Command\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle))
#13 /home/jiminny/vendor/symfony/console/Application.php(1117): Illuminate\\Console\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#14 /home/jiminny/vendor/symfony/console/Application.php(356): Symfony\\Component\\Console\\Application->doRunCommand(Object(Jiminny\\Console\\Commands\\JiminnyDebugCommand), Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#15 /home/jiminny/vendor/symfony/console/Application.php(195): Symfony\\Component\\Console\\Application->doRun(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#16 /home/jiminny/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(198): Symfony\\Component\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#17 /home/jiminny/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1235): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#18 /home/jiminny/artisan(13): Illuminate\\Foundation\\Application->handleCommand(Object(Symfony\\Component\\Console\\Input\\ArgvInput))
#19 {main}
"} {"correlation_id":"273355f2-6315-4b20-bc9a-c26c681d6344","trace_id":"5ea79a26-c838-48e8-9913-93ad508146a6"}
[2026-05-07 12:28:20] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"dcb9b24b-e2e5-41fe-81db-212b3ca9ff7d","trace_id":"1ea62b83-9639-41e3-a523-26404c39fa80"}
[2026-05-07 12:28:20] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"dcb9b24b-e2e5-41fe-81db-212b3ca9ff7d","trace_id":"1ea62b83-9639-41e3-a523-26404c39fa80"}
[2026-05-07 12:28:24] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"d191d5c6-133f-43e1-8ed4-d285d0c768b8","trace_id":"67798138-bdb7-4bd7-8b32-377663219a88"}
[2026-05-07 12:28:24] local.INFO: [EmailSchedule] STARTING batch process {"host":"docker_lamp_1"} {"correlation_id":"d191d5c6-133f-43e1-8ed4-d285d0c768b8","trace_id":"67798138-bdb7-4bd7-8b32-377663219a88"}
[2026-05-07 12:28:24] local.INFO: [EmailSchedule] FINISHED batch process {"host":"docker_lamp_1","processed":0} {"correlation_id":"d191d5c6-133f-43e1-8ed4-d285d0c768b8","trace_id":"67798138-bdb7-4bd7-8b32-377663219a88"}
[2026-05-07 12:28:24] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"d191d5c6-133f-43e1-8ed4-d285d0c768b8","trace_id":"67798138-bdb7-4bd7-8b32-377663219a88"}
[2026-05-07 12:28:27] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:count","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"a4e5e18f-9f8c-4196-ace0-bf664d4827d9","trace_id":"d75cb10b-4c76-4c00-84d4-26efeb738e17"}
[2026-05-07 12:28:27] local.INFO: Running conference:monitor:count command for activities in (2026-05-07 12:26:00, 2026-05-07 12:28:00] {"correlation_id":"a4e5e18f-9f8c-4196-ace0-bf664d4827d9","trace_id":"d75cb10b-4c76-4c00-84d4-26efeb738e17"}
[2026-05-07 12:28:27] local.INFO: [conference:monitor:count] No activities found in (2026-05-07 12:26:00, 2026-05-07 12:28:00] {"correlation_id":"a4e5e18f-9f8c-4196-ace0-bf664d4827d9","trace_id":"d75cb10b-4c76-4c00-84d4-26efeb738e17"}
[2026-05-07 12:28:27] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:count","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"a4e5e18f-9f8c-4196-ace0-bf664d4827d9","trace_id":"d75cb10b-4c76-4c00-84d4-26efeb738e17"}
[2026-05-07 12:28:30] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"calendar:sync","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:30] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:batch:retry-failed","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"3789f06a-4f0c-4b12-be80-d6a36e089d1b","trace_id":"6ce89147-1624-456d-9e75-f4948f2c5db8"}
[2026-05-07 12:28:30] local.NOTICE: Calendar sync start {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:30] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:batch:retry-failed","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"3789f06a-4f0c-4b12-be80-d6a36e089d1b","trace_id":"6ce89147-1624-456d-9e75-f4948f2c5db8"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1393,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1393,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1393,"provider":"google","refreshToken":"5aa7e2d96b53201cd16fca5d2e4ef3ad03320971fc064781d18aee3ae7b99fbf","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1393,"provider":"google","responseBody":{"error":"invalid_grant","error_description":"Account has been deleted"}} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1393,"provider":"google","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1387,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1387,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1387,"provider":"google","refreshToken":"8157ac6de94842937194009e9c50e459253600f799dacf6a40755ffdbeb5bba6","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1387,"provider":"google","responseBody":{"error":"invalid_grant","error_description":"Account has been deleted"}} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1387,"provider":"google","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1348,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1348,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1348,"provider":"google","refreshToken":"9e7d13d3032d0cb1b79d8e95aef01383e8e91eb52ff8ee960c8a0b6b95cd8c73","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1348,"provider":"google","responseBody":{"error":"invalid_grant","error_description":"Bad Request"}} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1348,"provider":"google","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1361,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1361,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1361,"provider":"google","refreshToken":"6c843da199c2b9907445329304fcc4ec5057a4ee748d8299641764395c08e1fd","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1361,"provider":"google","responseBody":{"error":"invalid_grant","error_description":"Account has been deleted"}} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1361,"provider":"google","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1310,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1310,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1310,"provider":"google","refreshToken":"e34818922c2830a660813a63f6169a4a9a992ae2cccd7dc8dd7796cfdb470ef1","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1310,"provider":"google","responseBody":{"error":"invalid_grant","error_description":"Bad Request"}} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1310,"provider":"google","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1333,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1333,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1333,"provider":"google","refreshToken":"6c902986546d8e8da1dc539b046cdc1d458f519acc972e5b5f1d6a1a295165e0","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1333,"provider":"google","responseBody":{"error":"unauthorized_client","error_description":"Unauthorized"}} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1333,"provider":"google","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1368,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1368,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1368,"provider":"google","refreshToken":"d2f128898ff8543bd16b69cfae37896ab85119b0f5ed2b431d739593bb600333","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1368,"provider":"google","responseBody":{"error":"invalid_grant","error_description":"Bad Request"}} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1368,"provider":"google","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1365,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1365,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1365,"provider":"google","refreshToken":"7676e4a9afcd082b413248ab5ec6e487021fec6a9bdf315860a59cefad9caad8","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1365,"provider":"google","responseBody":{"error":"unauthorized_client","error_description":"Unauthorized"}} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1365,"provider":"google","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1364,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1364,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1364,"provider":"google","refreshToken":"dd5882ebce76e645292ce33ae74238abbb77c0a4ecc6a2bfe723cad82e72ba8e","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1364,"provider":"google","responseBody":{"error":"unauthorized_client","error_description":"Unauthorized"}} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1364,"provider":"google","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1370,"provider":"office"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1370,"provider":"office"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1370,"provider":"office","refreshToken":"b7ee8035306d0043cea6e00e7c4fe14f745e44074a1194db62a31cdf8b70af3e","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1370,"provider":"office","responseBody":"{\"error\":\"invalid_client\",\"error_description\":\"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app 'bbcbb2ef-6200-4fae-82bd-d81f5dd738da'. Trace ID: e890fdc1-dbe8-4a59-ae57-2af6bced3c00 Correlation ID: 57554cdf-16df-47f1-b0d9-5f0b8da37afe Timestamp: 2026-05-07 12:28:33Z\",\"error_codes\":[7000215],\"timestamp\":\"2026-05-07 12:28:33Z\",\"trace_id\":\"e890fdc1-dbe8-4a59-ae57-2af6bced3c00\",\"correlation_id\":\"57554cdf-16df-47f1-b0d9-5f0b8da37afe\",\"error_uri\":\"https://login.microsoftonline.com/error?code=7000215\"}"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1370,"provider":"office","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1202,"provider":"office"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1202,"provider":"office"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1202,"provider":"office","refreshToken":"b458799ccc29b21a6e2eb5260fdb63e49ccba21bf942a3973fb63799bd7f0afe","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1202,"provider":"office","responseBody":"{\"error\":\"invalid_client\",\"error_description\":\"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app 'bbcbb2ef-6200-4fae-82bd-d81f5dd738da'. Trace ID: 2a3e5b60-5770-46f2-aca6-7b0527363000 Correlation ID: 57bb0b73-9ea6-4bcf-a8f4-6e211dbb94e2 Timestamp: 2026-05-07 12:28:34Z\",\"error_codes\":[7000215],\"timestamp\":\"2026-05-07 12:28:34Z\",\"trace_id\":\"2a3e5b60-5770-46f2-aca6-7b0527363000\",\"correlation_id\":\"57bb0b73-9ea6-4bcf-a8f4-6e211dbb94e2\",\"error_uri\":\"https://login.microsoftonline.com/error?code=7000215\"}"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1202,"provider":"office","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1502,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1502,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.INFO: Calendar sync job dispatched {"calendar_id":501} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1300,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1300,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1300,"provider":"google","refreshToken":"4b811db0725fd9602a95943519a7da935e2a5065da7d9ebfcb170752e3e1ddb8","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1300,"provider":"google","responseBody":{"error":"invalid_grant","error_description":"Account has been deleted"}} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1300,"provider":"google","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1409,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1409,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1409,"provider":"google","refreshToken":"e2a3f2d06894894eed1ee87d9db1ace77d4d42ee6e1288a8940ad2c10333b0c4","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1409,"provider":"google","responseBody":{"error":"invalid_grant","error_description":"Bad Request"}} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1409,"provider":"google","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1352,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1352,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1352,"provider":"google","refreshToken":"dd4b16b00fdc1216da6b717c02338c073636e29162826b2de6db3f064fc029eb","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1352,"provider":"google","responseBody":{"error":"unauthorized_client","error_description":"Unauthorized"}} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1352,"provider":"google","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1296,"provider":"office"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1296,"provider":"office"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1296,"provider":"office","refreshToken":"011ae723c9d800c674e0b4be76f49fc046dac7d501b66c59ef0d9549cfa56ae5","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1502,"provider":"google"} {"correlation_id":"3015918c-9edf-487d-b1d0-97c9d00ea6b1","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1502,"provider":"google"} {"correlation_id":"3015918c-9edf-487d-b1d0-97c9d00ea6b1","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"3015918c-9edf-487d-b1d0-97c9d00ea6b1","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [Calendar] Processing sync {"calendarId":"a33076c1-8d97-431a-99f0-85c9524e118b","from":null,"to":null,"delta":"CIiFh8TP44kDEIiFh8TP44kDGAUgkZvkzgIokZvkzgI=","last_sync":"2024-12-09 07:12:53","dateMode":"daily"} {"correlation_id":"3015918c-9edf-487d-b1d0-97c9d00ea6b1","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {"crm_provider":"integration-app","crm_owner":1695,"team_id":3143} {"correlation_id":"3015918c-9edf-487d-b1d0-97c9d00ea6b1","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1502,"provider":"google"} {"correlation_id":"3015918c-9edf-487d-b1d0-97c9d00ea6b1","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1502,"provider":"google"} {"correlation_id":"3015918c-9edf-487d-b1d0-97c9d00ea6b1","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"3015918c-9edf-487d-b1d0-97c9d00ea6b1","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1296,"provider":"office","responseBody":"{\"error\":\"invalid_client\",\"error_description\":\"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app 'bbcbb2ef-6200-4fae-82bd-d81f5dd738da'. Trace ID: 2e34e335-a76d-40e5-bc50-3861392e4c00 Correlation ID: 9db5b389-6165-4feb-8e6e-bedc369e1c87 Timestamp: 2026-05-07 12:28:35Z\",\"error_codes\":[7000215],\"timestamp\":\"2026-05-07 12:28:35Z\",\"trace_id\":\"2e34e335-a76d-40e5-bc50-3861392e4c00\",\"correlation_id\":\"9db5b389-6165-4feb-8e6e-bedc369e1c87\",\"error_uri\":\"https://login.microsoftonline.com/error?code=7000215\"}"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1296,"provider":"office","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":391,"provider":"office"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":391,"provider":"office"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":391,"provider":"office","refreshToken":"00045eebae0f39b34887c6d53f92ae78064f7145e1f4b67754aebd03cfb2d881","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:36] local.INFO: [Google Calendar] Failed to watch channel for calendar {"calendarId":"a33076c1-8d97-431a-99f0-85c9524e118b","code":400,"reason":"{
\"error\": {
\"errors\": [
{
\"domain\": \"global\",
\"reason\": \"push.webhookUrlNotHttps\",
\"message\": \"WebHook callback must be HTTPS: /webhook/calendar/google?resourceType=event\"
}
],
\"code\": 400,
\"message\": \"WebHook callback must be HTTPS: /webhook/calendar/google?resourceType=event\"
}
}"} {"correlation_id":"3015918c-9edf-487d-b1d0-97c9d00ea6b1","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:36] local.WARNING: [Calendar] Sync failed {"calendarId":"a33076c1-8d97-431a-99f0-85c9524e118b","code":400,"reason":"{
\"error\": {
\"errors\": [
{
\"domain\": \"global\",
\"reason\": \"push.webhookUrlNotHttps\",
\"message\": \"WebHook callback must be HTTPS: /webhook/calendar/google?resourceType=event\"
}
],
\"code\": 400,
\"message\": \"WebHook callback must be HTTPS: /webhook/calendar/google?resourceType=event\"
}
}"} {"correlation_id":"3015918c-9edf-487d-b1d0-97c9d00ea6b1","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:36] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":391,"provider":"office","responseBody":"{\"error\":\"invalid_client\",\"error_description\":\"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app 'bbcbb2ef-6200-4fae-82bd-d81f5dd738da'. Trace ID: 6eba7173-b781-4e55-b1fb-1087ed023000 Correlation ID: 3086e346-c6eb-4f1c-8b1d-a477ce3821f4 Timestamp: 2026-05-07 12:28:36Z\",\"error_codes\":[7000215],\"timestamp\":\"2026-05-07 12:28:36Z\",\"trace_id\":\"6eba7173-b781-4e55-b1fb-1087ed023000\",\"correlation_id\":\"3086e346-c6eb-4f1c-8b1d-a477ce3821f4\",\"error_uri\":\"https://login.microsoftonline.com/error?code=7000215\"}"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:36] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:36] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":391,"provider":"office","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:37] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1271,"provider":"office"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:37] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1271,"provider":"office"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:37] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:37] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1271,"provider":"office","refreshToken":"118cde2c06993147b07ccaec4cbcd5026a819dea6c71081166a492933e392afb","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:37] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1271,"provider":"office","responseBody":"{\"error\":\"invalid_client\",\"error_description\":\"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app 'bbcbb2ef-6200-4fae-82bd-d81f5dd738da'. Trace ID:...
|
PhpStorm
|
faVsco.js – laravel.log
|
NULL
|
3600
|
|
3601
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
[2026-05-07 12:28:10] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"d4ce87a9-6ca5-4efe-99b3-4220893270d0","trace_id":"724e8238-2ed5-4089-9509-9c7c12a3c373"}
[2026-05-07 12:28:10] local.INFO: [ScheduleBotCommand] Number of activities to be captured: 0 {"correlation_id":"d4ce87a9-6ca5-4efe-99b3-4220893270d0","trace_id":"724e8238-2ed5-4089-9509-9c7c12a3c373"}
[2026-05-07 12:28:10] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"meeting-bot:schedule-bot","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"d4ce87a9-6ca5-4efe-99b3-4220893270d0","trace_id":"724e8238-2ed5-4089-9509-9c7c12a3c373"}
[2026-05-07 12:28:14] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"172d1ae8-b8cc-4804-bed9-e32d074e265c","trace_id":"4817cdef-8d3e-4914-8bee-feffb18efe1b"}
[2026-05-07 12:28:14] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"dialers:monitor-activities","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"172d1ae8-b8cc-4804-bed9-e32d074e265c","trace_id":"4817cdef-8d3e-4914-8bee-feffb18efe1b"}
[2026-05-07 12:28:17] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"273355f2-6315-4b20-bc9a-c26c681d6344","trace_id":"5ea79a26-c838-48e8-9913-93ad508146a6"}
[2026-05-07 12:28:17] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1499,"provider":"hubspot"} {"correlation_id":"273355f2-6315-4b20-bc9a-c26c681d6344","trace_id":"5ea79a26-c838-48e8-9913-93ad508146a6"}
[2026-05-07 12:28:17] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"273355f2-6315-4b20-bc9a-c26c681d6344","trace_id":"5ea79a26-c838-48e8-9913-93ad508146a6"}
[2026-05-07 12:28:17] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1499,"provider":"hubspot","refreshToken":"96f94c623a404e02ebdbf07f1b75707bb6cdbf848cbf45d418baf608c41a8d86","state":"connected"} {"correlation_id":"273355f2-6315-4b20-bc9a-c26c681d6344","trace_id":"5ea79a26-c838-48e8-9913-93ad508146a6"}
[2026-05-07 12:28:18] local.NOTICE: Monitoring start {"correlation_id":"31aa6b7d-00d6-448a-bdcc-a3d215b4aeb5","trace_id":"b8eb7fe5-8471-4ffb-9bfa-a804c8e1ff72"}
[2026-05-07 12:28:18] local.NOTICE: Monitoring end {"correlation_id":"31aa6b7d-00d6-448a-bdcc-a3d215b4aeb5","trace_id":"b8eb7fe5-8471-4ffb-9bfa-a804c8e1ff72"}
[2026-05-07 12:28:18] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"273355f2-6315-4b20-bc9a-c26c681d6344","trace_id":"5ea79a26-c838-48e8-9913-93ad508146a6"}
[2026-05-07 12:28:18] local.INFO: [SocialAccountObserver] Access token was modified, encrypting {"correlation_id":"273355f2-6315-4b20-bc9a-c26c681d6344","trace_id":"5ea79a26-c838-48e8-9913-93ad508146a6"}
[2026-05-07 12:28:18] local.INFO: [SocialAccountService] Token refreshed {"socialAccountId":1499,"provider":"hubspot","state":"connected"} {"correlation_id":"273355f2-6315-4b20-bc9a-c26c681d6344","trace_id":"5ea79a26-c838-48e8-9913-93ad508146a6"}
[2026-05-07 12:28:18] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {"crm_provider":"hubspot","crm_owner":148,"team_id":2} {"correlation_id":"273355f2-6315-4b20-bc9a-c26c681d6344","trace_id":"5ea79a26-c838-48e8-9913-93ad508146a6"}
[2026-05-07 12:28:19] local.INFO: [Hubspot] Failed to fetch opportunity {"crm_id":"374720564","reason":"[429] Client error: `GET https://api.hubapi.com/crm/v3/objects/deals/374720564?properties=hs_object_id%2Cdealname&associations=companies%2Ccontacts&archived=0` resulted in a `429 Too Many Requests` response:
{\"status\":\"error\",\"message\":\"You have reached your ten_secondly_rolling limit.\",\"errorType\":\"RATE_LIMIT\",\"correlationId\" (truncated...)
"} {"correlation_id":"273355f2-6315-4b20-bc9a-c26c681d6344","trace_id":"5ea79a26-c838-48e8-9913-93ad508146a6"}
[2026-05-07 12:28:19] local.ERROR: [429] Client error: `GET https://api.hubapi.com/crm/v3/objects/deals/374720564?properties=hs_object_id%2Cdealname&associations=companies%2Ccontacts&archived=0` resulted in a `429 Too Many Requests` response:
{"status":"error","message":"You have reached your ten_secondly_rolling limit.","errorType":"RATE_LIMIT","correlationId" (truncated...)
{"exception":"[object] (HubSpot\\Client\\Crm\\Deals\\ApiException(code: 429): [429] Client error: `GET https://api.hubapi.com/crm/v3/objects/deals/374720564?properties=hs_object_id%2Cdealname&associations=companies%2Ccontacts&archived=0` resulted in a `429 Too Many Requests` response:
{\"status\":\"error\",\"message\":\"You have reached your ten_secondly_rolling limit.\",\"errorType\":\"RATE_LIMIT\",\"correlationId\" (truncated...)
at /home/jiminny/vendor/hubspot/api-client/codegen/Crm/Deals/Api/BasicApi.php:704)
[stacktrace]
#0 /home/jiminny/vendor/hubspot/api-client/codegen/Crm/Deals/Api/BasicApi.php(676): HubSpot\\Client\\Crm\\Deals\\Api\\BasicApi->getByIdWithHttpInfo('374720564', 'hs_object_id,de...', 'companies,conta...', false, NULL)
#1 /home/jiminny/app/Services/Crm/Hubspot/Client.php(212): HubSpot\\Client\\Crm\\Deals\\Api\\BasicApi->getById('374720564', 'hs_object_id,de...', 'companies,conta...')
#2 /home/jiminny/app/Services/Crm/Hubspot/ServiceTraits/OpportunitySyncTrait.php(130): Jiminny\\Services\\Crm\\Hubspot\\Client->getOpportunityById('374720564', Array)
#3 /home/jiminny/app/Console/Commands/JiminnyDebugCommand.php(351): Jiminny\\Services\\Crm\\Hubspot\\Service->syncOpportunity('374720564')
#4 /home/jiminny/app/Console/Commands/JiminnyDebugCommand.php(44): Jiminny\\Console\\Commands\\JiminnyDebugCommand->rateLimit()
#5 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Jiminny\\Console\\Commands\\JiminnyDebugCommand->handle(Object(Jiminny\\Jobs\\JobDispatcher), Object(Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService), Object(Jiminny\\Repositories\\AutomatedReportsRepository), Object(Jiminny\\Services\\UserPilot\\UserPilotClient))
#6 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/Util.php(43): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#7 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(96): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure))
#8 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(Illuminate\\Foundation\\Application), Array, Object(Closure))
#9 /home/jiminny/vendor/laravel/framework/src/Illuminate/Container/Container.php(799): Illuminate\\Container\\BoundMethod::call(Object(Illuminate\\Foundation\\Application), Array, Array, NULL)
#10 /home/jiminny/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\\Container\\Container->call(Array)
#11 /home/jiminny/vendor/symfony/console/Command/Command.php(341): Illuminate\\Console\\Command->execute(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle))
#12 /home/jiminny/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\\Component\\Console\\Command\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle))
#13 /home/jiminny/vendor/symfony/console/Application.php(1117): Illuminate\\Console\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#14 /home/jiminny/vendor/symfony/console/Application.php(356): Symfony\\Component\\Console\\Application->doRunCommand(Object(Jiminny\\Console\\Commands\\JiminnyDebugCommand), Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#15 /home/jiminny/vendor/symfony/console/Application.php(195): Symfony\\Component\\Console\\Application->doRun(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#16 /home/jiminny/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(198): Symfony\\Component\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#17 /home/jiminny/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1235): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#18 /home/jiminny/artisan(13): Illuminate\\Foundation\\Application->handleCommand(Object(Symfony\\Component\\Console\\Input\\ArgvInput))
#19 {main}
"} {"correlation_id":"273355f2-6315-4b20-bc9a-c26c681d6344","trace_id":"5ea79a26-c838-48e8-9913-93ad508146a6"}
[2026-05-07 12:28:20] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"dcb9b24b-e2e5-41fe-81db-212b3ca9ff7d","trace_id":"1ea62b83-9639-41e3-a523-26404c39fa80"}
[2026-05-07 12:28:20] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:skip-lists:refresh","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"dcb9b24b-e2e5-41fe-81db-212b3ca9ff7d","trace_id":"1ea62b83-9639-41e3-a523-26404c39fa80"}
[2026-05-07 12:28:24] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"d191d5c6-133f-43e1-8ed4-d285d0c768b8","trace_id":"67798138-bdb7-4bd7-8b32-377663219a88"}
[2026-05-07 12:28:24] local.INFO: [EmailSchedule] STARTING batch process {"host":"docker_lamp_1"} {"correlation_id":"d191d5c6-133f-43e1-8ed4-d285d0c768b8","trace_id":"67798138-bdb7-4bd7-8b32-377663219a88"}
[2026-05-07 12:28:24] local.INFO: [EmailSchedule] FINISHED batch process {"host":"docker_lamp_1","processed":0} {"correlation_id":"d191d5c6-133f-43e1-8ed4-d285d0c768b8","trace_id":"67798138-bdb7-4bd7-8b32-377663219a88"}
[2026-05-07 12:28:24] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:batch:process","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"d191d5c6-133f-43e1-8ed4-d285d0c768b8","trace_id":"67798138-bdb7-4bd7-8b32-377663219a88"}
[2026-05-07 12:28:27] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"conference:monitor:count","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"a4e5e18f-9f8c-4196-ace0-bf664d4827d9","trace_id":"d75cb10b-4c76-4c00-84d4-26efeb738e17"}
[2026-05-07 12:28:27] local.INFO: Running conference:monitor:count command for activities in (2026-05-07 12:26:00, 2026-05-07 12:28:00] {"correlation_id":"a4e5e18f-9f8c-4196-ace0-bf664d4827d9","trace_id":"d75cb10b-4c76-4c00-84d4-26efeb738e17"}
[2026-05-07 12:28:27] local.INFO: [conference:monitor:count] No activities found in (2026-05-07 12:26:00, 2026-05-07 12:28:00] {"correlation_id":"a4e5e18f-9f8c-4196-ace0-bf664d4827d9","trace_id":"d75cb10b-4c76-4c00-84d4-26efeb738e17"}
[2026-05-07 12:28:27] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"conference:monitor:count","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"a4e5e18f-9f8c-4196-ace0-bf664d4827d9","trace_id":"d75cb10b-4c76-4c00-84d4-26efeb738e17"}
[2026-05-07 12:28:30] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"calendar:sync","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:30] local.INFO: Jiminny\Console\Commands\Command::run Memory usage before starting command {"command":"mailbox:batch:retry-failed","memoryBeforeCommandInMb":62.0,"memoryPeakBeforeCommandInMb":99.727} {"correlation_id":"3789f06a-4f0c-4b12-be80-d6a36e089d1b","trace_id":"6ce89147-1624-456d-9e75-f4948f2c5db8"}
[2026-05-07 12:28:30] local.NOTICE: Calendar sync start {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:30] local.INFO: Jiminny\Console\Commands\Command::run Memory usage for command {"command":"mailbox:batch:retry-failed","memoryBeforeCommandInMb":62.0,"memoryAfterCommandInMB":62.0,"memoryPeakBeforeCommandInMb":99.727,"memoryPeakAfterCommandInMB":99.727} {"correlation_id":"3789f06a-4f0c-4b12-be80-d6a36e089d1b","trace_id":"6ce89147-1624-456d-9e75-f4948f2c5db8"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1393,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1393,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1393,"provider":"google","refreshToken":"5aa7e2d96b53201cd16fca5d2e4ef3ad03320971fc064781d18aee3ae7b99fbf","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1393,"provider":"google","responseBody":{"error":"invalid_grant","error_description":"Account has been deleted"}} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1393,"provider":"google","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1387,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1387,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1387,"provider":"google","refreshToken":"8157ac6de94842937194009e9c50e459253600f799dacf6a40755ffdbeb5bba6","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1387,"provider":"google","responseBody":{"error":"invalid_grant","error_description":"Account has been deleted"}} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1387,"provider":"google","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1348,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1348,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1348,"provider":"google","refreshToken":"9e7d13d3032d0cb1b79d8e95aef01383e8e91eb52ff8ee960c8a0b6b95cd8c73","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1348,"provider":"google","responseBody":{"error":"invalid_grant","error_description":"Bad Request"}} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1348,"provider":"google","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1361,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1361,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:31] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1361,"provider":"google","refreshToken":"6c843da199c2b9907445329304fcc4ec5057a4ee748d8299641764395c08e1fd","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1361,"provider":"google","responseBody":{"error":"invalid_grant","error_description":"Account has been deleted"}} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1361,"provider":"google","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1310,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1310,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1310,"provider":"google","refreshToken":"e34818922c2830a660813a63f6169a4a9a992ae2cccd7dc8dd7796cfdb470ef1","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1310,"provider":"google","responseBody":{"error":"invalid_grant","error_description":"Bad Request"}} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1310,"provider":"google","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1333,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1333,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1333,"provider":"google","refreshToken":"6c902986546d8e8da1dc539b046cdc1d458f519acc972e5b5f1d6a1a295165e0","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1333,"provider":"google","responseBody":{"error":"unauthorized_client","error_description":"Unauthorized"}} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1333,"provider":"google","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1368,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1368,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1368,"provider":"google","refreshToken":"d2f128898ff8543bd16b69cfae37896ab85119b0f5ed2b431d739593bb600333","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1368,"provider":"google","responseBody":{"error":"invalid_grant","error_description":"Bad Request"}} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1368,"provider":"google","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1365,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1365,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:32] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1365,"provider":"google","refreshToken":"7676e4a9afcd082b413248ab5ec6e487021fec6a9bdf315860a59cefad9caad8","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1365,"provider":"google","responseBody":{"error":"unauthorized_client","error_description":"Unauthorized"}} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1365,"provider":"google","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1364,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1364,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1364,"provider":"google","refreshToken":"dd5882ebce76e645292ce33ae74238abbb77c0a4ecc6a2bfe723cad82e72ba8e","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1364,"provider":"google","responseBody":{"error":"unauthorized_client","error_description":"Unauthorized"}} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1364,"provider":"google","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1370,"provider":"office"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1370,"provider":"office"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1370,"provider":"office","refreshToken":"b7ee8035306d0043cea6e00e7c4fe14f745e44074a1194db62a31cdf8b70af3e","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1370,"provider":"office","responseBody":"{\"error\":\"invalid_client\",\"error_description\":\"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app 'bbcbb2ef-6200-4fae-82bd-d81f5dd738da'. Trace ID: e890fdc1-dbe8-4a59-ae57-2af6bced3c00 Correlation ID: 57554cdf-16df-47f1-b0d9-5f0b8da37afe Timestamp: 2026-05-07 12:28:33Z\",\"error_codes\":[7000215],\"timestamp\":\"2026-05-07 12:28:33Z\",\"trace_id\":\"e890fdc1-dbe8-4a59-ae57-2af6bced3c00\",\"correlation_id\":\"57554cdf-16df-47f1-b0d9-5f0b8da37afe\",\"error_uri\":\"https://login.microsoftonline.com/error?code=7000215\"}"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1370,"provider":"office","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1202,"provider":"office"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1202,"provider":"office"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:33] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1202,"provider":"office","refreshToken":"b458799ccc29b21a6e2eb5260fdb63e49ccba21bf942a3973fb63799bd7f0afe","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1202,"provider":"office","responseBody":"{\"error\":\"invalid_client\",\"error_description\":\"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app 'bbcbb2ef-6200-4fae-82bd-d81f5dd738da'. Trace ID: 2a3e5b60-5770-46f2-aca6-7b0527363000 Correlation ID: 57bb0b73-9ea6-4bcf-a8f4-6e211dbb94e2 Timestamp: 2026-05-07 12:28:34Z\",\"error_codes\":[7000215],\"timestamp\":\"2026-05-07 12:28:34Z\",\"trace_id\":\"2a3e5b60-5770-46f2-aca6-7b0527363000\",\"correlation_id\":\"57bb0b73-9ea6-4bcf-a8f4-6e211dbb94e2\",\"error_uri\":\"https://login.microsoftonline.com/error?code=7000215\"}"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1202,"provider":"office","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1502,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1502,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.INFO: Calendar sync job dispatched {"calendar_id":501} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1300,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1300,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1300,"provider":"google","refreshToken":"4b811db0725fd9602a95943519a7da935e2a5065da7d9ebfcb170752e3e1ddb8","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1300,"provider":"google","responseBody":{"error":"invalid_grant","error_description":"Account has been deleted"}} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:34] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1300,"provider":"google","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1409,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1409,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1409,"provider":"google","refreshToken":"e2a3f2d06894894eed1ee87d9db1ace77d4d42ee6e1288a8940ad2c10333b0c4","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1409,"provider":"google","responseBody":{"error":"invalid_grant","error_description":"Bad Request"}} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1409,"provider":"google","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1352,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1352,"provider":"google"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1352,"provider":"google","refreshToken":"dd4b16b00fdc1216da6b717c02338c073636e29162826b2de6db3f064fc029eb","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1352,"provider":"google","responseBody":{"error":"unauthorized_client","error_description":"Unauthorized"}} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1352,"provider":"google","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1296,"provider":"office"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1296,"provider":"office"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1296,"provider":"office","refreshToken":"011ae723c9d800c674e0b4be76f49fc046dac7d501b66c59ef0d9549cfa56ae5","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1502,"provider":"google"} {"correlation_id":"3015918c-9edf-487d-b1d0-97c9d00ea6b1","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1502,"provider":"google"} {"correlation_id":"3015918c-9edf-487d-b1d0-97c9d00ea6b1","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"3015918c-9edf-487d-b1d0-97c9d00ea6b1","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [Calendar] Processing sync {"calendarId":"a33076c1-8d97-431a-99f0-85c9524e118b","from":null,"to":null,"delta":"CIiFh8TP44kDEIiFh8TP44kDGAUgkZvkzgIokZvkzgI=","last_sync":"2024-12-09 07:12:53","dateMode":"daily"} {"correlation_id":"3015918c-9edf-487d-b1d0-97c9d00ea6b1","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [CrmOwnerResolver] Integration owner matched as CRM Owner {"crm_provider":"integration-app","crm_owner":1695,"team_id":3143} {"correlation_id":"3015918c-9edf-487d-b1d0-97c9d00ea6b1","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1502,"provider":"google"} {"correlation_id":"3015918c-9edf-487d-b1d0-97c9d00ea6b1","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Token retrieved {"socialAccountId":1502,"provider":"google"} {"correlation_id":"3015918c-9edf-487d-b1d0-97c9d00ea6b1","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"3015918c-9edf-487d-b1d0-97c9d00ea6b1","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1296,"provider":"office","responseBody":"{\"error\":\"invalid_client\",\"error_description\":\"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app 'bbcbb2ef-6200-4fae-82bd-d81f5dd738da'. Trace ID: 2e34e335-a76d-40e5-bc50-3861392e4c00 Correlation ID: 9db5b389-6165-4feb-8e6e-bedc369e1c87 Timestamp: 2026-05-07 12:28:35Z\",\"error_codes\":[7000215],\"timestamp\":\"2026-05-07 12:28:35Z\",\"trace_id\":\"2e34e335-a76d-40e5-bc50-3861392e4c00\",\"correlation_id\":\"9db5b389-6165-4feb-8e6e-bedc369e1c87\",\"error_uri\":\"https://login.microsoftonline.com/error?code=7000215\"}"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1296,"provider":"office","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":391,"provider":"office"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":391,"provider":"office"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:35] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":391,"provider":"office","refreshToken":"00045eebae0f39b34887c6d53f92ae78064f7145e1f4b67754aebd03cfb2d881","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:36] local.INFO: [Google Calendar] Failed to watch channel for calendar {"calendarId":"a33076c1-8d97-431a-99f0-85c9524e118b","code":400,"reason":"{
\"error\": {
\"errors\": [
{
\"domain\": \"global\",
\"reason\": \"push.webhookUrlNotHttps\",
\"message\": \"WebHook callback must be HTTPS: /webhook/calendar/google?resourceType=event\"
}
],
\"code\": 400,
\"message\": \"WebHook callback must be HTTPS: /webhook/calendar/google?resourceType=event\"
}
}"} {"correlation_id":"3015918c-9edf-487d-b1d0-97c9d00ea6b1","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:36] local.WARNING: [Calendar] Sync failed {"calendarId":"a33076c1-8d97-431a-99f0-85c9524e118b","code":400,"reason":"{
\"error\": {
\"errors\": [
{
\"domain\": \"global\",
\"reason\": \"push.webhookUrlNotHttps\",
\"message\": \"WebHook callback must be HTTPS: /webhook/calendar/google?resourceType=event\"
}
],
\"code\": 400,
\"message\": \"WebHook callback must be HTTPS: /webhook/calendar/google?resourceType=event\"
}
}"} {"correlation_id":"3015918c-9edf-487d-b1d0-97c9d00ea6b1","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:36] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":391,"provider":"office","responseBody":"{\"error\":\"invalid_client\",\"error_description\":\"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app 'bbcbb2ef-6200-4fae-82bd-d81f5dd738da'. Trace ID: 6eba7173-b781-4e55-b1fb-1087ed023000 Correlation ID: 3086e346-c6eb-4f1c-8b1d-a477ce3821f4 Timestamp: 2026-05-07 12:28:36Z\",\"error_codes\":[7000215],\"timestamp\":\"2026-05-07 12:28:36Z\",\"trace_id\":\"6eba7173-b781-4e55-b1fb-1087ed023000\",\"correlation_id\":\"3086e346-c6eb-4f1c-8b1d-a477ce3821f4\",\"error_uri\":\"https://login.microsoftonline.com/error?code=7000215\"}"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:36] local.INFO: [SocialAccountObserver] Saving model {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:36] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":391,"provider":"office","reason":"Flow refresh required."} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:37] local.INFO: [SocialAccountService] Fetching token {"socialAccountId":1271,"provider":"office"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:37] local.INFO: [SocialAccountService] Token needs refreshing {"socialAccountId":1271,"provider":"office"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:37] local.INFO: [EncryptedTokenManager] Generating access token. {"mode":"legacy"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:37] local.INFO: [SocialAccountService] Refreshing token from provider {"socialAccountId":1271,"provider":"office","refreshToken":"118cde2c06993147b07ccaec4cbcd5026a819dea6c71081166a492933e392afb","state":"full-refresh"} {"correlation_id":"d543a089-fd32-4522-9ffe-1494e562b741","trace_id":"564a362b-7ddb-49f0-a33a-b807b0440231"}
[2026-05-07 12:28:37] local.ERROR: [SocialAccountService] Failed to refresh token {"socialAccountId":1271,"provider":"office","responseBody":"{\"error\":\"invalid_client\",\"error_description\":\"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app 'bbcbb2ef-6200-4fae-82bd-d81f5dd738da'. Trace ID:...
|
PhpStorm
|
faVsco.js – Client.php
|
NULL
|
3601
|