slack icon indicating copy to clipboard operation
slack copied to clipboard

Slack Audit logs endpoint host is wrong

Open GalNakash-RecoLabs opened this issue 3 years ago • 1 comments

What happened

The API GetAuditLogs sends a request to https://slack.com/api/

Expected behavior

The audit logs API is accessible only via api.slack.com

Steps to reproduce

  1. Generate a slack client with a valid token for auditlogs:read
  2. Call to get GetAuditLogs
  3. Error will be the HTML page "You've found a glitch

reproducible code

_, nextCursor, err = slackClient.GetAuditLogs(slack.AuditLogParameters{ Limit: maxAuditLogMessages, Oldest: oldest, Latest: latest, Cursor: nextCursor, Action: eventType, })

manifest.yaml

Versions

  • Go:
  • slack-go/slack:

GalNakash-RecoLabs avatar Dec 19 '22 16:12 GalNakash-RecoLabs

Thanks for reporting. You can call Audit Log APIs correctly by setting Base URL as follows.

slack.New(token, slack.OptionAPIURL("https://slack.com/")

However, it seems inconvenient that only one endpoint can be set per Slack client, so I will consider some other way.

kanata2 avatar Dec 20 '22 14:12 kanata2