File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## 3.6.3
4+
5+ ### Fixed: ` settings.integration_events() ` requested the wrong path
6+
7+ - ` settings.integration_events() ` now calls
8+ ` GET orgs/{org_slug}/settings/integrations/{integration_id}/events ` . It
9+ previously requested the integration's own path, which has no ` GET ` route,
10+ so the method always failed. It needs the ` integration:list ` scope.
11+ - Its return annotation is now ` list ` , matching the JSON array the endpoint
12+ returns.
13+
314## 3.6.2
415
516### Fixed: reject retired API credentials before use
Original file line number Diff line number Diff line change @@ -108,22 +108,25 @@ def get(
108108 )
109109 return {}
110110
111- def integration_events (self , org_slug : str , integration_id : str ) -> dict :
111+ def integration_events (self , org_slug : str , integration_id : str ) -> list :
112112 """Get integration events for a specific integration.
113113
114114 Args:
115115 org_slug: Organization slug
116116 integration_id: Integration ID
117+
118+ Returns:
119+ The integration's events, as the list the API returns.
117120 """
118- path = f"orgs/{ org_slug } /settings/integrations/{ integration_id } "
121+ path = f"orgs/{ org_slug } /settings/integrations/{ integration_id } /events "
119122 response = self .api .do_request (path = path )
120123
121124 if response .status_code == 200 :
122125 return response .json ()
123126
124127 error_message = response .json ().get ("error" , {}).get ("message" , "Unknown error" )
125128 log .error (f"Error getting integration events: { response .status_code } , message: { error_message } " )
126- return {}
129+ return []
127130
128131 def get_license_policy (self , org_slug : str ) -> dict :
129132 """Get license policy settings for an organization.
Original file line number Diff line number Diff line change 1- __version__ = "3.6.2 "
1+ __version__ = "3.6.3 "
Original file line number Diff line number Diff line change @@ -736,6 +736,33 @@ def test_settings_get_unit(self):
736736 self .assertEqual (call_args [0 ][0 ], "GET" )
737737 self .assertIn ("/orgs/test-org/settings" , call_args [0 ][1 ])
738738
739+ def test_settings_integration_events_unit (self ):
740+ """Test integration events retrieval."""
741+ expected_data = [
742+ {
743+ "id" : "event-1" ,
744+ "integration_id" : "integration-1" ,
745+ "type" : "alert" ,
746+ "payload" : {},
747+ "status_code" : 200 ,
748+ "error" : "" ,
749+ "sent_at" : "2026-01-01T00:00:00.000Z" ,
750+ "retry_info" : [],
751+ "created_at" : "2026-01-01T00:00:00.000Z" ,
752+ "updated_at" : "2026-01-01T00:00:00.000Z" ,
753+ }
754+ ]
755+ self ._mock_response (expected_data )
756+
757+ result = self .sdk .settings .integration_events ("test-org" , "integration-1" )
758+
759+ self .assertEqual (result , expected_data )
760+ call_args = self .mock_requests .request .call_args
761+ self .assertEqual (call_args [0 ][0 ], "GET" )
762+ self .assertTrue (
763+ call_args [0 ][1 ].endswith ("/orgs/test-org/settings/integrations/integration-1/events" )
764+ )
765+
739766 # Triage endpoints
740767 def test_triage_list_alert_triage_unit (self ):
741768 """Test alert triage listing."""
You can’t perform that action at this time.
0 commit comments