class ZoomUs::ChatMessages

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/zoom_us/chat_messages.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

delete_chat_message(message_id, opts = {}) click to toggle source

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="OAuth“>marketplace.zoom.us/docs/guides/getting-started/app-types/create-oauth-app">OAuth app</a>.</p>
Scope: `chat_message:write`
@param message_id Message ID @param [Hash] opts the optional parameters @option opts [String] :to_contact 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. @option opts [String] :to_channel 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 @return [Object]

# 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 = {}) click to toggle source

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">OAuth app&lt;/a&gt;.&lt;/p&gt;&lt;br&gt; Scope: &#x60;chat_message:write&#x60;&lt;br&gt; @param message_id Message ID @param [Hash] opts the optional parameters @option opts [String] :to_contact 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. @option opts [String] :to_channel 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 @return [Array<(Object, Fixnum, Hash)>] Object data, response status code and response headers

# 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 = {}) click to toggle source

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="OAuth“>marketplace.zoom.us/docs/guides/getting-started/app-types/create-oauth-app">OAuth app</a>.</p>
Scope: `chat_message:write`
@param message_id Message ID: Unique Identifier of the message. @param [Hash] opts the optional parameters @option opts [Body6] :body @return [nil]

# 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 = {}) click to toggle source

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">OAuth app&lt;/a&gt;.&lt;/p&gt;&lt;br&gt; Scope: &#x60;chat_message:write&#x60; &lt;br&gt; @param message_id Message ID: Unique Identifier of the message. @param [Hash] opts the optional parameters @option opts [Body6] :body @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# 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 = {}) click to toggle source

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="OAuth“>marketplace.zoom.us/docs/guides/getting-started/app-types/create-oauth-app">OAuth app</a>.</p>

Scopes: `chat_message:read`
@param user_id @param [Hash] opts the optional parameters @option opts [String] :to_contact 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. @option opts [String] :to_channel 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. @option opts [Date] :date_ The query date for which you would like to get the chat messages. @option opts [Integer] :page_size The number of records returned with a single API call. (default to 10) @option opts [String] :next_page_token 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. @return [InlineResponse2006]

# 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 = {}) click to toggle source

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">OAuth app&lt;/a&gt;.&lt;/p&gt;&lt;br&gt; &lt;br&gt;Scopes: &#x60;chat_message:read&#x60;&lt;br&gt; @param user_id @param [Hash] opts the optional parameters @option opts [String] :to_contact 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. @option opts [String] :to_channel 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. @option opts [Date] :date_ The query date for which you would like to get the chat messages. @option opts [Integer] :page_size The number of records returned with a single API call. @option opts [String] :next_page_token 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. @return [Array<(InlineResponse2006, Fixnum, Hash)>] InlineResponse2006 data, response status code and response headers

# 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 = {}) click to toggle source

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="OAuth“>marketplace.zoom.us/docs/guides/getting-started/app-types/create-oauth-app">OAuth app</a>.</p>
@param [Hash] opts the optional parameters @option opts [Body5] :body @return [InlineResponse2011]

# 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 = {}) click to toggle source

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">OAuth app&lt;/a&gt;.&lt;/p&gt;&lt;br&gt; @param [Hash] opts the optional parameters @option opts [Body5] :body @return [Array<(InlineResponse2011, Fixnum, Hash)>] InlineResponse2011 data, response status code and response headers

# 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