Class: Telnyx::Resources::EmailThreads
- Inherits:
-
Object
- Object
- Telnyx::Resources::EmailThreads
- Defined in:
- lib/telnyx/resources/email_threads.rb,
sig/telnyx/resources/email_threads.rbs
Overview
Account-wide conversation threads across every inbox, for agents operating many inboxes at once.
Instance Method Summary collapse
-
#initialize(client:) ⇒ EmailThreads
constructor
private
A new instance of EmailThreads.
-
#list(filter_inbox_id: nil, filter_label: nil, page_after: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Models::EmailInboxes::InboundThreadListResponse
Some parameter documentations has been truncated, see Models::EmailThreadListParams for more details.
-
#retrieve(thread_id, inbox_id:, page_after: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Models::EmailThreadRetrieveResponse
Returns a thread and a bounded page of its inbound and outbound messages, interleaved in chronological order.
Constructor Details
#initialize(client:) ⇒ EmailThreads
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 EmailThreads.
86 87 88 |
# File 'lib/telnyx/resources/email_threads.rb', line 86 def initialize(client:) @client = client end |
Instance Method Details
#list(filter_inbox_id: nil, filter_label: nil, page_after: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Models::EmailInboxes::InboundThreadListResponse
Some parameter documentations has been truncated, see Models::EmailThreadListParams for more details.
Lists thread summaries for the whole account, newest first, using stable cursor
pagination. An agent operating many inboxes gets every conversation in one call
instead of one call per inbox. Each thread carries its own inbox_id so a reply
can be routed back to the right inbox. Use filter[inbox_id] (repeatable) to
narrow the result to specific inboxes. Because a thread ID can be delivered to
multiple inboxes, each result is identified by its (inbox_id, id) pair.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/telnyx/resources/email_threads.rb', line 66 def list(params = {}) parsed, = Telnyx::EmailThreadListParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "email_threads", query: query.transform_keys( filter_inbox_id: "filter[inbox_id]", filter_label: "filter[label]", page_after: "page[after]", page_size: "page[size]" ), model: Telnyx::EmailInboxes::InboundThreadListResponse, options: ) end |
#retrieve(thread_id, inbox_id:, page_after: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Models::EmailThreadRetrieveResponse
Returns a thread and a bounded page of its inbound and outbound messages,
interleaved in chronological order. The inbox_id returned by the list endpoint
is required because a thread ID can occur in multiple inboxes. Only messages
matching that (inbox_id, thread_id) pair are returned. Threads outside the
account return an opaque 404.
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/telnyx/resources/email_threads.rb', line 29 def retrieve(thread_id, params) parsed, = Telnyx::EmailThreadRetrieveParams.dump_request(params) query = Telnyx::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["email_threads/%1$s", thread_id], query: query.transform_keys(page_after: "page[after]", page_size: "page[size]"), model: Telnyx::Models::EmailThreadRetrieveResponse, options: ) end |