class Pipedrive::ActivitiesApi
Attributes
Public Class Methods
# File lib/pipedrive-openapi-client/api/activities_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Delete multiple activities in bulk Marks multiple activities 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/activities_api.rb, line 27 def activities_delete(ids, opts = {}) activities_delete_with_http_info(ids, opts) nil end
Delete multiple activities in bulk Marks multiple activities 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/activities_api.rb, line 37 def activities_delete_with_http_info(ids, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ActivitiesApi.activities_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 ActivitiesApi.activities_delete" end # resource path local_var_path = '/activities' # 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: ActivitiesApi#activities_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get all activities assigned to a particular user Returns all activities assigned to a particular user. @param [Hash] opts the optional parameters @option opts [Integer] :user_id ID of the user whose activities will be fetched. If omitted, the user associated with the API token will be used. If 0, activities for all company users will be fetched based on the permission sets. @option opts [Integer] :filter_id ID of the filter to use (will narrow down results if used together with user_id parameter). @option opts [String] :type Type of the activity, can be one type or multiple types separated by a comma. This is in correlation with the key_string parameter of ActivityTypes. @option opts [Integer] :start Pagination start (default to 0) @option opts [Integer] :limit Items shown per page @option opts [Date] :start_date Use the activity due date where you wish to begin fetching activities from. Insert due date in YYYY-MM-DD format. @option opts [Date] :end_date Use the activity due date where you wish to stop fetching activities from. Insert due date in YYYY-MM-DD format. @option opts [NumberBoolean] :done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both Done and Not done activities. @return [nil]
# File lib/pipedrive-openapi-client/api/activities_api.rb, line 95 def activities_get(opts = {}) activities_get_with_http_info(opts) nil end
Get all activities assigned to a particular user Returns all activities assigned to a particular user. @param [Hash] opts the optional parameters @option opts [Integer] :user_id ID of the user whose activities will be fetched. If omitted, the user associated with the API token will be used. If 0, activities for all company users will be fetched based on the permission sets. @option opts [Integer] :filter_id ID of the filter to use (will narrow down results if used together with user_id parameter). @option opts [String] :type Type of the activity, can be one type or multiple types separated by a comma. This is in correlation with the key_string parameter of ActivityTypes. @option opts [Integer] :start Pagination start @option opts [Integer] :limit Items shown per page @option opts [Date] :start_date Use the activity due date where you wish to begin fetching activities from. Insert due date in YYYY-MM-DD format. @option opts [Date] :end_date Use the activity due date where you wish to stop fetching activities from. Insert due date in YYYY-MM-DD format. @option opts [NumberBoolean] :done Whether the activity is done or not. 0 = Not done, 1 = Done. If omitted returns both Done and Not done activities. @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/pipedrive-openapi-client/api/activities_api.rb, line 112 def activities_get_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ActivitiesApi.activities_get ...' end # resource path local_var_path = '/activities' # 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[:'type'] = opts[:'type'] if !opts[:'type'].nil? query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil? query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil? query_params[:'done'] = opts[:'done'] if !opts[:'done'].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: ActivitiesApi#activities_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Delete an activity Deletes an activity. @param id [Integer] ID of the activity @param [Hash] opts the optional parameters @return [nil]
# File lib/pipedrive-openapi-client/api/activities_api.rb, line 166 def activities_id_delete(id, opts = {}) activities_id_delete_with_http_info(id, opts) nil end
Delete an activity Deletes an activity. @param id [Integer] ID of the activity @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/pipedrive-openapi-client/api/activities_api.rb, line 176 def activities_id_delete_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ActivitiesApi.activities_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 ActivitiesApi.activities_id_delete" end # resource path local_var_path = '/activities/{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: ActivitiesApi#activities_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get details of an activity Returns details of a specific activity. @param id [Integer] ID of the activity @param [Hash] opts the optional parameters @return [nil]
# File lib/pipedrive-openapi-client/api/activities_api.rb, line 226 def activities_id_get(id, opts = {}) activities_id_get_with_http_info(id, opts) nil end
Get details of an activity Returns details of a specific activity. @param id [Integer] ID of the activity @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/pipedrive-openapi-client/api/activities_api.rb, line 236 def activities_id_get_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ActivitiesApi.activities_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 ActivitiesApi.activities_id_get" end # resource path local_var_path = '/activities/{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: ActivitiesApi#activities_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Edit an activity Modifies an activity. Includes more_activities_scheduled_in_context property in response's additional_data which indicates whether there are more undone activities scheduled with the same deal, person or organization (depending on the supplied data). @param id [Integer] ID of the activity @param [Hash] opts the optional parameters @option opts [Activity] :activity @return [nil]
# File lib/pipedrive-openapi-client/api/activities_api.rb, line 287 def activities_id_put(id, opts = {}) activities_id_put_with_http_info(id, opts) nil end
Edit an activity Modifies an activity. Includes more_activities_scheduled_in_context property in response's additional_data which indicates whether there are more undone activities scheduled with the same deal, person or organization (depending on the supplied data). @param id [Integer] ID of the activity @param [Hash] opts the optional parameters @option opts [Activity] :activity @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/pipedrive-openapi-client/api/activities_api.rb, line 298 def activities_id_put_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ActivitiesApi.activities_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 ActivitiesApi.activities_id_put" end # resource path local_var_path = '/activities/{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/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(opts[:'activity']) # 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: ActivitiesApi#activities_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Add an activity Adds a new activity. Includes more_activities_scheduled_in_context property in response's additional_data which indicates whether there are more undone activities scheduled with the same deal, person or organization (depending on the supplied data). For more information on how to add an activity, see <a href="pipedrive.readme.io/docs/adding-an-activity" target="_blank" rel="noopener noreferrer">this tutorial</a>. @param [Hash] opts the optional parameters @option opts [Activity] :activity @return [nil]
# File lib/pipedrive-openapi-client/api/activities_api.rb, line 350 def activities_post(opts = {}) activities_post_with_http_info(opts) nil end
Add an activity Adds a new activity. Includes more_activities_scheduled_in_context property in response's additional_data which indicates whether there are more undone activities scheduled with the same deal, person or organization (depending on the supplied data). For more information on how to add an activity, see <a href="pipedrive.readme.io/docs/adding-an-activity" target="_blank" rel="noopener noreferrer">this tutorial</a>. @param [Hash] opts the optional parameters @option opts [Activity] :activity @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/pipedrive-openapi-client/api/activities_api.rb, line 360 def activities_post_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ActivitiesApi.activities_post ...' end # resource path local_var_path = '/activities' # 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/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(opts[:'activity']) # 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: ActivitiesApi#activities_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end