From dbaae7e7c4bcd3052c6ff8f02e9285b1ca4de615 Mon Sep 17 00:00:00 2001 From: Henry Foster Date: Fri, 16 Jul 2021 17:05:19 -0400 Subject: [PATCH 1/2] fix limit url param This should be "limit" not "count" according to the current API docs: https://api.slack.com/admins/audit-logs#monitoring-workspace-events-with-the-audit-logs-api__how-to-call-the-audit-logs-api__audit-logs-endpoints --- audit.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audit.go b/audit.go index 698af844f..2bb5f9a7c 100644 --- a/audit.go +++ b/audit.go @@ -115,7 +115,7 @@ func (api *Client) GetAuditLogsContext(ctx context.Context, params AuditLogParam "token": {api.token}, } if params.Limit != 0 { - values.Add("count", strconv.Itoa(params.Limit)) + values.Add("limit", strconv.Itoa(params.Limit)) } if params.Oldest != 0 { values.Add("oldest", strconv.Itoa(params.Oldest)) From 18a620dbd4a778e0d465c565561aa12190e71d0e Mon Sep 17 00:00:00 2001 From: Henry Foster Date: Fri, 16 Jul 2021 17:07:02 -0400 Subject: [PATCH 2/2] Don't include secrets in url --- audit.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/audit.go b/audit.go index 2bb5f9a7c..041ffd77a 100644 --- a/audit.go +++ b/audit.go @@ -111,9 +111,7 @@ func (api *Client) GetAuditLogs(params AuditLogParameters) (entries []AuditEntry // GetAuditLogsContext retrieves a page of audit entries according to the parameters given with a custom context func (api *Client) GetAuditLogsContext(ctx context.Context, params AuditLogParameters) (entries []AuditEntry, nextCursor string, err error) { - values := url.Values{ - "token": {api.token}, - } + values := url.Values{} if params.Limit != 0 { values.Add("limit", strconv.Itoa(params.Limit)) }