class Pipedrive::OrganizationsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

organizations_delete(ids, opts = {}) click to toggle source

Delete multiple organizations in bulk Marks multiple organizations as deleted. @param ids [String] Comma-separated IDs that will be deleted @param [Hash] opts the optional parameters @return [nil]

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 27
def organizations_delete(ids, opts = {})
  organizations_delete_with_http_info(ids, opts)
  nil
end
organizations_delete_with_http_info(ids, opts = {}) click to toggle source

Delete multiple organizations in bulk Marks multiple organizations as deleted. @param ids [String] Comma-separated IDs that will be deleted @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 37
def organizations_delete_with_http_info(ids, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationsApi.organizations_delete ...'
  end
  # verify the required parameter 'ids' is set
  if @api_client.config.client_side_validation && ids.nil?
    fail ArgumentError, "Missing the required parameter 'ids' when calling OrganizationsApi.organizations_delete"
  end
  # resource path
  local_var_path = '/organizations'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'ids'] = ids

  # 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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrganizationsApi#organizations_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
organizations_find_get_with_http_info(term, opts = {}) click to toggle source

Find organizations by name &lt;strong&gt;This endpoint is deprecated. Please use &lt;a href&#x3D;&quot;developers.pipedrive.com/docs/api/v1/#!/Organizations/get_organizations_search">/v1/organizations/search</a>; or &lt;&lt;a href&#x3D;&quot;developers.pipedrive.com/docs/api/v1/#!/ItemSearch/get_itemSearch">/v1/itemSearch</a>; instead&lt;/strong&gt;. &lt;br&gt; Searches all organizations by their name. @param term [String] Search term to look for @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/organizations_api.rb, line 102
def organizations_find_get_with_http_info(term, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationsApi.organizations_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 OrganizationsApi.organizations_find_get"
  end
  # resource path
  local_var_path = '/organizations/find'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'term'] = term
  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', '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: OrganizationsApi#organizations_find_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
organizations_get(opts = {}) click to toggle source

Get all organizations Returns all organizations @param [Hash] opts the optional parameters @option opts [Integer] :user_id If supplied, only organizations owned by the given user will be returned. @option opts [Integer] :filter_id ID of the filter to use @option opts [String] :first_char If supplied, only organizations whose name starts with the specified letter will be returned (case insensitive). @option opts [Integer] :start Pagination start (default to 0) @option opts [Integer] :limit Items shown per page @option opts [String] :sort Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). @return [nil]

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 160
def organizations_get(opts = {})
  organizations_get_with_http_info(opts)
  nil
end
organizations_get_with_http_info(opts = {}) click to toggle source

Get all organizations Returns all organizations @param [Hash] opts the optional parameters @option opts [Integer] :user_id If supplied, only organizations owned by the given user will be returned. @option opts [Integer] :filter_id ID of the filter to use @option opts [String] :first_char If supplied, only organizations whose name starts with the specified letter will be returned (case insensitive). @option opts [Integer] :start Pagination start @option opts [Integer] :limit Items shown per page @option opts [String] :sort Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 175
def organizations_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationsApi.organizations_get ...'
  end
  # resource path
  local_var_path = '/organizations'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'user_id'] = opts[:'user_id'] if !opts[:'user_id'].nil?
  query_params[:'filter_id'] = opts[:'filter_id'] if !opts[:'filter_id'].nil?
  query_params[:'first_char'] = opts[:'first_char'] if !opts[:'first_char'].nil?
  query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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', '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: OrganizationsApi#organizations_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
organizations_id_activities_get(id, opts = {}) click to toggle source

List activities associated with an organization Lists activities associated with an organization. @param id [Integer] ID of the organization @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start (default to 0) @option opts [Integer] :limit Items shown per page @option opts [NumberBoolean] :done Whether the activity is done or not. 0 &#x3D; Not done, 1 &#x3D; Done. If omitted returns both Done and Not done activities. @option opts [String] :exclude A comma-separated string of activity IDs to exclude from result @return [nil]

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 231
def organizations_id_activities_get(id, opts = {})
  organizations_id_activities_get_with_http_info(id, opts)
  nil
end
organizations_id_activities_get_with_http_info(id, opts = {}) click to toggle source

