Class: Teems::Api::Chats

Inherits:
Client
  • Object
show all
Defined in:
lib/teems/api/chats.rb

Overview

API wrapper for chat endpoints Uses Teams ng.msg service for chat operations

Constant Summary collapse

ENDPOINT =
:msgservice

Instance Method Summary collapse

Methods inherited from Client

#initialize

Constructor Details

This class inherits a constructor from Teems::Api::Client

Instance Method Details

#get_chat(chat_id:) ⇒ Object

Get a specific chat



17
18
19
20
# File 'lib/teems/api/chats.rb', line 17

def get_chat(chat_id:)
  encoded_id = URI.encode_www_form_component(chat_id)
  get("/v1/users/ME/conversations/#{encoded_id}")
end

#list(limit: 50) ⇒ Object

Get list of conversations (chats, meetings)



11
12
13
14
# File 'lib/teems/api/chats.rb', line 11

def list(limit: 50)
  get('/v1/users/ME/conversations',
      params: { pageSize: limit, view: 'msnp24Equivalent' })
end

#members(chat_id:) ⇒ Object

Get members of a chat



23
24
25
26
# File 'lib/teems/api/chats.rb', line 23

def members(chat_id:)
  encoded_id = URI.encode_www_form_component(chat_id)
  get("/v1/threads/#{encoded_id}/members")
end