Class: ZoomUs::ChatMessages

Inherits:
Object
  • Object
show all
Defined in:
lib/zoom_us/chat_messages.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ChatMessages

Returns a new instance of ChatMessages.



19
20
21
# File 'lib/zoom_us/chat_messages.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/zoom_us/chat_messages.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#delete_chat_message(message_id, opts = {}) ⇒ Object

Delete a Message Delete a chat message that you previously sent to a contact or a channel. In the query parameter, you must provide either of the following:
* ‘to_contact`: The email address of the contact to whom you sent the message. Use this parameter to delete a message sent to an individual contact in Zoom. * `to_channel`: The channel ID of the channel where you sent the message. Use this parameter to delete a message sent to a channel in Zoom. <p style="background-color:#e1f5fe;color:#01579b;padding:8px"> Note: This API only supports user-managed <a href="marketplace.zoom.us/docs/guides/getting-started/app-types/create-oauth-app">OAuth app</a>.</p>
Scope: `chat_message:write`

Parameters:

  • message_id

    Message ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :to_contact (String)

    The userId or email address of a chat contact to whom you previously sent the message. Note: You must provide either &#x60;to_contact&#x60; or &#x60;to_channel&#x60; as a query parameter to delete a message that was previously sent to either an individual or a chat channel respectively.

  • :to_channel (String)

    The channel Id of the channel where you would like to send the message. You must provide either &#x60;to_contact&#x60; or &#x60;to_channel&#x60; as a query parameter to delete a message that was previously sent to either an individual or a chat channel

Returns:

  • (Object)


29
30
31
32
# File 'lib/zoom_us/chat_messages.rb', line 29

def delete_chat_message(message_id, opts = {})
  data, _status_code, _headers = delete_chat_message_with_http_info(message_id, opts)
  data
end

#delete_chat_message_with_http_info(message_id, opts = {}) ⇒ Array<(Object, Fixnum, Hash)>

Delete a Message Delete a chat message that you previously sent to a contact or a channel. In the query parameter, you must provide either of the following:&lt;br&gt; * &#x60;to_contact&#x60;: The email address of the contact to whom you sent the message. Use this parameter to delete a message sent to an individual contact in Zoom. * &#x60;to_channel&#x60;: The channel ID of the channel where you sent the message. Use this parameter to delete a message sent to a channel in Zoom. &lt;p style&#x3D;&quot;background-color:#e1f5fe;color:#01579b;padding:8px&quot;&gt; &lt;b&gt;Note: &lt;/b&gt;This API only supports &lt;b&gt;user-managed&lt;/b&gt; &lt;a href&#x3D;&quot;marketplace.zoom.us/docs/guides/getting-started/app-types/create-oauth-app&quot;&gt;OAuth app&lt;/a&gt;.&lt;/p&gt;&lt;br&gt; Scope: &#x60;chat_message:write&#x60;&lt;br&gt;

Parameters:

  • message_id

    Message ID

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :to_contact (String)

    The userId or email address of a chat contact to whom you previously sent the message. Note: You must provide either &#x60;to_contact&#x60; or &#x60;to_channel&#x60; as a query parameter to delete a message that was previously sent to either an individual or a chat channel respectively.

  • :to_channel (String)

    The channel Id of the channel where you would like to send the message. You must provide either &#x60;to_contact&#x60; or &#x60;to_channel&#x60; as a query parameter to delete a message that was previously sent to either an individual or a chat channel

Returns:

  • (Array<(Object, Fixnum, Hash)>)

    Object data, response status code and response headers



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/zoom_us/chat_messages.rb', line 41

def delete_chat_message_with_http_info(message_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatMessagesApi.delete_chat_message ...'
  end
  # verify the required parameter 'message_id' is set
  if @api_client.config.client_side_validation && message_id.nil?
    fail ArgumentError, "Missing the required parameter 'message_id' when calling ChatMessagesApi.delete_chat_message"
  end
  # resource path
  local_var_path = '/chat/users/me/messages/{messageId}'.sub('{' + 'messageId' + '}', message_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'to_contact'] = opts[:'to_contact'] if !opts[:'to_contact'].nil?
  query_params[:'to_channel'] = opts[:'to_channel'] if !opts[:'to_channel'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['OAuth']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Object')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatMessagesApi#delete_chat_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#edit_message(message_id, opts = {}) ⇒ nil

Update a Message Each chat message has a unique identifier. Use this API to edit a chat message that you previously sent to either a contact or a channel in Zoom by providing the ID of the message as the value of the ‘messageId` parameter. The ID can be retrieved from List User’s Chat Messages API. Additionally, as a query parameter, you must provide either the **email address** of the contact or the **Channel ID** of the channel where the message was sent. <p style="background-color:#e1f5fe; color:#01579b; padding:8px"> Note: This API only supports user-managed <a href="marketplace.zoom.us/docs/guides/getting-started/app-types/create-oauth-app">OAuth app</a>.</p>
Scope: ‘chat_message:write`

Parameters:

  • message_id

    Message ID: Unique Identifier of the message.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :body (Body6)

Returns:

  • (nil)


88
89
90
91
# File 'lib/zoom_us/chat_messages.rb', line 88

def edit_message(message_id, opts = {})
  edit_message_with_http_info(message_id, opts)
  nil
end

#edit_message_with_http_info(message_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update a Message Each chat message has a unique identifier. Use this API to edit a chat message that you previously sent to either a contact or a channel in Zoom by providing the ID of the message as the value of the &#x60;messageId&#x60; parameter. The ID can be retrieved from List User&#39;s Chat Messages API. Additionally, as a query parameter, you must provide either the **email address** of the contact or the **Channel ID** of the channel where the message was sent. &lt;p style&#x3D;&quot;background-color:#e1f5fe; color:#01579b; padding:8px&quot;&gt; &lt;b&gt;Note: &lt;/b&gt; This API only supports &lt;b&gt;user-managed&lt;/b&gt; &lt;a href&#x3D;&quot;marketplace.zoom.us/docs/guides/getting-started/app-types/create-oauth-app&quot;&gt;OAuth app&lt;/a&gt;.&lt;/p&gt;&lt;br&gt; Scope: &#x60;chat_message:write&#x60; &lt;br&gt;

Parameters:

  • message_id

    Message ID: Unique Identifier of the message.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :body (Body6)

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/zoom_us/chat_messages.rb', line 99

def edit_message_with_http_info(message_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatMessagesApi.edit_message ...'
  end
  # verify the required parameter 'message_id' is set
  if @api_client.config.client_side_validation && message_id.nil?
    fail ArgumentError, "Missing the required parameter 'message_id' when calling ChatMessagesApi.edit_message"
  end
  # resource path
  local_var_path = '/chat/users/me/messages/{messageId}'.sub('{' + 'messageId' + '}', message_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  auth_names = ['OAuth']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatMessagesApi#edit_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_chat_messages(user_id, opts = {}) ⇒ InlineResponse2006

List User’s Chat Messages A Zoom user can have conversations with other Zoom users via chat. Use this API to list the current user’s chat messages between the user and an individual contact or a chat channel.
In the query parameter, you must provide either of the following:
* ‘to_contact`: The email address of the contact with whom the user conversed by sending/receiving messages. * `to_channel`: The channel ID of the channel to/from which the user has sent and/or received messages.
**Specify a date** in the `date` query parameter to view messages from that date. If a date is not provided, the default value for the query will be the **current date**.
<p style="background-color:#e1f5fe; color:#01579b; padding:8px">Note: This API only supports user-managed <a href="marketplace.zoom.us/docs/guides/getting-started/app-types/create-oauth-app">OAuth app</a>.</p>

