Class: Line::Bot::V2::Insight::ApiClient
- Inherits:
-
Object
- Object
- Line::Bot::V2::Insight::ApiClient
- Defined in:
- lib/line/bot/v2/insight/api/insight_client.rb
Instance Method Summary collapse
-
#get_friends_demographics ⇒ Line::Bot::V2::Insight::GetFriendsDemographicsResponse, ...
Retrieves the demographic attributes for a LINE Official Account’s friends.You can only retrieve information about friends for LINE Official Accounts created by users in Japan (JP), Thailand (TH), Taiwan (TW) and Indonesia (ID).
-
#get_friends_demographics_with_http_info ⇒ Array(Line::Bot::V2::Insight::GetFriendsDemographicsResponse, Integer, Hash{String => String}), Array((String|nil), Integer, Hash{String => String})
Retrieves the demographic attributes for a LINE Official Account’s friends.You can only retrieve information about friends for LINE Official Accounts created by users in Japan (JP), Thailand (TH), Taiwan (TW) and Indonesia (ID).
-
#get_message_event(request_id:) ⇒ Line::Bot::V2::Insight::GetMessageEventResponse, ...
Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account.
-
#get_message_event_with_http_info(request_id:) ⇒ Array(Line::Bot::V2::Insight::GetMessageEventResponse, Integer, Hash{String => String}), Array((String|nil), Integer, Hash{String => String})
Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account.
-
#get_number_of_followers(date: nil) ⇒ Line::Bot::V2::Insight::GetNumberOfFollowersResponse, ...
Returns the number of users who have added the LINE Official Account on or before a specified date.
-
#get_number_of_followers_with_http_info(date: nil) ⇒ Array(Line::Bot::V2::Insight::GetNumberOfFollowersResponse, Integer, Hash{String => String}), Array((String|nil), Integer, Hash{String => String})
Returns the number of users who have added the LINE Official Account on or before a specified date.
-
#get_number_of_message_deliveries(date:) ⇒ Line::Bot::V2::Insight::GetNumberOfMessageDeliveriesResponse, ...
Returns the number of messages sent from LINE Official Account on a specified day.
-
#get_number_of_message_deliveries_with_http_info(date:) ⇒ Array(Line::Bot::V2::Insight::GetNumberOfMessageDeliveriesResponse, Integer, Hash{String => String}), Array((String|nil), Integer, Hash{String => String})
Returns the number of messages sent from LINE Official Account on a specified day.
-
#get_statistics_per_unit(custom_aggregation_unit:, from:, to:) ⇒ Line::Bot::V2::Insight::GetStatisticsPerUnitResponse, ...
You can check the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account.
-
#get_statistics_per_unit_with_http_info(custom_aggregation_unit:, from:, to:) ⇒ Array(Line::Bot::V2::Insight::GetStatisticsPerUnitResponse, Integer, Hash{String => String}), Array((String|nil), Integer, Hash{String => String})
You can check the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account.
-
#initialize(base_url: nil, channel_access_token:, http_options: {}) ⇒ ApiClient
constructor
Initializes a new ApiClient instance.
Constructor Details
#initialize(base_url: nil, channel_access_token:, http_options: {}) ⇒ ApiClient
Initializes a new Line::Bot::V2::Insight::ApiClient instance.
38 39 40 41 42 43 44 45 46 |
# File 'lib/line/bot/v2/insight/api/insight_client.rb', line 38 def initialize(base_url: nil, channel_access_token:, http_options: {}) @http_client = HttpClient.new( base_url: base_url || 'https://api.line.me', http_headers: { Authorization: "Bearer #{channel_access_token}" }, http_options: ) end |
Instance Method Details
#get_friends_demographics ⇒ Line::Bot::V2::Insight::GetFriendsDemographicsResponse, ...
Retrieves the demographic attributes for a LINE Official Account’s friends.You can only retrieve information about friends for LINE Official Accounts created by users in Japan (JP), Thailand (TH), Taiwan (TW) and Indonesia (ID). This requests to GET https://api.line.me/v2/bot/insight/demographic
When you want to get HTTP status code or response headers, use #get_friends_demographics_with_http_info instead of this.
83 84 85 86 87 88 89 |
# File 'lib/line/bot/v2/insight/api/insight_client.rb', line 83 def get_friends_demographics( ) response_body, _status_code, _headers = get_friends_demographics_with_http_info( ) response_body end |
#get_friends_demographics_with_http_info ⇒ Array(Line::Bot::V2::Insight::GetFriendsDemographicsResponse, Integer, Hash{String => String}), Array((String|nil), Integer, Hash{String => String})
Retrieves the demographic attributes for a LINE Official Account’s friends.You can only retrieve information about friends for LINE Official Accounts created by users in Japan (JP), Thailand (TH), Taiwan (TW) and Indonesia (ID). This requests to GET https://api.line.me/v2/bot/insight/demographic
This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/line/bot/v2/insight/api/insight_client.rb', line 55 def get_friends_demographics_with_http_info( # steep:ignore MethodBodyTypeMismatch ) path = "/v2/bot/insight/demographic" response = @http_client.get( path: path, ) case response.code.to_i when 200 json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body)) json.transform_keys! do |key| Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key end response_body = Line::Bot::V2::Insight::GetFriendsDemographicsResponse.create(json) # steep:ignore InsufficientKeywordArguments [response_body, 200, response.each_header.to_h] else [response.body, response.code.to_i, response.each_header.to_h] end end |
#get_message_event(request_id:) ⇒ Line::Bot::V2::Insight::GetMessageEventResponse, ...
Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account. This requests to GET https://api.line.me/v2/bot/insight/message/event
When you want to get HTTP status code or response headers, use #get_message_event_with_http_info instead of this.
133 134 135 136 137 138 139 140 141 |
# File 'lib/line/bot/v2/insight/api/insight_client.rb', line 133 def ( request_id: ) response_body, _status_code, _headers = ( request_id: request_id ) response_body end |
#get_message_event_with_http_info(request_id:) ⇒ Array(Line::Bot::V2::Insight::GetMessageEventResponse, Integer, Hash{String => String}), Array((String|nil), Integer, Hash{String => String})
Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account. This requests to GET https://api.line.me/v2/bot/insight/message/event
This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# File 'lib/line/bot/v2/insight/api/insight_client.rb', line 99 def ( # steep:ignore MethodBodyTypeMismatch request_id: ) path = "/v2/bot/insight/message/event" query_params = { "requestId": request_id }.compact response = @http_client.get( path: path, query_params: query_params, ) case response.code.to_i when 200 json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body)) json.transform_keys! do |key| Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key end response_body = Line::Bot::V2::Insight::GetMessageEventResponse.create(json) # steep:ignore InsufficientKeywordArguments [response_body, 200, response.each_header.to_h] else [response.body, response.code.to_i, response.each_header.to_h] end end |
#get_number_of_followers(date: nil) ⇒ Line::Bot::V2::Insight::GetNumberOfFollowersResponse, ...
Returns the number of users who have added the LINE Official Account on or before a specified date. This requests to GET https://api.line.me/v2/bot/insight/followers
When you want to get HTTP status code or response headers, use #get_number_of_followers_with_http_info instead of this.
185 186 187 188 189 190 191 192 193 |
# File 'lib/line/bot/v2/insight/api/insight_client.rb', line 185 def get_number_of_followers( date: nil ) response_body, _status_code, _headers = get_number_of_followers_with_http_info( date: date ) response_body end |
#get_number_of_followers_with_http_info(date: nil) ⇒ Array(Line::Bot::V2::Insight::GetNumberOfFollowersResponse, Integer, Hash{String => String}), Array((String|nil), Integer, Hash{String => String})
Returns the number of users who have added the LINE Official Account on or before a specified date. This requests to GET https://api.line.me/v2/bot/insight/followers
This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
# File 'lib/line/bot/v2/insight/api/insight_client.rb', line 151 def get_number_of_followers_with_http_info( # steep:ignore MethodBodyTypeMismatch date: nil ) path = "/v2/bot/insight/followers" query_params = { "date": date }.compact response = @http_client.get( path: path, query_params: query_params, ) case response.code.to_i when 200 json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body)) json.transform_keys! do |key| Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key end response_body = Line::Bot::V2::Insight::GetNumberOfFollowersResponse.create(json) # steep:ignore InsufficientKeywordArguments [response_body, 200, response.each_header.to_h] else [response.body, response.code.to_i, response.each_header.to_h] end end |
#get_number_of_message_deliveries(date:) ⇒ Line::Bot::V2::Insight::GetNumberOfMessageDeliveriesResponse, ...
Returns the number of messages sent from LINE Official Account on a specified day. This requests to GET https://api.line.me/v2/bot/insight/message/delivery
When you want to get HTTP status code or response headers, use #get_number_of_message_deliveries_with_http_info instead of this.
237 238 239 240 241 242 243 244 245 |
# File 'lib/line/bot/v2/insight/api/insight_client.rb', line 237 def ( date: ) response_body, _status_code, _headers = ( date: date ) response_body end |
#get_number_of_message_deliveries_with_http_info(date:) ⇒ Array(Line::Bot::V2::Insight::GetNumberOfMessageDeliveriesResponse, Integer, Hash{String => String}), Array((String|nil), Integer, Hash{String => String})
Returns the number of messages sent from LINE Official Account on a specified day. This requests to GET https://api.line.me/v2/bot/insight/message/delivery
This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 |
# File 'lib/line/bot/v2/insight/api/insight_client.rb', line 203 def ( # steep:ignore MethodBodyTypeMismatch date: ) path = "/v2/bot/insight/message/delivery" query_params = { "date": date }.compact response = @http_client.get( path: path, query_params: query_params, ) case response.code.to_i when 200 json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body)) json.transform_keys! do |key| Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key end response_body = Line::Bot::V2::Insight::GetNumberOfMessageDeliveriesResponse.create(json) # steep:ignore InsufficientKeywordArguments [response_body, 200, response.each_header.to_h] else [response.body, response.code.to_i, response.each_header.to_h] end end |
#get_statistics_per_unit(custom_aggregation_unit:, from:, to:) ⇒ Line::Bot::V2::Insight::GetStatisticsPerUnitResponse, ...
You can check the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account. This requests to GET https://api.line.me/v2/bot/insight/message/event/aggregation
When you want to get HTTP status code or response headers, use #get_statistics_per_unit_with_http_info instead of this.
297 298 299 300 301 302 303 304 305 306 307 308 309 |
# File 'lib/line/bot/v2/insight/api/insight_client.rb', line 297 def get_statistics_per_unit( custom_aggregation_unit:, from:, to: ) response_body, _status_code, _headers = get_statistics_per_unit_with_http_info( custom_aggregation_unit: custom_aggregation_unit, from: from, to: to ) response_body end |
#get_statistics_per_unit_with_http_info(custom_aggregation_unit:, from:, to:) ⇒ Array(Line::Bot::V2::Insight::GetStatisticsPerUnitResponse, Integer, Hash{String => String}), Array((String|nil), Integer, Hash{String => String})
You can check the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account. This requests to GET https://api.line.me/v2/bot/insight/message/event/aggregation
This returns an array containing response, HTTP status code, and header in order. Please specify all header keys in lowercase.
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 |
# File 'lib/line/bot/v2/insight/api/insight_client.rb', line 257 def get_statistics_per_unit_with_http_info( # steep:ignore MethodBodyTypeMismatch custom_aggregation_unit:, from:, to: ) path = "/v2/bot/insight/message/event/aggregation" query_params = { "customAggregationUnit": custom_aggregation_unit, "from": from, "to": to }.compact response = @http_client.get( path: path, query_params: query_params, ) case response.code.to_i when 200 json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body)) json.transform_keys! do |key| Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key end response_body = Line::Bot::V2::Insight::GetStatisticsPerUnitResponse.create(json) # steep:ignore InsufficientKeywordArguments [response_body, 200, response.each_header.to_h] else [response.body, response.code.to_i, response.each_header.to_h] end end |