Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix next_cursor Flag in SlackResponse #1407

Closed
1 of 9 tasks
wonkajin opened this issue Oct 3, 2023 · 5 comments
Closed
1 of 9 tasks

Fix next_cursor Flag in SlackResponse #1407

wonkajin opened this issue Oct 3, 2023 · 5 comments
Labels
good first issue needs info An issue that is claimed to be a bug and hasn't been reproduced, or otherwise needs more info

Comments

@wonkajin
Copy link

wonkajin commented Oct 3, 2023

In the SlackResponse, the presence of the next_cursor is determined by the _next_cursor_is_present method.
In most APIs, the next_cursor is returned as an empty string ("") as seen in _next_cursor_is_present.
However, in some APIs, the next_cursor is returned as null. To handle this situation, I would like to make modifications to the _next_cursor_is_present method.

example) slackbot.responses.list

Category (place an x in each of the [ ])

  • slack_sdk.web.WebClient (sync/async) (Web API client)
  • slack_sdk.webhook.WebhookClient (sync/async) (Incoming Webhook, response_url sender)
  • slack_sdk.models (UI component builders)
  • slack_sdk.oauth (OAuth Flow Utilities)
  • slack_sdk.socket_mode (Socket Mode client)
  • slack_sdk.audit_logs (Audit Logs API client)
  • slack_sdk.scim (SCIM API client)
  • slack_sdk.rtm (RTM client)
  • slack_sdk.signature (Request Signature Verifier)

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

@WilliamBergamin WilliamBergamin added needs info An issue that is claimed to be a bug and hasn't been reproduced, or otherwise needs more info good first issue and removed untriaged labels Oct 3, 2023
@WilliamBergamin
Copy link
Contributor

Hello @lre12 thanks for writing in 💯

Contributions to the project are always greatly appreciated 🥇 take a look at our creating-a-pull-request docs for information on this

Before proceeding would you be able to outline which APIs return next_cursor as null

@seratch
Copy link
Member

seratch commented Oct 3, 2023

@lre12 Could you share a bit more details about slackbot.responses.list, which you mentioned as an example? This SDK does not offer such a method.

@wonkajin
Copy link
Author

wonkajin commented Oct 5, 2023

I am using the Slack enterprise called tossteam. So, please understand that I have only used it as an enterprise.

example code)

from slack_sdk import WebClient

token = "xoxc-XXXXXXXXXXX"
cookie = "d=xoxd-XXXXXXXXXXXXX"

client = WebClient(
    base_url="https://tossteam.slack.com",
    token=token,
    headers={"cookie": cookie}
)
list(client.api_call("slackbot.responses.list", data={"limit": 1000}))

The token and cookie were obtained from the enterprise admin site.
ex) https://tossteam.slack.com/admin

@seratch
Copy link
Member

seratch commented Oct 5, 2023

@lre12 Thanks for your response. Now I understand your point. You're attempting to use this SDK to call an endpoint that is not available for 3rd party apps. (Indeed, you can call slackbot.responses.list when you use an xoxc- prefix token that you obtained from the Slack client app or web browser, but this functionality is not publicly available).

We're willing to make the code even more robust for potential future changes on the public platform, but we do not support your specific use case with private/hidden APIs. We would appreciate it if you could understand this.

@wonkajin
Copy link
Author

wonkajin commented Oct 5, 2023

Ah, I understand. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue needs info An issue that is claimed to be a bug and hasn't been reproduced, or otherwise needs more info
Projects
None yet
Development

No branches or pull requests

3 participants