Skip to content

Commit

Permalink
relations api
Browse files Browse the repository at this point in the history
  • Loading branch information
karmanyaahm committed May 8, 2021
1 parent 7961d30 commit 6eba33b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions chats_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 6eba33b

Please sign in to comment.