From 6eba33b3be76603a77305122e54cac7057d2447f Mon Sep 17 00:00:00 2001 From: Karmanyaah Malhotra Date: Sat, 8 May 2021 15:54:12 -0400 Subject: [PATCH] relations api --- chats_api.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/chats_api.go b/chats_api.go index 66fd39b..ce0fd0b 100644 --- a/chats_api.go +++ b/chats_api.go @@ -53,3 +53,23 @@ func (c *Client) IndexChats(ctx context.Context, req *IndexChatsQuery) ([]*Chat, return resp, nil } +func (c *Client) IndexAllRelations(ctx context.Context) ([]*User, error) { + httpReq, err := http.NewRequest("GET", "https://api.groupme.com/v4"+"/relationships", nil) + if err != nil { + return nil, err + } + + URL := httpReq.URL + query := URL.Query() + + query.Set("include_blocked", "true") + URL.RawQuery = query.Encode() + + var resp []*User + err = c.doWithAuthToken(ctx, httpReq, &resp) + if err != nil { + return nil, err + } + + return resp, nil +}