Scopes: `chat_message:read`

Parameters:

  • user_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :to_contact (String)

    The email address of a chat contact with whom the current user chatted. Messages that were sent and/or received between the user and the contact is displayed. Note: You must provide either &#x60;contact&#x60; or &#x60;channel&#x60; as a query parameter to retrieve messages either from an individual or a chat channel.

  • :to_channel (String)

    The channel Id of a channel inside which current user had chat converstations. Messages that were sent and/or received between the user and the channel is displayed. Note: You must provide either &#x60;contact&#x60; or &#x60;channel&#x60; as a query parameter to retrieve messages either from an individual or a chat channel.

  • :date_ (Date)

    The query date for which you would like to get the chat messages.

  • :page_size (Integer)

    The number of records returned with a single API call. (default to 10)

  • :next_page_token (String)

    The next page token is used to paginate through large result sets. A next page token will be returned whenever the set of available results exceeds the current page size. The expiration period for this token is 15 minutes.

Returns:

  • (InlineResponse2006)


147
148
149
150
# File 'lib/zoom_us/chat_messages.rb', line 147

def get_chat_messages(user_id, opts = {})
  data, _status_code, _headers = get_chat_messages_with_http_info(user_id, opts)
  data
end

#get_chat_messages_with_http_info(user_id, opts = {}) ⇒ Array<(InlineResponse2006, Fixnum, Hash)>

List User&#39;s Chat Messages A Zoom user can have conversations with other Zoom users via chat. Use this API to list the current user&#39;s chat messages between the user and an individual contact or a chat channel.&lt;br&gt; In the query parameter, you must provide either of the following:&lt;br&gt; * &#x60;to_contact&#x60;: The email address of the contact with whom the user conversed by sending/receiving messages. * &#x60;to_channel&#x60;: The channel ID of the channel to/from which the user has sent and/or received messages. &lt;br&gt; **Specify a date** in the &#x60;date&#x60; query parameter to view messages from that date. If a date is not provided, the default value for the query will be the **current date**.&lt;br&gt; &lt;p style&#x3D;&quot;background-color:#e1f5fe; color:#01579b; padding:8px&quot;&gt;&lt;b&gt;Note: &lt;/b&gt;This API only supports &lt;b&gt;user-managed&lt;/b&gt; &lt;a href&#x3D;&quot;marketplace.zoom.us/docs/guides/getting-started/app-types/create-oauth-app&quot;&gt;OAuth app&lt;/a&gt;.&lt;/p&gt;&lt;br&gt; &lt;br&gt;Scopes: &#x60;chat_message:read&#x60;&lt;br&gt;

