class Pipedrive::UsersApi
Attributes
Public Class Methods
# File lib/pipedrive-openapi-client/api/users_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Find users by name Finds users by their name. @param term [String] Search term to look for @param [Hash] opts the optional parameters @option opts [NumberBooleanDefault0] :search_by_email When enabled, term will only be matched against email addresses of users. Default: false @return [Users]
# File lib/pipedrive-openapi-client/api/users_api.rb, line 28 def users_find_get(term, opts = {}) data, _status_code, _headers = users_find_get_with_http_info(term, opts) data end
Find users by name Finds users by their name. @param term [String] Search term to look for @param [Hash] opts the optional parameters @option opts [NumberBooleanDefault0] :search_by_email When enabled, term will only be matched against email addresses of users. Default: false @return [Array<(Users
, Integer, Hash)>] Users
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/users_api.rb, line 39 def users_find_get_with_http_info(term, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.users_find_get ...' end # verify the required parameter 'term' is set if @api_client.config.client_side_validation && term.nil? fail ArgumentError, "Missing the required parameter 'term' when calling UsersApi.users_find_get" end # resource path local_var_path = '/users/find' # query parameters query_params = opts[:query_params] || {} query_params[:'term'] = term query_params[:'search_by_email'] = opts[:'search_by_email'] if !opts[:'search_by_email'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Users' # auth_names auth_names = opts[:auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#users_find_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get all users Returns data about all users within the company @param [Hash] opts the optional parameters @return [Users]
# File lib/pipedrive-openapi-client/api/users_api.rb, line 92 def users_get(opts = {}) data, _status_code, _headers = users_get_with_http_info(opts) data end
Get all users Returns data about all users within the company @param [Hash] opts the optional parameters @return [Array<(Users
, Integer, Hash)>] Users
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/users_api.rb, line 101 def users_get_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.users_get ...' end # resource path local_var_path = '/users' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Users' # auth_names auth_names = opts[:auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#users_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List blacklisted email addresses of a user Lists blacklisted email addresses of a specific user. Blacklisted emails are such that will not get synced in to Pipedrive
when using the built-in Mailbox. @param id [Integer] ID of the user @param [Hash] opts the optional parameters @return [nil]
# File lib/pipedrive-openapi-client/api/users_api.rb, line 149 def users_id_blacklisted_emails_get(id, opts = {}) users_id_blacklisted_emails_get_with_http_info(id, opts) nil end
List blacklisted email addresses of a user Lists blacklisted email addresses of a specific user. Blacklisted emails are such that will not get synced in to Pipedrive
when using the built-in Mailbox. @param id [Integer] ID of the user @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/pipedrive-openapi-client/api/users_api.rb, line 159 def users_id_blacklisted_emails_get_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.users_id_blacklisted_emails_get ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_id_blacklisted_emails_get" end # resource path local_var_path = '/users/{id}/blacklistedEmails'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#users_id_blacklisted_emails_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Add blacklisted email address for a user Add blacklisted email address for a specific user. @param id [Integer] ID of the user @param address [String] Email address to blacklist (can contain \\\* for wildcards, e.g. \\\*@example.com, or john\\\*@ex\\\*.com) @param [Hash] opts the optional parameters @return [nil]
# File lib/pipedrive-openapi-client/api/users_api.rb, line 210 def users_id_blacklisted_emails_post(id, address, opts = {}) users_id_blacklisted_emails_post_with_http_info(id, address, opts) nil end
Add blacklisted email address for a user Add blacklisted email address for a specific user. @param id [Integer] ID of the user @param address [String] Email address to blacklist (can contain \\\* for wildcards, e.g. \\\*@example.com, or john\\\*@ex\\\*.com) @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/pipedrive-openapi-client/api/users_api.rb, line 221 def users_id_blacklisted_emails_post_with_http_info(id, address, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.users_id_blacklisted_emails_post ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_id_blacklisted_emails_post" end # verify the required parameter 'address' is set if @api_client.config.client_side_validation && address.nil? fail ArgumentError, "Missing the required parameter 'address' when calling UsersApi.users_id_blacklisted_emails_post" end # resource path local_var_path = '/users/{id}/blacklistedEmails'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) # form parameters form_params = opts[:form_params] || {} form_params['address'] = address # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#users_id_blacklisted_emails_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List followers of a user Lists followers of a specific user. @param id [Integer] ID of the user @param [Hash] opts the optional parameters @return [UserIDs]
# File lib/pipedrive-openapi-client/api/users_api.rb, line 278 def users_id_followers_get(id, opts = {}) data, _status_code, _headers = users_id_followers_get_with_http_info(id, opts) data end
List followers of a user Lists followers of a specific user. @param id [Integer] ID of the user @param [Hash] opts the optional parameters @return [Array<(UserIDs
, Integer, Hash)>] UserIDs
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/users_api.rb, line 288 def users_id_followers_get_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.users_id_followers_get ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_id_followers_get" end # resource path local_var_path = '/users/{id}/followers'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'UserIDs' # auth_names auth_names = opts[:auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#users_id_followers_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get one user Returns data about a specific user within the company @param id [Integer] ID of the user @param [Hash] opts the optional parameters @return [User]
# File lib/pipedrive-openapi-client/api/users_api.rb, line 340 def users_id_get(id, opts = {}) data, _status_code, _headers = users_id_get_with_http_info(id, opts) data end
Get one user Returns data about a specific user within the company @param id [Integer] ID of the user @param [Hash] opts the optional parameters @return [Array<(User
, Integer, Hash)>] User
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/users_api.rb, line 350 def users_id_get_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.users_id_get ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_id_get" end # resource path local_var_path = '/users/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'User' # auth_names auth_names = opts[:auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#users_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List user permissions List aggregated permissions over all assigned permission sets for a user @param id [Integer] ID of the user @param [Hash] opts the optional parameters @return [nil]
# File lib/pipedrive-openapi-client/api/users_api.rb, line 402 def users_id_permissions_get(id, opts = {}) users_id_permissions_get_with_http_info(id, opts) nil end
List user permissions List aggregated permissions over all assigned permission sets for a user @param id [Integer] ID of the user @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/pipedrive-openapi-client/api/users_api.rb, line 412 def users_id_permissions_get_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.users_id_permissions_get ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_id_permissions_get" end # resource path local_var_path = '/users/{id}/permissions'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#users_id_permissions_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Update user details Updates the properties of a user. Currently, only active_flag can be updated. @param id [Integer] ID of the user @param active_flag [Boolean] Whether the user is active or not. false = Not activated, true = Activated @param [Hash] opts the optional parameters @return [User]
# File lib/pipedrive-openapi-client/api/users_api.rb, line 463 def users_id_put(id, active_flag, opts = {}) data, _status_code, _headers = users_id_put_with_http_info(id, active_flag, opts) data end
Update user details Updates the properties of a user. Currently, only active_flag can be updated. @param id [Integer] ID of the user @param active_flag [Boolean] Whether the user is active or not. false = Not activated, true = Activated @param [Hash] opts the optional parameters @return [Array<(User
, Integer, Hash)>] User
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/users_api.rb, line 474 def users_id_put_with_http_info(id, active_flag, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.users_id_put ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_id_put" end # verify the required parameter 'active_flag' is set if @api_client.config.client_side_validation && active_flag.nil? fail ArgumentError, "Missing the required parameter 'active_flag' when calling UsersApi.users_id_put" end # resource path local_var_path = '/users/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) # form parameters form_params = opts[:form_params] || {} form_params['active_flag'] = active_flag # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'User' # auth_names auth_names = opts[:auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#users_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Delete a role assignment Delete a role assignment for a user @param id [Integer] ID of the user @param role_id [Integer] ID of the role @param [Hash] opts the optional parameters @return [nil]
# File lib/pipedrive-openapi-client/api/users_api.rb, line 534 def users_id_role_assignments_delete(id, role_id, opts = {}) users_id_role_assignments_delete_with_http_info(id, role_id, opts) nil end
Delete a role assignment Delete a role assignment for a user @param id [Integer] ID of the user @param role_id [Integer] ID of the role @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/pipedrive-openapi-client/api/users_api.rb, line 545 def users_id_role_assignments_delete_with_http_info(id, role_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.users_id_role_assignments_delete ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_id_role_assignments_delete" end # verify the required parameter 'role_id' is set if @api_client.config.client_side_validation && role_id.nil? fail ArgumentError, "Missing the required parameter 'role_id' when calling UsersApi.users_id_role_assignments_delete" end # resource path local_var_path = '/users/{id}/roleAssignments'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'role_id'] = role_id # header parameters header_params = opts[:header_params] || {} # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['api_key'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#users_id_role_assignments_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List role assignments List role assignments for a user @param id [Integer] ID of the user @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start (default to 0) @option opts [Integer] :limit Items shown per page @return [nil]
# File lib/pipedrive-openapi-client/api/users_api.rb, line 602 def users_id_role_assignments_get(id, opts = {}) users_id_role_assignments_get_with_http_info(id, opts) nil end
List role assignments List role assignments for a user @param id [Integer] ID of the user @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start @option opts [Integer] :limit Items shown per page @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/pipedrive-openapi-client/api/users_api.rb, line 614 def users_id_role_assignments_get_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.users_id_role_assignments_get ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_id_role_assignments_get" end # resource path local_var_path = '/users/{id}/roleAssignments'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = opts[:header_params] || {} # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['api_key'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#users_id_role_assignments_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Add role assignment Add role assignment for a user @param id [Integer] ID of the user @param role_id [Integer] ID of the role @param [Hash] opts the optional parameters @return [nil]
# File lib/pipedrive-openapi-client/api/users_api.rb, line 667 def users_id_role_assignments_post(id, role_id, opts = {}) users_id_role_assignments_post_with_http_info(id, role_id, opts) nil end
Add role assignment Add role assignment for a user @param id [Integer] ID of the user @param role_id [Integer] ID of the role @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/pipedrive-openapi-client/api/users_api.rb, line 678 def users_id_role_assignments_post_with_http_info(id, role_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.users_id_role_assignments_post ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_id_role_assignments_post" end # verify the required parameter 'role_id' is set if @api_client.config.client_side_validation && role_id.nil? fail ArgumentError, "Missing the required parameter 'role_id' when calling UsersApi.users_id_role_assignments_post" end # resource path local_var_path = '/users/{id}/roleAssignments'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) # form parameters form_params = opts[:form_params] || {} form_params['role_id'] = role_id # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['api_key'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#users_id_role_assignments_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List user role settings List settings of user's assigned role @param id [Integer] ID of the user @param [Hash] opts the optional parameters @return [nil]
# File lib/pipedrive-openapi-client/api/users_api.rb, line 735 def users_id_role_settings_get(id, opts = {}) users_id_role_settings_get_with_http_info(id, opts) nil end
List user role settings List settings of user's assigned role @param id [Integer] ID of the user @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/pipedrive-openapi-client/api/users_api.rb, line 745 def users_id_role_settings_get_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.users_id_role_settings_get ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_id_role_settings_get" end # resource path local_var_path = '/users/{id}/roleSettings'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] # auth_names auth_names = opts[:auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#users_id_role_settings_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get current user data Returns data about an authorized user within the company with bound company data: company ID, company name, and domain. Note
that the 'locale' property means 'Date and number format' in the Pipedrive
settings, not the chosen language. @param [Hash] opts the optional parameters @return [UserMe]
# File lib/pipedrive-openapi-client/api/users_api.rb, line 794 def users_me_get(opts = {}) data, _status_code, _headers = users_me_get_with_http_info(opts) data end
Get current user data Returns data about an authorized user within the company with bound company data: company ID, company name, and domain. Note
that the 'locale' property means 'Date and number format' in the Pipedrive
settings, not the chosen language. @param [Hash] opts the optional parameters @return [Array<(UserMe
, Integer, Hash)>] UserMe
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/users_api.rb, line 803 def users_me_get_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.users_me_get ...' end # resource path local_var_path = '/users/me' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'UserMe' # auth_names auth_names = opts[:auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#users_me_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Add a new user Adds a new user to the company, returns the ID upon success. @param name [String] Name of the user @param email [String] Email of the user @param active_flag [Boolean] Whether the user is active or not. false = Not activated, true = Activated @param [Hash] opts the optional parameters @return [User]
# File lib/pipedrive-openapi-client/api/users_api.rb, line 853 def users_post(name, email, active_flag, opts = {}) data, _status_code, _headers = users_post_with_http_info(name, email, active_flag, opts) data end
Add a new user Adds a new user to the company, returns the ID upon success. @param name [String] Name of the user @param email [String] Email of the user @param active_flag [Boolean] Whether the user is active or not. false = Not activated, true = Activated @param [Hash] opts the optional parameters @return [Array<(User
, Integer, Hash)>] User
data, response status code and response headers
# File lib/pipedrive-openapi-client/api/users_api.rb, line 865 def users_post_with_http_info(name, email, active_flag, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: UsersApi.users_post ...' end # verify the required parameter 'name' is set if @api_client.config.client_side_validation && name.nil? fail ArgumentError, "Missing the required parameter 'name' when calling UsersApi.users_post" end # verify the required parameter 'email' is set if @api_client.config.client_side_validation && email.nil? fail ArgumentError, "Missing the required parameter 'email' when calling UsersApi.users_post" end # verify the required parameter 'active_flag' is set if @api_client.config.client_side_validation && active_flag.nil? fail ArgumentError, "Missing the required parameter 'active_flag' when calling UsersApi.users_post" end # resource path local_var_path = '/users' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded']) # form parameters form_params = opts[:form_params] || {} form_params['name'] = name form_params['email'] = email form_params['active_flag'] = active_flag # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'User' # auth_names auth_names = opts[:auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#users_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end