List activities associated with an organization Lists activities associated with an organization. @param id [Integer] ID of the organization @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start @option opts [Integer] :limit Items shown per page @option opts [NumberBoolean] :done Whether the activity is done or not. 0 &#x3D; Not done, 1 &#x3D; Done. If omitted returns both Done and Not done activities. @option opts [String] :exclude A comma-separated string of activity IDs to exclude from result @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 245
def organizations_id_activities_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationsApi.organizations_id_activities_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 OrganizationsApi.organizations_id_activities_get"
  end
  # resource path
  local_var_path = '/organizations/{id}/activities'.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?
  query_params[:'done'] = opts[:'done'] if !opts[:'done'].nil?
  query_params[:'exclude'] = opts[:'exclude'] if !opts[:'exclude'].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', '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: OrganizationsApi#organizations_id_activities_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
organizations_id_deals_get(id, opts = {}) click to toggle source

List deals associated with an organization Lists deals associated with an organization. @param id [Integer] ID of the organization @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start (default to 0) @option opts [Integer] :limit Items shown per page @option opts [String] :status Only fetch deals with specific status. If omitted, all not deleted deals are fetched. (default to 'all_not_deleted') @option opts [String] :sort Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). @option opts [NumberBoolean] :only_primary_association If set, only deals that are directly associated to the organization are fetched. If not set (default), all deals are fetched that are either directly or indirectly related to the organization. Indirect relations include relations through custom, organization-type fields and through persons of the given organization. @return [nil]

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 304
def organizations_id_deals_get(id, opts = {})
  organizations_id_deals_get_with_http_info(id, opts)
  nil
end
organizations_id_deals_get_with_http_info(id, opts = {}) click to toggle source

List deals associated with an organization Lists deals associated with an organization. @param id [Integer] ID of the organization @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start @option opts [Integer] :limit Items shown per page @option opts [String] :status Only fetch deals with specific status. If omitted, all not deleted deals are fetched. @option opts [String] :sort Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). @option opts [NumberBoolean] :only_primary_association If set, only deals that are directly associated to the organization are fetched. If not set (default), all deals are fetched that are either directly or indirectly related to the organization. Indirect relations include relations through custom, organization-type fields and through persons of the given organization. @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 319
def organizations_id_deals_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationsApi.organizations_id_deals_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 OrganizationsApi.organizations_id_deals_get"
  end
  allowable_values = ["open", "won", "lost", "deleted", "all_not_deleted"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/organizations/{id}/deals'.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?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'only_primary_association'] = opts[:'only_primary_association'] if !opts[:'only_primary_association'].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', '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: OrganizationsApi#organizations_id_deals_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
organizations_id_delete(id, opts = {}) click to toggle source

Delete an organization Marks an organization as deleted. @param id [Integer] ID of the organization @param [Hash] opts the optional parameters @return [nil]

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 378
def organizations_id_delete(id, opts = {})
  organizations_id_delete_with_http_info(id, opts)
  nil
end
organizations_id_delete_with_http_info(id, opts = {}) click to toggle source

Delete an organization Marks an organization as deleted. @param id [Integer] ID of the organization @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 388
def organizations_id_delete_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationsApi.organizations_id_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 OrganizationsApi.organizations_id_delete"
  end
  # resource path
  local_var_path = '/organizations/{id}'.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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrganizationsApi#organizations_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
organizations_id_files_get(id, opts = {}) click to toggle source

List files attached to an organization Lists files associated with an organization. @param id [Integer] ID of the organization @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start (default to 0) @option opts [Integer] :limit Items shown per page @option opts [NumberBoolean] :include_deleted_files When enabled, the list of files will also include deleted files. Please note that trying to download these files will not work. @option opts [String] :sort Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). Supported fields: id, user_id, deal_id, person_id, org_id, product_id, add_time, update_time, file_name, file_type, file_size, comment. @return [nil]

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 442
def organizations_id_files_get(id, opts = {})
  organizations_id_files_get_with_http_info(id, opts)
  nil
end
organizations_id_files_get_with_http_info(id, opts = {}) click to toggle source

