|
|
|
@ -21,16 +21,18 @@ namespace Ombi.Api.GroupMe
|
|
|
|
|
public async Task<GroupMeResponse<List<Groups>>> GetGroups(string token, CancellationToken cancellationToken)
|
|
|
|
|
{
|
|
|
|
|
var request = new Request($"groups", BaseUrl, HttpMethod.Get);
|
|
|
|
|
request.AddQueryString("token", token);
|
|
|
|
|
request.AddQueryString("omit", "memberships");
|
|
|
|
|
|
|
|
|
|
AddHeaders(request, token);
|
|
|
|
|
|
|
|
|
|
return await _api.Request<GroupMeResponse<List<Groups>>>(request, cancellationToken);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task<GroupMeResponse<SendResponse>> Send(string message, string token, int groupId)
|
|
|
|
|
{
|
|
|
|
|
var request = new Request($"groups/{groupId}/messages", BaseUrl, HttpMethod.Post);
|
|
|
|
|
request.AddQueryString("token", token);
|
|
|
|
|
|
|
|
|
|
AddHeaders(request, token);
|
|
|
|
|
|
|
|
|
|
var body = new
|
|
|
|
|
{
|
|
|
|
@ -44,5 +46,10 @@ namespace Ombi.Api.GroupMe
|
|
|
|
|
request.AddJsonBody(body);
|
|
|
|
|
return await _api.Request<GroupMeResponse<SendResponse>>(request);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void AddHeaders(Request req, string token)
|
|
|
|
|
{
|
|
|
|
|
req.AddHeader("X-Access-Token", token);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|