Class: ZoomUs::Contacts

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ Contacts

Returns a new instance of Contacts.



19
20
21
# File 'lib/zoom_us/contacts.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/contacts.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_user_contact(contact_id, opts = {}) ⇒ InlineResponse2009

Get User’s Contact Details A user under an organization’s Zoom account has internal users listed under Company Contacts in the Zoom Client. A Zoom user can also add another Zoom user as a [contact](support.zoom.us/hc/en-us/articles/115004055706-Managing-Contacts). Call this API to get information on a specific contact of the Zoom user. <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_contact:read`

Parameters:

  • contact_id

    The user&#39;s contact Id or email address. The contact can be either a company contact or an external contact.

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

    the optional parameters

Options Hash (opts):

  • :query_presence_status (BOOLEAN)

    The presence status of the contact. Include this query parameter with a value of &#x60;true&#x60; to get the presence status of the contact in the response.

Returns:

  • (InlineResponse2009)


28
29
30
31
# File 'lib/zoom_us/contacts.rb', line 28

def get_user_contact(contact_id, opts = {})
  data, _status_code, _headers = get_user_contact_with_http_info(contact_id, opts)
  data
end

#get_user_contact_with_http_info(contact_id, opts = {}) ⇒ Array<(InlineResponse2009, Fixnum, Hash)>

Get User&#39;s Contact Details A user under an organization’s Zoom account has internal users listed under Company Contacts in the Zoom Client. A Zoom user can also add another Zoom user as a [contact](support.zoom.us/hc/en-us/articles/115004055706-Managing-Contacts). Call this API to get information on a specific contact of the Zoom user. &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_contact:read&#x60;&lt;br&gt;

Parameters:

  • contact_id

    The user&#39;s contact Id or email address. The contact can be either a company contact or an external contact.

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

    the optional parameters

Options Hash (opts):

  • :query_presence_status (BOOLEAN)

    The presence status of the contact. Include this query parameter with a value of &#x60;true&#x60; to get the presence status of the contact in the response.

Returns:

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

    InlineResponse2009 data, response status code and response headers



39
40
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
# File 'lib/zoom_us/contacts.rb', line 39

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

  # query parameters
  query_params = {}
  query_params[:'query_presence_status'] = opts[:'query_presence_status'] if !opts[:'query_presence_status'].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 => 'InlineResponse2009')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ContactsApi#get_user_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_user_contacts(opts = {}) ⇒ InlineResponse2008

List User’s Contacts A user under an organization’s Zoom account has internal users listed under Company Contacts in the Zoom Client. A Zoom user can also add another Zoom user as a [contact](support.zoom.us/hc/en-us/articles/115004055706-Managing-Contacts). Call this API to list all the contacts of a Zoom user. Zoom contacts are categorized into "company contacts" and "external contacts". You must specify the contact type in the ‘type` query parameter. If you do not specify, by default, the type will be set as company contact. <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_contact:read`

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :type (String)

    The type of contact. The value can be one of the following: &#x60;company&#x60;: Contacts from the user&#39;s organization. &#x60;external&#x60;: External contacts. (default to company)

  • :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:

  • (InlineResponse2008)


86
87
88
89
# File 'lib/zoom_us/contacts.rb', line 86

def get_user_contacts(opts = {})
  data, _status_code, _headers = get_user_contacts_with_http_info(opts)
  data
end

#get_user_contacts_with_http_info(opts = {}) ⇒ Array<(InlineResponse2008, Fixnum, Hash)>

List User&#39;s Contacts A user under an organization’s Zoom account has internal users listed under Company Contacts in the Zoom Client. A Zoom user can also add another Zoom user as a [contact](support.zoom.us/hc/en-us/articles/115004055706-Managing-Contacts). Call this API to list all the contacts of a Zoom user. Zoom contacts are categorized into &quot;company contacts&quot; and &quot;external contacts&quot;. You must specify the contact type in the &#x60;type&#x60; query parameter. If you do not specify, by default, the type will be set as company contact. &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_contact:read&#x60;&lt;br&gt;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :type (String)

    The type of contact. The value can be one of the following: &#x60;company&#x60;: Contacts from the user&#39;s organization. &#x60;external&#x60;: External contacts.

  • :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<(InlineResponse2008, Fixnum, Hash)>)

    InlineResponse2008 data, response status code and response headers



98
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
137
138
139
# File 'lib/zoom_us/contacts.rb', line 98

def get_user_contacts_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ContactsApi.get_user_contacts ...'
  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 ContactsApi.get_user_contacts, must be smaller than or equal to 50.'
  end

  # resource path
  local_var_path = '/chat/users/me/contacts'

  # query parameters
  query_params = {}
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].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 => 'InlineResponse2008')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ContactsApi#get_user_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#search_company_contacts(search_key, opts = {}) ⇒ InlineResponse2005

Search Company Contacts A user under an organization’s Zoom account has internal users listed under Company Contacts in the Zoom Client. Use this API to search users that are in the company contacts of a Zoom account. Using the ‘search_key` query parameter, provide either first name, last name or the email address of the user that you would like to search for. Optionally, set `query_presence_status` to `true` in order to include the presence status of a contact.
Scopes: `contact:read:admin`, `contact:read`

Parameters:

  • search_key

    Provide the keyword - either first name, last name or email of the contact whom you have to search for.

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

    the optional parameters

Options Hash (opts):

  • :query_presence_status (String)

    Set &#x60;query_presence_status&#x60; to &#x60;true&#x60; in order to include the presence status of a contact in the response.

  • :page_size (Integer)

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

  • :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:

  • (InlineResponse2005)


148
149
150
151
# File 'lib/zoom_us/contacts.rb', line 148

def search_company_contacts(search_key, opts = {})
  data, _status_code, _headers = search_company_contacts_with_http_info(search_key, opts)
  data
end

#search_company_contacts_with_http_info(search_key, opts = {}) ⇒ Array<(InlineResponse2005, Fixnum, Hash)>

Search Company Contacts A user under an organization&#39;s Zoom account has internal users listed under Company Contacts in the Zoom Client. Use this API to search users that are in the company contacts of a Zoom account. Using the &#x60;search_key&#x60; query parameter, provide either first name, last name or the email address of the user that you would like to search for. Optionally, set &#x60;query_presence_status&#x60; to &#x60;true&#x60; in order to include the presence status of a contact. &lt;br&gt;&lt;br&gt; Scopes: &#x60;contact:read:admin&#x60;, &#x60;contact:read&#x60;&lt;br&gt;

Parameters:

  • search_key

    Provide the keyword - either first name, last name or email of the contact whom you have to search for.

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

    the optional parameters

Options Hash (opts):

  • :query_presence_status (String)

    Set &#x60;query_presence_status&#x60; to &#x60;true&#x60; in order to include the presence status of a contact in the response.

  • :page_size (Integer)

    The number of records to be 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<(InlineResponse2005, Fixnum, Hash)>)

    InlineResponse2005 data, response status code and response headers



161
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
# File 'lib/zoom_us/contacts.rb', line 161

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

  # resource path
  local_var_path = '/contacts'

  # query parameters
  query_params = {}
  query_params[:'search_key'] = search_key
  query_params[:'query_presence_status'] = opts[:'query_presence_status'] if !opts[:'query_presence_status'].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 => 'InlineResponse2005')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ContactsApi#search_company_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end