Class: Amocrm::Resources::ContactChats
- Inherits:
-
Object
- Object
- Amocrm::Resources::ContactChats
- Defined in:
- lib/amocrm/resources/contact_chats.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ ContactChats
constructor
private
A new instance of ContactChats.
-
#link(body:, request_options: {}) ⇒ Amocrm::Models::ContactChatLinkResponse::ContactChatLinksResponse, Amocrm::Models::ContactChatLinkResponse::Problem
Link chats to contacts.
-
#list(filter: nil, request_options: {}) ⇒ Amocrm::Models::ContactChatListResponse::ContactChatLinksResponse, Amocrm::Models::ContactChatListResponse::Problem
Get list of linked chats.
Constructor Details
#initialize(client:) ⇒ ContactChats
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ContactChats.
52 53 54 |
# File 'lib/amocrm/resources/contact_chats.rb', line 52 def initialize(client:) @client = client end |
Instance Method Details
#link(body:, request_options: {}) ⇒ Amocrm::Models::ContactChatLinkResponse::ContactChatLinksResponse, Amocrm::Models::ContactChatLinkResponse::Problem
Link chats to contacts.
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/amocrm/resources/contact_chats.rb', line 38 def link(params) parsed, = Amocrm::ContactChatLinkParams.dump_request(params) @client.request( method: :post, path: "api/v4/contacts/chats", body: parsed[:body], model: Amocrm::Models::ContactChatLinkResponse, options: ) end |
#list(filter: nil, request_options: {}) ⇒ Amocrm::Models::ContactChatListResponse::ContactChatLinksResponse, Amocrm::Models::ContactChatListResponse::Problem
Get list of linked chats.
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/amocrm/resources/contact_chats.rb', line 16 def list(params = {}) parsed, = Amocrm::ContactChatListParams.dump_request(params) query = Amocrm::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "api/v4/contacts/chats", query: query, model: Amocrm::Models::ContactChatListResponse, options: ) end |