Parameters:

  • user_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :to_contact (String)

    The email address of a chat contact with whom the current user chatted. Messages that were sent and/or received between the user and the contact is displayed. Note: You must provide either &#x60;contact&#x60; or &#x60;channel&#x60; as a query parameter to retrieve messages either from an individual or a chat channel.

  • :to_channel (String)

    The channel Id of a channel inside which current user had chat converstations. Messages that were sent and/or received between the user and the channel is displayed. Note: You must provide either &#x60;contact&#x60; or &#x60;channel&#x60; as a query parameter to retrieve messages either from an individual or a chat channel.

  • :date_ (Date)

    The query date for which you would like to get the chat messages.

  • :page_size (Integer)

    The number of records returned with a single API call.

  • :next_page_token (String)

    The next page token is used to paginate through large result sets. A next page token will be returned whenever the set of available results exceeds the current page size. The expiration period for this token is 15 minutes.

Returns:

  • (Array<(InlineResponse2006, Fixnum, Hash)>)

    InlineResponse2006 data, response status code and response headers



162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/zoom_us/chat_messages.rb', line 162

def get_chat_messages_with_http_info(user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatMessagesApi.get_chat_messages ...'
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling ChatMessagesApi.get_chat_messages"
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 50
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ChatMessagesApi.get_chat_messages, must be smaller than or equal to 50.'
  end

  # resource path
  local_var_path = '/chat/users/{userId}/messages'.sub('{' + 'userId' + '}', user_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'to_contact'] = opts[:'to_contact'] if !opts[:'to_contact'].nil?
  query_params[:'to_channel'] = opts[:'to_channel'] if !opts[:'to_channel'].nil?
  query_params[:'date '] = opts[:'date_'] if !opts[:'date_'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'next_page_token'] = opts[:'next_page_token'] if !opts[:'next_page_token'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['OAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2006')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatMessagesApi#get_chat_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#senda_chat_message(opts = {}) ⇒ InlineResponse2011

Send a Chat Message Send chat messages on Zoom to either an individual user who is in your contact list or to a [channel](support.zoom.us/hc/en-us/articles/200912909-Getting-Started-With-Channels-Group-Messaging-) of which you are a member. To send a message to a contact, provide the contact’s email address in the ‘to_contact` field. Similary, to send a message to a channel, provide the Channel Id of the Channel in `to_channel` field.

Scopes: `chat_message:write`

<p style="background-color:#e1f5fe; color:#01579b; padding:8px"> Note: This API only supports user-managed <a href="marketplace.zoom.us/docs/guides/getting-started/app-types/create-oauth-app">OAuth app</a>.</p>

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :body (Body5)

Returns:

  • (InlineResponse2011)


215
216
217
218
# File 'lib/zoom_us/chat_messages.rb', line 215

def senda_chat_message(opts = {})
  data, _status_code, _headers = senda_chat_message_with_http_info(opts)
  data
end

#senda_chat_message_with_http_info(opts = {}) ⇒ Array<(InlineResponse2011, Fixnum, Hash)>

Send a Chat Message Send chat messages on Zoom to either an individual user who is in your contact list or to a [channel](support.zoom.us/hc/en-us/articles/200912909-Getting-Started-With-Channels-Group-Messaging-) of which you are a member. To send a message to a contact, provide the contact&#39;s email address in the &#x60;to_contact&#x60; field. Similary, to send a message to a channel, provide the Channel Id of the Channel in &#x60;to_channel&#x60; field.&lt;br&gt; &lt;br&gt;Scopes: &#x60;chat_message:write&#x60;&lt;br&gt; &lt;br&gt; &lt;p style&#x3D;&quot;background-color:#e1f5fe; color:#01579b; padding:8px&quot;&gt; &lt;b&gt;Note: &lt;/b&gt;This API only supports &lt;b&gt;user-managed&lt;/b&gt; &lt;a href&#x3D;&quot;marketplace.zoom.us/docs/guides/getting-started/app-types/create-oauth-app&quot;&gt;OAuth app&lt;/a&gt;.&lt;/p&gt;&lt;br&gt;

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :body (Body5)

Returns:

  • (Array<(InlineResponse2011, Fixnum, Hash)>)

    InlineResponse2011 data, response status code and response headers



225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
# File 'lib/zoom_us/chat_messages.rb', line 225

def senda_chat_message_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ChatMessagesApi.senda_chat_message ...'
  end
  # resource path
  local_var_path = '/chat/users/me/messages'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'body'])
  auth_names = ['OAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2011')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatMessagesApi#senda_chat_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end