call_slack_api function

A wrapper function to call the Slack API with authentication and pagination.