Class: Google::Apis::MybusinessbusinesscallsV1::MyBusinessBusinessCallsService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/mybusinessbusinesscalls_v1/service.rb

Overview

My Business Business Calls API

The My Business Business Calls API manages business calls information of a location on Google and collect insights like the number of missed calls to their location. Additional information about Business calls can be found at https://support.google.com/business/answer/9688285?p=call_history. If the Google Business Profile links to a Google Ads account and call history is turned on, calls that last longer than a specific time, and that can be attributed to an ad interaction, will show in the linked Google Ads account under the "Calls from Ads" conversion. If smart bidding and call conversions are used in the optimization strategy, there could be a change in ad spend. Learn more about smart bidding. To view and perform actions on a location's calls, you need to be a OWNER, CO_OWNER or MANAGER of the location. Note

  • If you have a quota of 0 after enabling the API, please request for GBP API access.

Examples:

require 'google/apis/mybusinessbusinesscalls_v1'

Mybusinessbusinesscalls = Google::Apis::MybusinessbusinesscallsV1 # Alias the module
service = Mybusinessbusinesscalls::MyBusinessBusinessCallsService.new

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMyBusinessBusinessCallsService

Returns a new instance of MyBusinessBusinessCallsService.



57
58
59
60
61
62
# File 'lib/google/apis/mybusinessbusinesscalls_v1/service.rb', line 57

def initialize
  super('https://mybusinessbusinesscalls.googleapis.com/', '',
        client_name: 'google-apis-mybusinessbusinesscalls_v1',
        client_version: Google::Apis::MybusinessbusinesscallsV1::GEM_VERSION)
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



50
51
52
# File 'lib/google/apis/mybusinessbusinesscalls_v1/service.rb', line 50

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.



55
56
57
# File 'lib/google/apis/mybusinessbusinesscalls_v1/service.rb', line 55

def quota_user
  @quota_user
end

Instance Method Details

#get_location_businesscallssettings(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessbusinesscallsV1::BusinessCallsSettings

Returns the Business calls settings resource for the given location.

Parameters:

  • name (String)

    Required. The BusinessCallsSettings to get. The name field is used to identify the business call settings to get. Format: locations/location_id/ businesscallssettings.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



86
87
88
89
90
91
92
93
94
# File 'lib/google/apis/mybusinessbusinesscalls_v1/service.rb', line 86

def get_location_businesscallssettings(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::MybusinessbusinesscallsV1::BusinessCallsSettings::Representation
  command.response_class = Google::Apis::MybusinessbusinesscallsV1::BusinessCallsSettings
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_location_businesscallsinsights(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessbusinesscallsV1::ListBusinessCallsInsightsResponse

Returns insights for Business calls for a location.

Parameters:

  • parent (String)

    Required. The parent location to fetch calls insights for. Format: locations/ location_id

  • filter (String) (defaults to: nil)

    Optional. A filter constraining the calls insights to return. The response includes only entries that match the filter. If the MetricType is not provided, AGGREGATE_COUNT is returned. If no end_date is provided, the last date for which data is available is used. If no start_date is provided, we will default to the first date for which data is available, which is currently 6 months. If start_date is before the date when data is available, data is returned starting from the date when it is available. At this time we support following filters. 1. start_date="DATE" where date is in YYYY-MM-DD format. 2. end_date=" DATE" where date is in YYYY-MM-DD format. 3. metric_type=XYZ where XYZ is a valid MetricType. 4. Conjunctions(AND) of all of the above. e.g., "start_date= 2021-08-01 AND end_date=2021-08-10 AND metric_type=AGGREGATE_COUNT" The AGGREGATE_COUNT metric_type ignores the DD part of the date.

  • page_size (Fixnum) (defaults to: nil)

    Optional. The maximum number of BusinessCallsInsights to return. If unspecified, at most 20 will be returned. Some of the metric_types(e.g, AGGREGATE_COUNT) returns a single page. For these metrics, the page_size is ignored.

  • page_token (String) (defaults to: nil)

    Optional. A page token, received from a previous ListBusinessCallsInsights call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListBusinessCallsInsights must match the call that provided the page token. Some of the metric_types (e.g, AGGREGATE_COUNT) returns a single page. For these metrics, the pake_token is ignored.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



178
179
180
181
182
183
184
185
186
187
188
189
# File 'lib/google/apis/mybusinessbusinesscalls_v1/service.rb', line 178

def list_location_businesscallsinsights(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/businesscallsinsights', options)
  command.response_representation = Google::Apis::MybusinessbusinesscallsV1::ListBusinessCallsInsightsResponse::Representation
  command.response_class = Google::Apis::MybusinessbusinesscallsV1::ListBusinessCallsInsightsResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_location_businesscallssettings(name, business_calls_settings_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::MybusinessbusinesscallsV1::BusinessCallsSettings

Updates the Business call settings for the specified location.

Parameters:

  • name (String)

    Required. The resource name of the calls settings. Format: locations/location /businesscallssettings

  • business_calls_settings_object (Google::Apis::MybusinessbusinesscallsV1::BusinessCallsSettings) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    Required. The list of fields to update.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/google/apis/mybusinessbusinesscalls_v1/service.rb', line 120

def update_location_businesscallssettings(name, business_calls_settings_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v1/{+name}', options)
  command.request_representation = Google::Apis::MybusinessbusinesscallsV1::BusinessCallsSettings::Representation
  command.request_object = business_calls_settings_object
  command.response_representation = Google::Apis::MybusinessbusinesscallsV1::BusinessCallsSettings::Representation
  command.response_class = Google::Apis::MybusinessbusinesscallsV1::BusinessCallsSettings
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end