List files attached to an organization Lists files associated with an organization. @param id [Integer] ID of the organization @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start @option opts [Integer] :limit Items shown per page @option opts [NumberBoolean] :include_deleted_files When enabled, the list of files will also include deleted files. Please note that trying to download these files will not work. @option opts [String] :sort Field names and sorting mode separated by a comma (field_name_1 ASC, field_name_2 DESC). Only first-level field keys are supported (no nested keys). Supported fields: id, user_id, deal_id, person_id, org_id, product_id, add_time, update_time, file_name, file_type, file_size, comment. @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 456
def organizations_id_files_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationsApi.organizations_id_files_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 OrganizationsApi.organizations_id_files_get"
  end
  # resource path
  local_var_path = '/organizations/{id}/files'.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?
  query_params[:'include_deleted_files'] = opts[:'include_deleted_files'] if !opts[:'include_deleted_files'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].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', '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: OrganizationsApi#organizations_id_files_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
organizations_id_flow_get(id, opts = {}) click to toggle source

List updates about an organization Lists updates about an organization. @param id [Integer] ID of the organization @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start (default to 0) @option opts [Integer] :limit Items shown per page @option opts [String] :all_changes Whether to show custom field updates or not. 1 &#x3D; Include custom field changes. If omitted returns changes without custom field updates. @option opts [String] :items A comma-separated string for filtering out item specific updates. (Possible values - activity, plannedActivity, note, file, change, deal, follower, participant, mailMessage, mailMessageWithAttachment, invoice, activityFile, document) @return [nil]

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 514
def organizations_id_flow_get(id, opts = {})
  organizations_id_flow_get_with_http_info(id, opts)
  nil
end
organizations_id_flow_get_with_http_info(id, opts = {}) click to toggle source

List updates about an organization Lists updates about an organization. @param id [Integer] ID of the organization @param [Hash] opts the optional parameters @option opts [Integer] :start Pagination start @option opts [Integer] :limit Items shown per page @option opts [String] :all_changes Whether to show custom field updates or not. 1 &#x3D; Include custom field changes. If omitted returns changes without custom field updates. @option opts [String] :items A comma-separated string for filtering out item specific updates. (Possible values - activity, plannedActivity, note, file, change, deal, follower, participant, mailMessage, mailMessageWithAttachment, invoice, activityFile, document) @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 528
def organizations_id_flow_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationsApi.organizations_id_flow_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 OrganizationsApi.organizations_id_flow_get"
  end
  # resource path
  local_var_path = '/organizations/{id}/flow'.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?
  query_params[:'all_changes'] = opts[:'all_changes'] if !opts[:'all_changes'].nil?
  query_params[:'items'] = opts[:'items'] if !opts[:'items'].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', '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: OrganizationsApi#organizations_id_flow_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
organizations_id_followers_follower_id_delete(id, follower_id, opts = {}) click to toggle source

Delete a follower from an organization Deletes a follower from an organization. You can retrieve the follower_id from the <a href="List“>developers.pipedrive.com/docs/api/v1/#!/Organizations/get_organizations_id_followers">List followers of an organization</a> endpoint. @param id [Integer] ID of the organization @param follower_id [Integer] ID of the follower @param [Hash] opts the optional parameters @return [nil]

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 583
def organizations_id_followers_follower_id_delete(id, follower_id, opts = {})
  organizations_id_followers_follower_id_delete_with_http_info(id, follower_id, opts)
  nil
end
organizations_id_followers_follower_id_delete_with_http_info(id, follower_id, opts = {}) click to toggle source

Delete a follower from an organization Deletes a follower from an organization. You can retrieve the follower_id from the &lt;a href&#x3D;&quot;developers.pipedrive.com/docs/api/v1/#!/Organizations/get_organizations_id_followers">List followers of an organization&lt;/a&gt; endpoint. @param id [Integer] ID of the organization @param follower_id [Integer] ID of the follower @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 594
def organizations_id_followers_follower_id_delete_with_http_info(id, follower_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationsApi.organizations_id_followers_follower_id_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 OrganizationsApi.organizations_id_followers_follower_id_delete"
  end
  # verify the required parameter 'follower_id' is set
  if @api_client.config.client_side_validation && follower_id.nil?
    fail ArgumentError, "Missing the required parameter 'follower_id' when calling OrganizationsApi.organizations_id_followers_follower_id_delete"
  end
  # resource path
  local_var_path = '/organizations/{id}/followers/{follower_id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'follower_id' + '}', CGI.escape(follower_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']

  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: OrganizationsApi#organizations_id_followers_follower_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
organizations_id_followers_get(id, opts = {}) click to toggle source

List followers of an organization Lists the followers of an organization. @param id [Integer] ID of the organization @param [Hash] opts the optional parameters @return [nil]

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 648
def organizations_id_followers_get(id, opts = {})
  organizations_id_followers_get_with_http_info(id, opts)
  nil
