MCPcopy Create free account
hub / github.com/slackapi/python-slack-sdk / api_call

Method api_call

slack_sdk/scim/v1/client.py:242–266  ·  view source on GitHub ↗

Performs a Slack API request and returns the result.

(
        self,
        *,
        http_verb: str,
        path: str,
        query_params: Optional[Dict[str, Any]] = None,
        body_params: Optional[Dict[str, Any]] = None,
        headers: Optional[Dict[str, str]] = None,
    )

Source from the content-addressed store, hash-verified

240 # -------------------------
241
242 def api_call(
243 self,
244 *,
245 http_verb: str,
246 path: str,
247 query_params: Optional[Dict[str, Any]] = None,
248 body_params: Optional[Dict[str, Any]] = None,
249 headers: Optional[Dict[str, str]] = None,
250 ) -> SCIMResponse:
251 """Performs a Slack API request and returns the result."""
252 url = f"{self.base_url}{path}"
253 query = _build_query(query_params)
254 if len(query) > 0:
255 url += f"?{query}"
256
257 return self._perform_http_request(
258 http_verb=http_verb,
259 url=url,
260 body=body_params,
261 headers=_build_request_headers(
262 token=self.token,
263 default_headers=self.default_headers,
264 additional_headers=headers,
265 ),
266 )
267
268 def _perform_http_request(
269 self,

Callers 12

search_usersMethod · 0.95
read_userMethod · 0.95
create_userMethod · 0.95
patch_userMethod · 0.95
update_userMethod · 0.95
delete_userMethod · 0.95
search_groupsMethod · 0.95
read_groupMethod · 0.95
create_groupMethod · 0.95
patch_groupMethod · 0.95
update_groupMethod · 0.95
delete_groupMethod · 0.95

Calls 3

_perform_http_requestMethod · 0.95
_build_queryFunction · 0.70
_build_request_headersFunction · 0.70

Tested by

no test coverage detected