end
organizations_id_followers_get_with_http_info(id, opts = {}) click to toggle source

List followers of an organization Lists the followers of an organization. @param id [Integer] ID of the organization @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 658
def organizations_id_followers_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationsApi.organizations_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 OrganizationsApi.organizations_id_followers_get"
  end
  # resource path
  local_var_path = '/organizations/{id}/followers'.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: OrganizationsApi#organizations_id_followers_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
organizations_id_followers_post(id, user_id, opts = {}) click to toggle source

Add a follower to an organization Adds a follower to an organization. @param id [Integer] ID of the organization @param user_id [Integer] ID of the user @param [Hash] opts the optional parameters @return [nil]

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 709
def organizations_id_followers_post(id, user_id, opts = {})
  organizations_id_followers_post_with_http_info(id, user_id, opts)
  nil
end
organizations_id_followers_post_with_http_info(id, user_id, opts = {}) click to toggle source

Add a follower to an organization Adds a follower to an organization. @param id [Integer] ID of the organization @param user_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/organizations_api.rb, line 720
def organizations_id_followers_post_with_http_info(id, user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationsApi.organizations_id_followers_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 OrganizationsApi.organizations_id_followers_post"
  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 OrganizationsApi.organizations_id_followers_post"
  end
  # resource path
  local_var_path = '/organizations/{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 '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['user_id'] = user_id

  # 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: OrganizationsApi#organizations_id_followers_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
organizations_id_get(id, opts = {}) click to toggle source

Get details of an organization Returns details of an organization. Note that this also returns some additional fields which are not present when asking for all organizations. Also note that custom fields appear as long hashes in the resulting data. These hashes can be mapped against the 'key' value of organizationFields. @param id [Integer] ID of the organization @param [Hash] opts the optional parameters @return [nil]

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 777
def organizations_id_get(id, opts = {})
  organizations_id_get_with_http_info(id, opts)
  nil
end
organizations_id_get_with_http_info(id, opts = {}) click to toggle source

Get details of an organization Returns details of an organization. Note that this also returns some additional fields which are not present when asking for all organizations. Also note that custom fields appear as long hashes in the resulting data. These hashes can be mapped against the &#39;key&#39; value of organizationFields. @param id [Integer] ID of the organization @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 787
def organizations_id_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationsApi.organizations_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 OrganizationsApi.organizations_id_get"
  end
  # resource path
  local_var_path = '/organizations/{id}'.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: OrganizationsApi#organizations_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
organizations_id_mail_messages_get(id, opts = {}) click to toggle source

List mail messages associated with an organization Lists mail messages associated with an organization. @param id [Integer] ID of the organization @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/organizations_api.rb, line 839
def organizations_id_mail_messages_get(id, opts = {})
  organizations_id_mail_messages_get_with_http_info(id, opts)
  nil
end
organizations_id_mail_messages_get_with_http_info(id, opts = {}) click to toggle source

List mail messages associated with an organization Lists mail messages associated with an organization. @param id [Integer] ID of the organization @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/organizations_api.rb, line 851
def organizations_id_mail_messages_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationsApi.organizations_id_mail_messages_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 OrganizationsApi.organizations_id_mail_messages_get"
  end
  # resource path
  local_var_path = '/organizations/{id}/mailMessages'.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', '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: OrganizationsApi#organizations_id_mail_messages_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
organizations_id_merge_put(id, merge_with_id, opts = {}) click to toggle source

Merge two organizations Merges an organization with another organization. For more information on how to merge two organizations, see <a href="pipedrive.readme.io/docs/merging-two-organizations" target="_blank" rel="noopener noreferrer">this tutorial</a>. @param id [Integer] ID of the organization @param merge_with_id [Integer] ID of the organization that the organization will be merged with @param [Hash] opts the optional parameters @return [nil]

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 904
def organizations_id_merge_put(id, merge_with_id, opts = {})
  organizations_id_merge_put_with_http_info(id, merge_with_id, opts)
  nil
end
organizations_id_merge_put_with_http_info(id, merge_with_id, opts = {}) click to toggle source

Merge two organizations Merges an organization with another organization. For more information on how to merge two organizations, see &lt;a href&#x3D;&quot;pipedrive.readme.io/docs/merging-two-organizations"; target&#x3D;&quot;_blank&quot; rel&#x3D;&quot;noopener noreferrer&quot;&gt;this tutorial&lt;/a&gt;. @param id [Integer] ID of the organization @param merge_with_id [Integer] ID of the organization that the organization will be merged with @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 915
def organizations_id_merge_put_with_http_info(id, merge_with_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationsApi.organizations_id_merge_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 OrganizationsApi.organizations_id_merge_put"
  end
  # verify the required parameter 'merge_with_id' is set
  if @api_client.config.client_side_validation && merge_with_id.nil?
    fail ArgumentError, "Missing the required parameter 'merge_with_id' when calling OrganizationsApi.organizations_id_merge_put"
  end
  # resource path
  local_var_path = '/organizations/{id}/merge'.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['merge_with_id'] = merge_with_id

  # 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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrganizationsApi#organizations_id_merge_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
organizations_id_permitted_users_get(id, opts = {}) click to toggle source

List permitted users List users permitted to access an organization @param id [Integer] ID of the organization @param [Hash] opts the optional parameters @return [nil]

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 972
def organizations_id_permitted_users_get(id, opts = {})
  organizations_id_permitted_users_get_with_http_info(id, opts)
  nil
end
organizations_id_permitted_users_get_with_http_info(id, opts = {}) click to toggle source

List permitted users List users permitted to access an organization @param id [Integer] ID of the organization @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 982
def organizations_id_permitted_users_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationsApi.organizations_id_permitted_users_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 OrganizationsApi.organizations_id_permitted_users_get"
  end
  # resource path
  local_var_path = '/organizations/{id}/permittedUsers'.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']

  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: OrganizationsApi#organizations_id_permitted_users_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
organizations_id_persons_get(id, opts = {}) click to toggle source

List persons of an organization Lists persons associated with an organization. @param id [Integer] ID of the organization @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/organizations_api.rb, line 1034
def organizations_id_persons_get(id, opts = {})
  organizations_id_persons_get_with_http_info(id, opts)
  nil
end
organizations_id_persons_get_with_http_info(id, opts = {}) click to toggle source

List persons of an organization Lists persons associated with an organization. @param id [Integer] ID of the organization @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/organizations_api.rb, line 1046
def organizations_id_persons_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationsApi.organizations_id_persons_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 OrganizationsApi.organizations_id_persons_get"
  end
  # resource path
  local_var_path = '/organizations/{id}/persons'.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', '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: OrganizationsApi#organizations_id_persons_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
organizations_id_put(id, opts = {}) click to toggle source

Update an organization Updates the properties of an organization. @param id [Integer] ID of the organization @param [Hash] opts the optional parameters @option opts [String] :name Organization name @option opts [Integer] :owner_id ID of the user who will be marked as the owner of this organization. When omitted, the authorized user ID will be used. @option opts [VisibleTo] :visible_to Visibility of the organization. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user.&lt;dl class&#x3D;\\\&quot;fields-list\\\&quot;&gt;&lt;dt&gt;1&lt;/dt&gt;&lt;dd&gt;Owner &amp;amp; followers (private)&lt;/dd&gt;&lt;dt&gt;3&lt;/dt&gt;&lt;dd&gt;Entire company (shared)&lt;/dd&gt;&lt;/dl&gt; @return [nil]

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 1101
def organizations_id_put(id, opts = {})
  organizations_id_put_with_http_info(id, opts)
  nil
end
organizations_id_put_with_http_info(id, opts = {}) click to toggle source

Update an organization Updates the properties of an organization. @param id [Integer] ID of the organization @param [Hash] opts the optional parameters @option opts [String] :name Organization name @option opts [Integer] :owner_id ID of the user who will be marked as the owner of this organization. When omitted, the authorized user ID will be used. @option opts [VisibleTo] :visible_to Visibility of the organization. If omitted, visibility will be set to the default visibility setting of this item type for the authorized user.&lt;dl class&#x3D;\\\&quot;fields-list\\\&quot;&gt;&lt;dt&gt;1&lt;/dt&gt;&lt;dd&gt;Owner &amp;amp; followers (private)&lt;/dd&gt;&lt;dt&gt;3&lt;/dt&gt;&lt;dd&gt;Entire company (shared)&lt;/dd&gt;&lt;/dl&gt; @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 1114
def organizations_id_put_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationsApi.organizations_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 OrganizationsApi.organizations_id_put"
  end
  # resource path
  local_var_path = '/organizations/{id}'.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['name'] = opts[:'name'] if !opts[:'name'].nil?
  form_params['owner_id'] = opts[:'owner_id'] if !opts[:'owner_id'].nil?
  form_params['visible_to'] = opts[:'visible_to'] if !opts[:'visible_to'].nil?

  # 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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OrganizationsApi#organizations_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
organizations_post(opts = {}) click to toggle source

Add an organization Adds a new organization. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the organizationFields and look for 'key' values. For more information on how to add an organization, see <a href="pipedrive.readme.io/docs/adding-an-organization" target="_blank" rel="noopener noreferrer">this tutorial</a>. @param [Hash] opts the optional parameters @return [nil]

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 1168
def organizations_post(opts = {})
  organizations_post_with_http_info(opts)
  nil
end
organizations_post_with_http_info(opts = {}) click to toggle source

Add an organization Adds a new organization. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys. To determine which custom fields exists, fetch the organizationFields and look for &#39;key&#39; values. For more information on how to add an organization, see &lt;a href&#x3D;&quot;pipedrive.readme.io/docs/adding-an-organization"; target&#x3D;&quot;_blank&quot; rel&#x3D;&quot;noopener noreferrer&quot;&gt;this tutorial&lt;/a&gt;. @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 1177
def organizations_post_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationsApi.organizations_post ...'
  end
  # resource path
  local_var_path = '/organizations'

  # 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] || {}

  # 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: OrganizationsApi#organizations_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
organizations_search_get(term, opts = {}) click to toggle source

Search organizations Searches all Organizations by name, address, notes and/or custom fields. This endpoint is a wrapper of <a href="/v1/itemSearchdevelopers.pipedrive.com/docs/api/v1/#!/ItemSearch/get_itemSearch">/v1/itemSearch> with a narrower OAuth scope. @param term [String] The search term to look for. Minimum 2 characters (or 1 if using exact_match). @param [Hash] opts the optional parameters @option opts [String] :fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. @option opts [Boolean] :exact_match When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive. @option opts [Integer] :start Pagination start. Note that the pagination is based on main results and does not include related items when using search_for_related_items parameter. (default to 0) @option opts [Integer] :limit Items shown per page @return [BaseResponse]

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 1229
def organizations_search_get(term, opts = {})
  data, _status_code, _headers = organizations_search_get_with_http_info(term, opts)
  data
end
organizations_search_get_with_http_info(term, opts = {}) click to toggle source

Search organizations Searches all Organizations by name, address, notes and/or custom fields. This endpoint is a wrapper of &lt;a href&#x3D;&quot;developers.pipedrive.com/docs/api/v1/#!/ItemSearch/get_itemSearch">/v1/itemSearch</a>; with a narrower OAuth scope. @param term [String] The search term to look for. Minimum 2 characters (or 1 if using exact_match). @param [Hash] opts the optional parameters @option opts [String] :fields A comma-separated string array. The fields to perform the search from. Defaults to all of them. @option opts [Boolean] :exact_match When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive. @option opts [Integer] :start Pagination start. Note that the pagination is based on main results and does not include related items when using search_for_related_items parameter. @option opts [Integer] :limit Items shown per page @return [Array<(BaseResponse, Integer, Hash)>] BaseResponse data, response status code and response headers

# File lib/pipedrive-openapi-client/api/organizations_api.rb, line 1243
def organizations_search_get_with_http_info(term, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: OrganizationsApi.organizations_search_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 OrganizationsApi.organizations_search_get"
  end
  allowable_values = ["address", "custom_fields", "notes", "name"]
  if @api_client.config.client_side_validation && opts[:'fields'] && !allowable_values.include?(opts[:'fields'])
    fail ArgumentError, "invalid value for \"fields\", must be one of #{allowable_values}"
  end
  allowable_values = ["true", "false"]
  if @api_client.config.client_side_validation && opts[:'exact_match'] && !allowable_values.include?(opts[:'exact_match'])
    fail ArgumentError, "invalid value for \"exact_match\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/organizations/search'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'term'] = term
  query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
  query_params[:'exact_match'] = opts[:'exact_match'] if !opts[:'exact_match'].nil?
  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] || {}
  # 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] || 'BaseResponse' 

  # 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: OrganizationsApi#organizations_search_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end